Errors
Every error has the same shape, a stable code and a request ID for support.
The error envelope
Errors use standard HTTP status codes and a JSON body with a machine-readable code, a human-readable message and the requestId (also in the X-Request-Id header). Branch on code, never on the message text, which may change.
{ "error": { "code": "STALE_LEAD", "message": "The lead changed since it was loaded.", "requestId": "7d0c2f4e-3b1a-4f5e-9c8d-2a1b0c9d8e7f" }}What to do about this one is under STALE_LEAD in Error codes; every code there has its own link, so you can jump to it from a log line.
Validation errors
A request that fails validation returns 400 VALIDATION_ERROR. The message says which part of the request failed (body, query, path parameters or headers), for people reading logs; it does not name the field, and there is no machine-readable field list. To find the field, compare the request with the operation's fields and constraints in the reference, or validate requests before you send them against the OpenAPI document.
Some other errors add a details object with extra context, for example currentRevision on STALE_REVISION, the conflicting record IDs on a rule conflict, or sourceField and targetField on a mapping error. Its keys depend on the error: log it, and only rely on keys this guide or the operation names.
{ "error": { "code": "VALIDATION_ERROR", "message": "The JSON request body is invalid.", "requestId": "3b9e1c4d-7a2f-4e8b-9c1d-5f6a7b8c9d0e" }}Status codes
Client errors (4xx): change the request, never retry it unchanged
| Status | Meaning | What to do | Opens |
|---|---|---|---|
400 Bad Request | The request is invalid: a field, parameter or header failed validation. | Fix the request; retrying it unchanged fails again. | |
401 Unauthorized | The API key is missing, malformed, revoked or expired. | Check the Authorization header and the key's status; rotate it if it may have leaked. | |
403 Forbidden | The key lacks the scope, or its acting member lacks the permission or data access. | Add the scope to the key, or adjust the acting member's role or teams. | |
404 Not Found | The resource does not exist or is not visible to this key. | Check the ID, and the sources or campaigns the key may use. | |
409 Conflict | Conflict with the current state: a stale expectedUpdatedAt or expectedRevision, a workflow rule, or a reused Idempotency-Key. | Act on the code: see Error codes. Never retry a 409 unchanged. | |
410 Gone | The change-feed cursor is older than the 30-day retention. | Take a fresh cursor and reconcile: Retention and recovery. | |
415 Unsupported Media Type | A QUERY request was sent without a JSON body. | Send Content-Type: application/json with the body. | |
422 Unprocessable Content | A QUERY body is valid JSON but does not match the operation's schema. | Compare the body with the operation's request fields. |
- 400 Bad RequestThe request is invalid: a field, parameter or header failed validation.Fix the request; retrying it unchanged fails again.
- 401 UnauthorizedThe API key is missing, malformed, revoked or expired.Check the
Authorizationheader and the key's status; rotate it if it may have leaked. - 403 ForbiddenThe key lacks the scope, or its acting member lacks the permission or data access.Add the scope to the key, or adjust the acting member's role or teams.
- 404 Not FoundThe resource does not exist or is not visible to this key.Check the ID, and the sources or campaigns the key may use.
- 409 ConflictConflict with the current state: a stale
expectedUpdatedAtorexpectedRevision, a workflow rule, or a reusedIdempotency-Key.Act on thecode: see Error codes. Never retry a 409 unchanged. - 410 GoneThe change-feed cursor is older than the 30-day retention.Take a fresh cursor and reconcile: Retention and recovery.
- 415 Unsupported Media TypeA
QUERYrequest was sent without a JSON body.SendContent-Type: application/jsonwith the body. - 422 Unprocessable ContentA
QUERYbody is valid JSON but does not match the operation's schema.Compare the body with the operation's request fields.
Rate limit and server errors: retry with backoff
| Status | Meaning | What to do | Opens |
|---|---|---|---|
429 Too Many Requests | The key's per-minute request budget is spent. | Wait Retry-After seconds, then continue. | |
500 Internal Server Error | An unexpected error on our side. | Retry reads with backoff; retry writes only as described under When to retry. Quote requestId to support. | |
502 Bad Gateway | A downstream service, such as telephony, returned an error. | Retry reads with backoff; retry writes only as described under When to retry. | |
503 Service Unavailable | A downstream service is temporarily unavailable. | Retry reads with backoff; retry writes only as described under When to retry. |
- 429 Too Many RequestsThe key's per-minute request budget is spent.Wait
Retry-Afterseconds, then continue. - 500 Internal Server ErrorAn unexpected error on our side.Retry reads with backoff; retry writes only as described under When to retry. Quote
requestIdto support. - 502 Bad GatewayA downstream service, such as telephony, returned an error.Retry reads with backoff; retry writes only as described under When to retry.
- 503 Service UnavailableA downstream service is temporarily unavailable.Retry reads with backoff; retry writes only as described under When to retry.
Error codes
Every error.code the API documents, 52 in all, by status. Each operation in the reference lists the ones it can return.
| Code | Status | Meaning and what to do | Returned by | Opens |
|---|---|---|---|---|
IDEMPOTENCY_KEY_REQUIRED | 400 Bad Request | This operation needs an Idempotency-Key header.Generate a key, save it with the job and send it. | Lead submission, Leads | |
VALIDATION_ERROR | 400 Bad Request | The body or parameters failed validation.Compare the request with the operation's fields; message names the part (body, query, path or headers), not the field. | Change feed, Lead submission, Leads, Lead intake and 8 more | |
INVALID_PARTNER_CREDENTIAL | 401 Unauthorized | The bearer token is not a valid, active API key.Check the token; create or rotate a key. | Every operation | |
PARTNER_OPERATION_FORBIDDEN | 403 Forbidden | The operation is outside the key's scopes.Add the scope shown on the operation to the key. | Leads, Lead intake, Ownership, Calling and 6 more | |
PARTNER_SCOPE_FORBIDDEN | 403 Forbidden | A partner endpoint needs a scope the key lacks (for example events.read).Add the scope to the key. | Change feed, Lead submission, Recordings | |
PERMISSION_DENIED | 403 Forbidden | The key's acting member lacks the permission or data access. | Leads, Lead intake, Ownership, Calling and 6 more | |
ACTIVITY_NOT_FOUND | 404 Not Found | The activity does not exist or the key cannot see it. | Leads | |
BATCH_NOT_FOUND | 404 Not Found | The batch does not exist or the key cannot see it. | Lead intake, Voicebot | |
CALL_ATTEMPT_NOT_FOUND | 404 Not Found | The call attempt does not exist or the key cannot see it. | Voicebot | |
CALL_NOT_FOUND | 404 Not Found | The call does not exist or the key cannot see it. | Calling, Reports | |
CAMPAIGN_NOT_FOUND | 404 Not Found | The campaign does not exist or the key cannot see it. | Calling, Reports, Campaigns, Quality and 1 more | |
CDR_EXPORT_NOT_FOUND | 404 Not Found | The export does not exist or the key cannot see it. | Reports | |
CONTACT_NOT_FOUND | 404 Not Found | The contact does not exist or the key cannot see it. | Leads, Calling | |
LEAD_NOT_FOUND | 404 Not Found | The lead does not exist or the key cannot see it. | Leads, Calling | |
MAPPING_NOT_FOUND | 404 Not Found | The field mapping does not exist or the key cannot see it. | Lead intake | |
MEDIA_OBJECT_NOT_FOUND | 404 Not Found | The media file does not exist or the key cannot see it. | Administration | |
MEMBER_NOT_FOUND | 404 Not Found | The member does not exist or the key cannot see it. | Team | |
PROCESS_NOT_FOUND | 404 Not Found | The process does not exist or the key cannot see it. | Campaigns | |
RECEIPT_NOT_FOUND | 404 Not Found | The receipt does not exist or the key cannot see it. | Lead submission | |
RECORDING_NOT_FOUND | 404 Not Found | The call or recording does not exist or the key cannot see it. | Recordings, Quality | |
SEGMENT_NOT_FOUND | 404 Not Found | The segment does not exist or the key cannot see it. | Ownership | |
SOURCE_CONNECTION_NOT_FOUND | 404 Not Found | The source connection does not exist or the key cannot see it. | Lead intake | |
SOURCE_NOT_FOUND | 404 Not Found | The source does not exist or is not granted to the key.Check SOURCE_ID, and add the source to the key. | Lead submission | |
SOURCE_RECORD_NOT_FOUND | 404 Not Found | The source record does not exist or the key cannot see it. | Lead intake | |
STAGE_NOT_FOUND | 404 Not Found | The stage does not exist or the key cannot see it. | Ownership | |
TEAM_NOT_FOUND | 404 Not Found | The team does not exist or the key cannot see it. | Team | |
TEMPLATE_NOT_FOUND | 404 Not Found | The report template does not exist or the key cannot see it. | Reports | |
CALL_BATCH_ELIGIBILITY_STALE | 409 Conflict | Lead eligibility changed since the preview; preview again. | Voicebot | |
CALL_SETTINGS_STALE | 409 Conflict | The settings changed after you read them; read them again and resend. | Calling | |
CAMPAIGN_NAME_CONFLICT | 409 Conflict | Another campaign already has this name. | Campaigns | |
CDR_TEMPLATE_CONFLICT | 409 Conflict | The template changed after you read it, or its name is taken. | Reports | |
CUSTOMER_FORM_STALE | 409 Conflict | The form changed after you read it; read it again and resend. | Campaigns | |
IDEMPOTENCY_CONFLICT | 409 Conflict | The key was already used with a different body.Use a new key for a new request; reuse a key only for the identical request. | Lead submission, Leads | |
INITIAL_STAGE_CONFLICT | 409 Conflict | The process already has an initial stage; clear it or send replaceInitial. | Ownership | |
OUTCOME_CONFLICT | 409 Conflict | A different outcome was already saved for this call. | Calling | |
PROCESS_ARCHIVED | 409 Conflict | Archived processes cannot be changed. | Campaigns | |
PROCESS_LIMIT_REACHED | 409 Conflict | The workspace has reached its plan's process limit. | Campaigns | |
PROCESS_NAME_CONFLICT | 409 Conflict | Another process already has this name. | Campaigns | |
SEGMENT_NAME_CONFLICT | 409 Conflict | Another segment already has this name. | Ownership | |
SOURCE_CONNECTION_NAME_CONFLICT | 409 Conflict | Another source connection already has this name. | Lead intake | |
SOURCE_INACTIVE | 409 Conflict | The source is paused; submissions are refused until it is resumed.Resume the source in LMS, then resend with the same key. | Lead submission | |
STAGE_NAME_CONFLICT | 409 Conflict | Another stage already has this name. | Ownership | |
STALE_LEAD | 409 Conflict | The lead changed after you read it (expectedUpdatedAt no longer matches).Re-read the lead, reapply your change, and send its latest updatedAt as expectedUpdatedAt. | Leads | |
STALE_REVISION | 409 Conflict | The record changed after you read it (expectedRevision no longer matches).Read it again; details.currentRevision has the current revision. | Leads, Lead intake, Ownership, Calling | |
TEAM_NAME_CONFLICT | 409 Conflict | Another team already has this name. | Team | |
VOICEBOT_CONFIGURATION_STALE | 409 Conflict | The draft changed after you read it; read it again and resend. | Voicebot | |
CURSOR_EXPIRED | 410 Gone | The change-feed cursor is past the 30-day retention.Take a fresh cursor and reconcile: Retention and recovery. | Change feed, Reports | |
REQUEST_BODY_TOO_LARGE | 413 Content Too Large | The upload is too large. | Lead intake | |
QUERY_CONTENT_TYPE_UNSUPPORTED | 415 Unsupported Media Type | The QUERY request has no Content-Type: application/json body. | Leads, Ownership, Team | |
QUERY_VALIDATION_FAILED | 422 Unprocessable Content | The QUERY body is JSON but does not match the request fields. | Leads, Ownership, Team | |
RATE_LIMITED | 429 Too Many Requests | Too many requests this minute.Wait Retry-After seconds. | Every operation | |
UNEXPECTED_ERROR | 500 Internal Server Error | Something went wrong on our side.Retry as described below; quote requestId to support. | Every operation |
IDEMPOTENCY_KEY_REQUIREDThis operation needs anIdempotency-Keyheader.Generate a key, save it with the job and send it.VALIDATION_ERRORThe body or parameters failed validation.Compare the request with the operation's fields;messagenames the part (body, query, path or headers), not the field.INVALID_PARTNER_CREDENTIALThe bearer token is not a valid, active API key.Check the token; create or rotate a key.PARTNER_OPERATION_FORBIDDENThe operation is outside the key's scopes.Add the scope shown on the operation to the key.PARTNER_SCOPE_FORBIDDENA partner endpoint needs a scope the key lacks (for exampleevents.read).Add the scope to the key.PERMISSION_DENIEDThe key's acting member lacks the permission or data access.ACTIVITY_NOT_FOUNDThe activity does not exist or the key cannot see it.BATCH_NOT_FOUNDThe batch does not exist or the key cannot see it.CALL_ATTEMPT_NOT_FOUNDThe call attempt does not exist or the key cannot see it.CALL_NOT_FOUNDThe call does not exist or the key cannot see it.CAMPAIGN_NOT_FOUNDThe campaign does not exist or the key cannot see it.CDR_EXPORT_NOT_FOUNDThe export does not exist or the key cannot see it.CONTACT_NOT_FOUNDThe contact does not exist or the key cannot see it.LEAD_NOT_FOUNDThe lead does not exist or the key cannot see it.MAPPING_NOT_FOUNDThe field mapping does not exist or the key cannot see it.MEDIA_OBJECT_NOT_FOUNDThe media file does not exist or the key cannot see it.MEMBER_NOT_FOUNDThe member does not exist or the key cannot see it.PROCESS_NOT_FOUNDThe process does not exist or the key cannot see it.RECEIPT_NOT_FOUNDThe receipt does not exist or the key cannot see it.RECORDING_NOT_FOUNDThe call or recording does not exist or the key cannot see it.SEGMENT_NOT_FOUNDThe segment does not exist or the key cannot see it.SOURCE_CONNECTION_NOT_FOUNDThe source connection does not exist or the key cannot see it.SOURCE_NOT_FOUNDThe source does not exist or is not granted to the key.CheckSOURCE_ID, and add the source to the key.SOURCE_RECORD_NOT_FOUNDThe source record does not exist or the key cannot see it.STAGE_NOT_FOUNDThe stage does not exist or the key cannot see it.TEAM_NOT_FOUNDThe team does not exist or the key cannot see it.TEMPLATE_NOT_FOUNDThe report template does not exist or the key cannot see it.CALL_BATCH_ELIGIBILITY_STALELead eligibility changed since the preview; preview again.CALL_SETTINGS_STALEThe settings changed after you read them; read them again and resend.CAMPAIGN_NAME_CONFLICTAnother campaign already has this name.CDR_TEMPLATE_CONFLICTThe template changed after you read it, or its name is taken.CUSTOMER_FORM_STALEThe form changed after you read it; read it again and resend.IDEMPOTENCY_CONFLICTThe key was already used with a different body.Use a new key for a new request; reuse a key only for the identical request.INITIAL_STAGE_CONFLICTThe process already has an initial stage; clear it or sendreplaceInitial.OUTCOME_CONFLICTA different outcome was already saved for this call.PROCESS_ARCHIVEDArchived processes cannot be changed.PROCESS_LIMIT_REACHEDThe workspace has reached its plan's process limit.PROCESS_NAME_CONFLICTAnother process already has this name.SEGMENT_NAME_CONFLICTAnother segment already has this name.SOURCE_CONNECTION_NAME_CONFLICTAnother source connection already has this name.SOURCE_INACTIVEThe source is paused; submissions are refused until it is resumed.Resume the source in LMS, then resend with the same key.STAGE_NAME_CONFLICTAnother stage already has this name.STALE_LEADThe lead changed after you read it (expectedUpdatedAtno longer matches).Re-read the lead, reapply your change, and send its latestupdatedAtasexpectedUpdatedAt.STALE_REVISIONThe record changed after you read it (expectedRevisionno longer matches).Read it again;details.currentRevisionhas the current revision.TEAM_NAME_CONFLICTAnother team already has this name.VOICEBOT_CONFIGURATION_STALEThe draft changed after you read it; read it again and resend.CURSOR_EXPIREDThe change-feed cursor is past the 30-day retention.Take a fresh cursor and reconcile: Retention and recovery.REQUEST_BODY_TOO_LARGEThe upload is too large.QUERY_CONTENT_TYPE_UNSUPPORTEDTheQUERYrequest has noContent-Type: application/jsonbody.QUERY_VALIDATION_FAILEDTheQUERYbody is JSON but does not match the request fields.RATE_LIMITEDToo many requests this minute.WaitRetry-Afterseconds.UNEXPECTED_ERRORSomething went wrong on our side.Retry as described below; quoterequestIdto support.
When to retry
- Reads (
GETandQUERY) are always safe to retry after a timeout,429or5xx, with exponential backoff and jitter. - Creates that take an
Idempotency-Key(Create a lead, Submit a lead) are safe to retry with the same saved key. See Retrying safely. - Updates that send
expectedUpdatedAtorexpectedRevisionare safe to retry: if the first attempt did apply, the retry fails with409instead of applying twice. Read the record to check. - Other writes (for example hanging up a call): read the resource first to see whether the first attempt took effect, then decide.
Honour Retry-After on 429; see Rate limits.