Leads API
The leads endpoints let you submit leads and read what happened to them. Base URL: https://api.pingdex.io/api/v1.
| Method | Path | Scope | Purpose |
|---|---|---|---|
POST |
/leads |
leads:ingest |
Submit a lead. |
GET |
/leads |
leads:read |
List leads. |
GET |
/leads/{lead} |
leads:read |
Show a lead. |
GET |
/leads/{lead}/attempts |
leads:read |
List lead attempts. |
All examples assume:
export PINGDEX_API_KEY="pdx_example_0123456789abcdef"Submit a lead
Section titled “Submit a lead”POST /leadsAccepts a lead for one enabled campaign. Pingdex validates it against the campaign’s lead schema, stores it with the status received, and processes and delivers it afterwards. The response confirms receipt only.
Scope: leads:ingest
Headers
Section titled “Headers”| Header | Required | Description |
|---|---|---|
Authorization |
Yes | Bearer <token>. |
Content-Type |
Yes | application/json. |
Idempotency-Key |
No | A client-chosen string that makes retries safe. Must not be empty or whitespace only, and must be at most 255 characters. Keys are scoped to your account. See Idempotency. |
The body is a JSON object with exactly these keys. Any other top-level key is refused.
| Field | Type | Required | Description |
|---|---|---|---|
campaign_id |
string (UUID) | Yes | The campaign that owns and routes the lead. It must be enabled and belong to your account. |
payload |
object | Yes | The lead data. Must be a non-empty JSON object, not an array. Validated against the campaign schema. |
external_id |
string or null | No | Your own reference for the lead, up to 255 characters. Returned when you read the lead. It does not deduplicate requests. |
Payload validation
Section titled “Payload validation”The payload is checked against the campaign’s schema before anything is stored:
- A field with
required: truemust be present and notnull. - A field with
required: falsemay be absent ornull. When present it must match its type. - Types are
string,integer,numberandboolean. They are checked with Laravel validation rules, so a numeric string such as"30"satisfiesinteger, and0,1,"0"and"1"satisfyboolean. - Fields that are not in the schema are accepted and stored. Provider mappings can read them with
payload.<path>sources.
Responses
Section titled “Responses”| Status | Meaning |
|---|---|
202 |
The lead was accepted. |
401 |
Missing, invalid or expired token. |
403 |
The token does not have leads:ingest. |
409 |
The Idempotency-Key was already used with a different request. |
422 |
Validation failed. Nothing was stored. |
202 Accepted
Section titled “202 Accepted”The body is a flat object. It is not wrapped in data.
| Field | Type | Description |
|---|---|---|
id |
string (UUID) | The lead identifier. Keep it to read the lead later. |
status |
string | Always received for a new lead. |
{ "id": "a91d3f6e-2b7c-4c85-8e10-d4f5a6b7c8d9", "status": "received"}409 Conflict
Section titled “409 Conflict”{ "message": "Idempotency key was reused with a different request."}422 Unprocessable
Section titled “422 Unprocessable”{ "message": "The payload.email field is required.", "errors": { "payload.email": [ "The payload.email field is required." ] }}See Errors for the other messages this endpoint returns.
Example
Section titled “Example”curl https://api.pingdex.io/api/v1/leads \ --request POST \ --header "Authorization: Bearer $PINGDEX_API_KEY" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --header "Idempotency-Key: 5f0c2d9e-8a41-4b7c-9d3e-2a6b1c4f7e80" \ --data '{ "campaign_id": "3e1a7c52-9b04-4d68-a2f1-6c8d0e5b7a93", "external_id": "web-2026-000123", "payload": { "email": "sam.example@example.com", "postcode": "XX1 1XX", "property_value": 325000, "marketing_consent": true } }'Idempotency
Section titled “Idempotency”Send an Idempotency-Key to make retries safe.
- The same key with the same request returns
202with the original leadid. No second lead is stored and processing does not start again. - The same key with a different
campaign_id,external_idorpayloadreturns409. - The request is compared by content. Object keys in the payload are sorted before comparison, so key order does not matter. The order of items in a JSON array does matter.
- A replay returns the original lead even if the campaign has since been disabled or its schema has changed.
- Keys are independent between accounts and are held only for
POST /leads. - Without the header, every request creates a new lead, including when
external_idrepeats.
For retry guidance, see Idempotency.
List leads
Section titled “List leads”GET /leadsReturns leads for your account, newest first, in cursor-paginated pages. Leads are ordered by received_at descending, then by id descending, so the order is stable.
Scope: leads:read
Query parameters
Section titled “Query parameters”All parameters are optional.
| Parameter | Type | Description |
|---|---|---|
campaign_id |
string (UUID) | Only leads in this campaign. |
status |
string | Only leads with this lead status. |
commercial_status |
string | Only leads with this commercial status. |
external_id |
string | Exact match on external_id, up to 255 characters. |
received_from |
date or date-time | Only leads received at or after this time. A date without a time starts at the beginning of that day. |
received_to |
date or date-time | Only leads received at or before this time. A date without a time includes the whole of that day. |
per_page |
integer | Page size from 1 to 100. Defaults to 50. |
cursor |
string | The next_cursor from the previous page. |
Dates are read as UTC unless you include an offset. For example, received_to=2026-12-04 includes everything up to 2026-12-04T23:59:59 UTC.
Pagination
Section titled “Pagination”Pagination is cursor-based, not page-numbered.
- Make a request without
cursor. - If
has_moreistrue, passnext_cursorascursorin the next request. - Repeat until
has_moreisfalse.next_cursoris thennull.
The cursor records your position only. It does not remember your filters, so send the same filters and per_page with every page. Treat the cursor as opaque. A cursor that Pingdex did not issue is refused with 422.
New leads that arrive while you page appear at the start of the ordering, so they do not cause skipped or repeated items in pages you have not yet fetched.
Response
Section titled “Response”200 OK
| Field | Type | Description |
|---|---|---|
data |
array | Lead summaries for this page. |
next_cursor |
string or null | Pass as cursor for the next page. null on the last page. |
per_page |
integer | The page size used. |
has_more |
boolean | Whether another page exists. |
{ "data": [ { "id": "a91d3f6e-2b7c-4c85-8e10-d4f5a6b7c8d9", "external_id": "web-2026-000123", "status": "delivered", "commercial_status": "accepted", "sale_amount": "18.50", "received_at": "2026-12-04T09:15:02+00:00", "selected_provider": "Northwind Mortgages", "selected_provider_id": "7d2f4a10-6b3e-4c91-8a5d-0e1f2a3b4c5d", "reporting_currency": "GBP", "latest_attempt": { "provider_name": "Northwind Mortgages", "leg_name": "post", "leg_role": "commit", "status": "delivered", "duration_ms": 412 }, "campaign_id": "3e1a7c52-9b04-4d68-a2f1-6c8d0e5b7a93", "campaign_name": "Remortgage leads" } ], "next_cursor": "eyJyZWNlaXZlZF9hdCI6IjIwMjYtMTItMDQgMDk6MTU6MDIiLCJpZCI6ImE5MWQzZjZlLTJiN2MtNGM4NS04ZTEwLWQ0ZjVhNmI3YzhkOSIsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0-", "per_page": 1, "has_more": true}| Status | Meaning |
|---|---|
200 |
A page of leads. data is an empty array when nothing matches. |
401 |
Missing, invalid or expired token. |
403 |
The token does not have leads:read. |
422 |
A parameter is invalid, for example an unknown status, per_page outside 1 to 100, an unparseable date or a bad cursor. |
Examples
Section titled “Examples”First page, delivered leads for one campaign:
curl --get https://api.pingdex.io/api/v1/leads \ --header "Authorization: Bearer $PINGDEX_API_KEY" \ --header "Accept: application/json" \ --data-urlencode "campaign_id=3e1a7c52-9b04-4d68-a2f1-6c8d0e5b7a93" \ --data-urlencode "status=delivered" \ --data-urlencode "per_page=25"Next page, with the same filters and the cursor from the previous response:
curl --get https://api.pingdex.io/api/v1/leads \ --header "Authorization: Bearer $PINGDEX_API_KEY" \ --header "Accept: application/json" \ --data-urlencode "campaign_id=3e1a7c52-9b04-4d68-a2f1-6c8d0e5b7a93" \ --data-urlencode "status=delivered" \ --data-urlencode "per_page=25" \ --data-urlencode "cursor=$NEXT_CURSOR"Find a lead by your own reference:
curl --get https://api.pingdex.io/api/v1/leads \ --header "Authorization: Bearer $PINGDEX_API_KEY" \ --header "Accept: application/json" \ --data-urlencode "external_id=web-2026-000123"Leads received during one day:
curl --get https://api.pingdex.io/api/v1/leads \ --header "Authorization: Bearer $PINGDEX_API_KEY" \ --header "Accept: application/json" \ --data-urlencode "received_from=2026-12-04" \ --data-urlencode "received_to=2026-12-04"Show a lead
Section titled “Show a lead”GET /leads/{lead}Returns one lead summary.
Scope: leads:read
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
lead |
string (UUID) | The lead identifier returned by POST /leads. |
Responses
Section titled “Responses”| Status | Meaning |
|---|---|
200 |
The lead summary, as a flat object. It is not wrapped in data. |
401 |
Missing, invalid or expired token. |
403 |
The token does not have leads:read. |
404 |
No lead with this identifier in your account. |
{ "id": "a91d3f6e-2b7c-4c85-8e10-d4f5a6b7c8d9", "external_id": "web-2026-000123", "status": "delivered", "commercial_status": "accepted", "sale_amount": "18.50", "received_at": "2026-12-04T09:15:02+00:00", "selected_provider": "Northwind Mortgages", "selected_provider_id": "7d2f4a10-6b3e-4c91-8a5d-0e1f2a3b4c5d", "reporting_currency": "GBP", "latest_attempt": { "provider_name": "Northwind Mortgages", "leg_name": "post", "leg_role": "commit", "status": "delivered", "duration_ms": 412 }, "campaign_id": "3e1a7c52-9b04-4d68-a2f1-6c8d0e5b7a93", "campaign_name": "Remortgage leads"}Example
Section titled “Example”curl https://api.pingdex.io/api/v1/leads/a91d3f6e-2b7c-4c85-8e10-d4f5a6b7c8d9 \ --header "Authorization: Bearer $PINGDEX_API_KEY" \ --header "Accept: application/json"List lead attempts
Section titled “List lead attempts”GET /leads/{lead}/attemptsReturns every delivery attempt for one lead, oldest first (by attempted_at, then id). For a highest-bid campaign there is one quote attempt per provider that was pinged, plus one commit attempt. For a priority campaign there is one commit attempt per provider tried.
Scope: leads:read
Path parameters
Section titled “Path parameters”| Parameter | Type | Description |
|---|---|---|
lead |
string (UUID) | The lead identifier. |
Response
Section titled “Response”200 OK with a JSON array of attempt objects. The array is not wrapped in an envelope and is not paginated. It is empty ([]) if Pingdex has not attempted delivery yet.
| Status | Meaning |
|---|---|
200 |
An array of attempts. |
401 |
Missing, invalid or expired token. |
403 |
The token does not have leads:read. |
404 |
No lead with this identifier in your account. |
[ { "id": "c4b1e8a2-5d37-4f09-b6a1-9e2d3c4b5a60", "provider_id": "7d2f4a10-6b3e-4c91-8a5d-0e1f2a3b4c5d", "provider_name": "Northwind Mortgages", "leg_name": "ping", "leg_role": "quote", "status": "bid", "commercial_status": null, "bid_amount": "18.50", "sale_amount": null, "response_status": 200, "error_code": null, "selected": true, "attempted_at": "2026-12-04T09:15:03+00:00", "completed_at": "2026-12-04T09:15:03+00:00", "duration_ms": 238 }, { "id": "e0f3a9b7-1c28-4d46-8b5e-7a6d5c4b3a21", "provider_id": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d", "provider_name": "Fabrikam Home Loans", "leg_name": "ping", "leg_role": "quote", "status": "rejected", "commercial_status": null, "bid_amount": null, "sale_amount": null, "response_status": 200, "error_code": "quote_rejected", "selected": false, "attempted_at": "2026-12-04T09:15:03+00:00", "completed_at": "2026-12-04T09:15:03+00:00", "duration_ms": 301 }, { "id": "f1a4b0c8-2d39-4e57-9c6f-8b7e6d5c4b32", "provider_id": "7d2f4a10-6b3e-4c91-8a5d-0e1f2a3b4c5d", "provider_name": "Northwind Mortgages", "leg_name": "post", "leg_role": "commit", "status": "delivered", "commercial_status": "accepted", "bid_amount": null, "sale_amount": "18.50", "response_status": 200, "error_code": null, "selected": false, "attempted_at": "2026-12-04T09:15:04+00:00", "completed_at": "2026-12-04T09:15:04+00:00", "duration_ms": 412 }]Example
Section titled “Example”curl https://api.pingdex.io/api/v1/leads/a91d3f6e-2b7c-4c85-8e10-d4f5a6b7c8d9/attempts \ --header "Authorization: Bearer $PINGDEX_API_KEY" \ --header "Accept: application/json"Lead summary object
Section titled “Lead summary object”Returned by GET /leads (inside data) and GET /leads/{lead}.
| Field | Type | Description |
|---|---|---|
id |
string (UUID) | Lead identifier. |
external_id |
string or null | The reference you sent on submission. |
status |
string | The lead status. |
commercial_status |
string or null | The commercial status, when a buyer outcome is known. |
sale_amount |
string or null | The sale amount reported by the buyer, as a decimal string. |
received_at |
string (date-time) | When Pingdex accepted the lead. |
selected_provider |
string or null | Name of the provider that won or received the lead. |
selected_provider_id |
string (UUID) or null | Identifier of that provider. |
reporting_currency |
string | Three-letter currency code of your account’s reporting currency: USD, GBP, EUR, CAD or AUD. |
latest_attempt |
object or null | A short summary of the most recent attempt. null before any attempt. |
campaign_id |
string (UUID) or null | The campaign the lead belongs to. |
campaign_name |
string or null | That campaign’s name. |
The selected provider is the winning quote provider when the campaign uses highest bid. Otherwise it is the provider that received the latest commit attempt.
latest_attempt fields:
| Field | Type | Description |
|---|---|---|
provider_name |
string | The provider’s name. |
leg_name |
string | The leg that was called. |
leg_role |
string | quote or commit. |
status |
string | An attempt status. |
duration_ms |
integer or null | Time taken, in milliseconds. |
Attempt object
Section titled “Attempt object”Returned as items of the array from GET /leads/{lead}/attempts.
| Field | Type | Description |
|---|---|---|
id |
string (UUID) | Attempt identifier. |
provider_id |
string (UUID) | The provider that was called. |
provider_name |
string | The provider’s name. |
leg_name |
string | The integration leg that was called, for example ping or post. |
leg_role |
string | quote or commit. |
status |
string | An attempt status. |
commercial_status |
string or null | The commercial status read from a commit response. null when not applicable. |
bid_amount |
string or null | The bid returned by a quote leg, as a decimal string. |
sale_amount |
string or null | The sale amount read from a commit response. |
response_status |
integer or null | The HTTP status the buyer returned. null when there was no response. |
error_code |
string or null | An error code when the attempt did not complete normally. |
selected |
boolean | true for the winning quote attempt. A direct post never sets it. |
attempted_at |
string (date-time) | When the attempt began. |
completed_at |
string (date-time) or null | When it finished. |
duration_ms |
integer or null | Time taken, in milliseconds. |
Buyer transaction identifiers and rejection reasons are stored but never returned.
Enumerations
Section titled “Enumerations”Lead statuses
Section titled “Lead statuses”| Value | Meaning |
|---|---|
received |
Accepted and stored. This is the status of every new lead. |
processing |
Delivery is under way. |
delivered |
A buyer received the lead. |
failed |
Pingdex received an unsuccessful HTTP response, or no eligible provider was available. This does not prove the buyer skipped the lead, and it does not mean another post is safe. |
indeterminate |
Pingdex received no HTTP response (a timeout or connection failure), so delivery cannot be known. Another post is not known to be safe. |
delivered, failed and indeterminate are final outcomes. See Lead lifecycle.
Commercial statuses
Section titled “Commercial statuses”| Value | Meaning |
|---|---|
accepted |
The buyer explicitly accepted the lead in the post response. |
rejected |
The buyer explicitly rejected the lead in the post response. |
unknown |
Acceptance could not be established from the response. |
Commercial status depends on the provider’s commit response mapping. A provider without one reports delivery only. See Response mapping.
Attempt statuses
Section titled “Attempt statuses”| Value | Meaning |
|---|---|
bid |
The provider accepted a ping and returned a usable bid. This is not a delivery outcome. |
rejected |
A ping finished and the provider is not a bid candidate. |
delivered |
The post succeeded. |
failed |
Pingdex received an unsuccessful HTTP response. |
indeterminate |
Pingdex received no HTTP response. Delivery cannot be known. |
not_sent |
Pingdex made no HTTP request, because the integration was missing or invalid or a required mapped field could not be resolved. |
Leg roles
Section titled “Leg roles”| Value | Meaning |
|---|---|
quote |
The ping leg, which asks a buyer for a bid. |
commit |
The post leg, which delivers the lead. |
Attempt error codes
Section titled “Attempt error codes”error_code is null when an attempt completes without a problem. Otherwise it is one of:
| Code | Meaning |
|---|---|
http_unsuccessful |
The buyer returned a non-success HTTP status. |
connection_failed |
No HTTP response arrived, because of a timeout or a connection failure. |
no_eligible_provider |
No provider was eligible for the lead. |
invalid_quote_response |
The quote response could not be used: it was not a JSON object, the acceptance value was not recognised, or the bid was missing or not a valid amount. |
quote_rejected |
The buyer declined the quote. |
no_valid_bid |
No provider returned a usable bid. |
invalid_integration |
The integration was missing or invalid, or Pingdex refused the destination. |
missing_mapped_field |
A mapped field, such as a payload value or a secret, could not be resolved. |
missing_response_value |
A value extracted from an earlier response was missing. |
commitment_interrupted |
Processing was interrupted around the post request, so the outcome is unknown. |
response_too_large |
The buyer response exceeded the size cap. See Limits. |
invalid_commit_response |
The post response could not be read with the commit response mapping. |
preparation_exhausted |
Pingdex gave up after repeated failures preparing the lead for delivery. |
dispatch_recovery_exhausted |
Pingdex gave up recovering an interrupted delivery. |
For diagnosis steps, see Troubleshooting leads.
Tracking an outcome
Section titled “Tracking an outcome”After a 202, either poll GET /leads/{lead} until status is delivered, failed or indeterminate, or receive a webhook when the lead reaches a final outcome.