Skip to content

API errors

The API reports errors with an HTTP status code and a JSON body. Check the status code first. The body always has a message string. Validation failures add an errors object.

There is no machine-readable error code in these bodies. Do not parse message text to drive logic, except for the documented shapes below.

Status Meaning Body
401 Missing, invalid, revoked or expired token. Message
403 The token lacks the scope the endpoint needs. Message
404 The resource does not exist in your account, or the route does not exist. Message
405 The path exists but not for that method. Message
409 An idempotency key was reused with a different request. Message
422 The request failed validation or compilation. ValidationError
5xx A fault on the Pingdex side. Message

Every error except 422 has this shape:

{
"message": "Human-readable description."
}
{
"message": "Unauthenticated."
}

Returned when the Authorization header is missing, the token is malformed, or the key has been revoked or has expired. See Authentication.

{
"message": "Invalid scope(s) provided."
}

Returned when the token is valid but does not carry the scope the endpoint needs. The body does not name the missing scope. The scope for each endpoint is in the API overview.

A resource lookup that finds nothing returns 404:

{
"message": "No query results for model [App\\Leads\\Models\\Lead] 0193a1e7-7c3a-7000-8000-000000000001"
}

The bracketed model name varies with the resource (a lead, a campaign or a provider) and the text ends with the identifier you sent. Treat the message as informational.

A 404 is returned in all of these cases, and the response does not distinguish between them:

  • The identifier does not exist.
  • The resource belongs to another account.
  • The identifier is not a valid UUID.

Not finding a resource in your own account and not being allowed to see it are deliberately indistinguishable.

An unknown path also returns 404, with a different message:

{
"message": "The route api/v1/nope could not be found."
}
{
"message": "The DELETE method is not supported for route api/v1/campaigns/3e1a7c52-9b04-4d68-a2f1-6c8d0e5b7a93. Supported methods: GET, HEAD, PUT, PATCH."
}

The API has no delete endpoints, so DELETE on a campaign or provider returns 405.

409 is returned by POST /leads when an Idempotency-Key has already been used for your account with a different request.

{
"message": "Idempotency key was reused with a different request."
}

The fingerprint covers campaign_id, external_id and payload. Change any of them and the same key conflicts. No second lead is stored.

In a rare case where a key points to a lead that no longer exists, the message is Idempotency key refers to a missing resource. and the status is also 409. Use a new key.

No other endpoint returns 409.

A 422 response means the request reached Pingdex and was understood, but a value was refused. Nothing was saved.

{
"message": "The payload.email field is required.",
"errors": {
"payload.email": [
"The payload.email field is required."
]
}
}
Field Type Description
message string The first error message. When several fields fail, it ends with (and N more errors), or (and 1 more error).
errors object Maps each failing field to an array of messages.

The keys name the failing input:

  • Top-level body fields use their JSON name, for example name or routing_strategy.
  • Nested fields use dot notation with a zero-based index for arrays, for example schema.0.name, provider_ids.0 or payload.email.
  • A failing request header uses the header name, for example Idempotency-Key.
  • Query string parameters use their parameter name, for example cursor or per_page.
  • Provider integration, header and secret problems use the keys integration, headers, secrets, clear_header_legs and clear_secret_names.

A field can have more than one message, so always read errors.<field> as an array.

{
"message": "The selected routing strategy is invalid. (and 4 more errors)",
"errors": {
"routing_strategy": ["The selected routing strategy is invalid."],
"schema.0.name": ["The schema.0.name field format is invalid."],
"schema.0.type": ["The selected schema.0.type is invalid."],
"schema.0.required": ["The schema.0.required field is required."],
"provider_ids.0": ["The provider_ids.0 field must be a valid UUID."]
}
}

When a provider’s integration, headers or secrets fail Pingdex’s compile checks, the error is a single message in the form path: reason. The message and the entry in errors carry the same text. The key depends on where the problem is.

{
"message": "legs.0.request.fields: empty",
"errors": {
"integration": [
"legs.0.request.fields: empty"
]
}
}
{
"message": "configuration.headers.post.Content-Type: header not allowed",
"errors": {
"headers": [
"configuration.headers.post.Content-Type: header not allowed"
]
}
}

Compile errors stop at the first problem. Fix it and resubmit to see the next one. The paths and reasons are listed in the integration object reference and the provider write errors.

Endpoint Key Message Cause
POST /leads campaign_id The campaign id field is required. campaign_id is missing.
POST /leads campaign_id The selected campaign is invalid. The campaign does not exist in your account.
POST /leads campaign_id The selected campaign is disabled. The campaign exists but enabled is false.
POST /leads payload The payload field is required. payload is missing or empty.
POST /leads payload The payload field must be a JSON object. payload is a non-empty JSON array.
POST /leads payload.<field> The payload.email field is required. The payload breaks the campaign’s lead schema.
POST /leads any extra key The metadata field is not allowed. The body has a top-level key other than campaign_id, payload and external_id.
POST /leads Idempotency-Key The Idempotency-Key header must be a non-empty string when present. The header is empty or whitespace only.
POST /leads Idempotency-Key The Idempotency-Key header must not be greater than 255 characters. The header is too long.
GET /leads cursor The cursor is invalid. The cursor was not issued by this endpoint or has been altered.
GET /leads per_page The per page field must be at least 1. per_page is below 1. Values above 100 are also refused.
GET /leads status The selected status is invalid. Not one of the lead statuses.
GET /leads received_from The received from field must be a valid date. Unparseable date.
Campaign writes provider_ids Select providers from this account. An identifier is not a provider in your account.
Campaign writes provider_ids Each provider must match the campaign routing strategy. A quote provider on a priority campaign, or a commit-only provider on a highest_bid campaign.
Campaign writes provider_ids A provider can only be assigned once. Duplicate identifiers.
Campaign writes schema.N.name The field name is already used. Two schema fields share a name.
Provider writes integration Persisted leg names cannot be renamed. Remove a leg and add a new one instead. See Providers.
Provider writes integration This integration is not compatible with an assigned campaign routing strategy. The change would break a campaign that uses the provider.
Provider writes headers each leg must have a non-empty header object A leg entry in headers is empty or not an object.
Provider writes clear_header_legs cannot clear and replace the same leg headers A leg appears in both headers and clear_header_legs.
Provider writes clear_secret_names cannot clear and replace the same secret A name appears in both secrets and clear_secret_names.

An unexpected fault returns a 5xx status and a generic message:

{
"message": "Server Error"
}

Retrying a 5xx response on POST /leads is safe only if you sent an Idempotency-Key. Without one, a retry can create a second lead. See Idempotency.

A 202 from POST /leads means Pingdex accepted the lead, not that a buyer received it. Delivery problems are recorded afterwards on the lead and its attempts, using status and error_code fields. See Leads.