Skip to main content
Every error response carries a human-readable error and a stable machine code:
Branch on code, never on the error text — the wording may change, the code will not. The account-wide codes (MISSING_KEY, INVALID_KEY, EXPIRED_KEY, INSUFFICIENT_SCOPE, RATE_LIMIT, BILLING_ERROR) are listed on the API Reference overview; any route here can answer 401 with MISSING_KEY (nothing was sent), INVALID_KEY (a key was sent and is not one of ours) or EXPIRED_KEY, and 403 with INSUFFICIENT_SCOPE, which names the scope the key is missing. 401 means the key itself was not accepted; 403 means the key is fine and is not allowed this one request — nothing needs rotating. The tables below are every code these endpoints raise themselves. Two of them can also hand back a code from a service behind the API — see Forwarded service codes before you branch on an unfamiliar one.

Reading the status

When you are rate limited

Every key is allowed 60 requests per minute. Past that the answer is 429 with RATE_LIMIT, and three headers say where you stand on every response — X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (a Unix timestamp). The 429 adds Retry-After: whole seconds to wait before the next attempt. Honour it rather than retrying at once — an immediate retry spends the rest of the window on refusals. Nothing you sent was acted on, so the same request, with the same Idempotency-Key where one was used, is safe to send again after the wait. Every refusal from the same key names the same window, so one wait clears all of them — retry the batch together rather than staggering it. And a burst that seems to repeat X-RateLimit-Remaining is almost always a burst over more than one key: see reading a burst.

The code is always there

The gateway has one exit and every response leaves through it, so a code cannot be forgotten. A refusal that names nothing more specific than its status carries the code that status means: Anything else answers REQUEST_FAILED. Every one of them, on every route and on the browser data plane, has the same shape — the Error schema in the OpenAPI file: error, code, and on a refusal that names what is wrong, issues[] (code, path, message each). These are the floor, not a replacement: where a table below names a code for your case, that code is what arrives, and a fallback in its place means the refusal was a different one. Treat a fallback code the way the status table above says to treat its status.

Any resource

Every list and every read refuses a query parameter it does not read — by name, beside what it does read — instead of ignoring it. An ignored filter answers with every row and reads as a filtered answer. A parameter sent twice, or sent with no value, is refused too. The refusal names each parameter in issues[]: path is the parameter’s name, and code is query_param_unknown, query_param_repeated or query_param_blank — or query_param_invalid where the value is what is wrong (limit=ten) — beside error, which says it in one sentence. These reads are not held to this, so do not rely on them to refuse one: GET /campaigns/{id}/leads, which also takes a limit or offset that is not a number; every read under /carrier-accounts; and the signed recording link GET /calls/{id}/recording, which audio players open with parameters of their own. A create or a change refuses a body field it does not read, by name, on POST /agents, PATCH /agents/{id}, POST /agents/{id}/duplicate, POST /agents/{id}/extraction/dry-run, POST /agents/{id}/test-call (TEST_CALL_INVALID), the workflow’s save, check, publish and rebind (PUT /agents/{id}/workflow, …/validate, …/publish, …/rebind), a workflow tool’s POST /tools and PATCH /tools/{id}, POST /tools/{id}/restore (which takes no body at all), POST /tools/{id}/workflow-revisions, POST /tools/{id}/test, POST /tools/attach and /detach, POST /campaigns, PATCH /campaigns/{id}, POST /campaigns/{id}/leads (field_unknown, with the field it was likely meant to be) and POST /campaigns/{id}/restore (which takes no body at all), POST /api-keys, POST /calls (but see below), POST /calls/{id}/recording/revoke, POST /calls/{id}/end (it takes no body: CALL_END_INVALID), POST /sip-endpoints, PATCH /sip-endpoints/{id} and POST /sip-endpoints/{id}/rotate-password (SIP_ENDPOINT_REQUEST_INVALID; rotate-password takes no body at all), POST /phone-numbers/{id}/release and POST /phone-numbers/{id}/keep (which take no body at all: PHONE_NUMBER_REQUEST_INVALID), PATCH /tool-connections/{id} (CONNECTION_INVALID, with the field in issues), an agent’s integrations — POST /agents/{id}/integrations and PATCH /agents/{id}/integrations/{id} (AGENT_INTEGRATION_REQUEST_INVALID) — and POST /tool-connections/{id}/actions/prepare and POST /tool-connections/{id}/check, which takes no body at all (TOOL_CONNECTION_REQUEST_INVALID), PATCH /billing/details (BILLING_DETAILS_UNKNOWN_FIELD, naming the field), and every write on /leads, /do-not-call, /lead-tags, /dispositions, /shared-links, /call-windows and /agent-eval. Connecting, reconnecting or cleaning up accounts refuses one too, and the message says what the route takes rather than which field it refused (CONNECTION_INVALID). An ignored field is a setting the caller believes they made. Other writes may drop a field they do not read, so do not rely on them to refuse one: a phone call through POST /calls to an agent that does not run a workflow (a browser session, "type": "web", refuses one on any agent), /call-requests, the rest of /phone-numbers, /carrier-accounts, the rest of /billing, a campaign’s launch, pause, resume and stop, /agents/{id}/flow/…, POST /deliveries/{id}/retry, POST /report-issue, cancelling a tool test, removing a connected account or cancelling its sign-in, and a tool created or changed the older way, with type. Send only the fields a route’s page lists. A write’s query string is not where its settings go. Every write refuses a query parameter it does not read — by name, with a 400, before anything is read or changed — so a typo never goes through as a setting: DELETE /agents/{id}?bogus=1 is 400 AGENTS_QUERY_INVALID and the agent stays as it was (it used to be archived for good). A parameter sent twice, or sent with no value, is refused the same way. Five writes read a query parameter: DELETE /lead-tags/{id} takes force, and refuses any other with LEAD_TAG_DELETE_INVALID; POST /campaigns/{id}/launch and POST /campaigns/{id}/resume take dry_run, which checks the launch and changes nothing; DELETE /carrier-accounts/{id} takes restore_routing, which first moves every configured number back to the connection it was on in your Telnyx account; DELETE /agents/{id}/integrations/{integration_id} takes publish and expected_version. The code is the route family’s: AGENTS_QUERY_INVALID, TOOLS_QUERY_INVALID, CALLS_QUERY_INVALID (on /call-requests too), LEADS_QUERY_INVALID, CAMPAIGNS_QUERY_INVALID, DO_NOT_CALL_REQUEST_INVALID, PHONE_NUMBERS_QUERY_INVALID, SIP_ENDPOINT_QUERY_INVALID, CARRIER_ACCOUNTS_QUERY_INVALID, BILLING_QUERY_INVALID, DELIVERIES_QUERY_INVALID, API_KEY_REQUEST_INVALID, REPORT_ISSUE_QUERY_INVALID, and the codes of the shared lead-tag, disposition, shared-link and eval row below (POST /tools/attach and /detach answer TOOL_ATTACHMENT_REQUEST_INVALID). Three answer it their own way: connected accounts with CONNECTION_INVALID, the workflow’s save, check, publish and rebind (PUT /agents/{id}/workflow, …/validate, …/publish, …/rebind) with 400 WORKFLOW_REQUEST_INVALID, and starting a tool test with 422 WORKFLOW_TOOL_TEST_INVALID. Send a write’s settings in its body. The refusal names each parameter in issues[], as a list’s does. No write has a dry run but a campaign’s launch and resume: POST /tools?dry_run=true is 400 TOOLS_QUERY_INVALID and POST /agents/{id}/duplicate?dry_run=true is 400 AGENTS_QUERY_INVALID, and nothing is created — the 422 routes in the table below answer that way for a body field only. A body field a route does not read is refused with a 400 and the route family’s request code — never a …_QUERY_INVALID code, which is for the query string: LEAD_REQUEST_INVALID, DO_NOT_CALL_REQUEST_INVALID, API_KEY_REQUEST_INVALID, WEB_CALL_REQUEST_INVALID (a browser session’s mint), CAMPAIGN_REQUEST_INVALID, WORKFLOW_AGENT_REQUEST_INVALID (POST /agents), WORKFLOW_SETTINGS_REQUEST_INVALID (PATCH /agents/{id}), WORKFLOW_REQUEST_INVALID (the workflow’s save, check, publish and rebind), EXTRACTION_DRY_RUN_INVALID, TOOL_ATTACHMENT_REQUEST_INVALID, RECORDING_REVOKE_INVALID, CALL_END_INVALID, SIP_ENDPOINT_REQUEST_INVALID, PHONE_NUMBER_REQUEST_INVALID, CONNECTION_INVALID, and the …_REQUEST_INVALID codes of the families in the table below — except on these routes, which answer a body field they do not read (on the app catalogue, a query parameter) with 422: Each field at fault is in issues[], all of them in one answer: field_unknown for a field the route does not read, field_required for one it needs, field_invalid for a value it cannot take — with path the field as a pointer (/colour, /expected_version), the way query refusals carry query_param_unknown, query_param_repeated, query_param_blank or query_param_invalid with the parameter’s name. A route with a word more exact than these (a workflow’s missing_input_source, a tool’s tool_contract_invalid) uses it. As a rule a 400 is a request whose shape is wrong — not JSON, a field it does not read, one it needs and did not get — and a 422 one whose shape is right and whose values cannot be done; the table above is the exception, kept for clients already branching on it. A 400 and a 422 ask the same of you: change the request before retrying. How a list pages — what it does with a limit above its maximum, and how it answers a cursor it did not issue — is in Paging below.

Paging

A list pages by offset or by cursor. A limit that is not a whole number, or is below 1, is refused on every list below but /campaigns/{id}/leads — with the answer in the last-but-one column where that column names one, and otherwise with the list’s own 400 query code. Above the maximum, some lists clamp and some refuse: A cursor that is refused was built by hand, edited, sent to another list, or issued for another query: read the first page without one and follow the next_cursor it returns.

Agents

Agent settings

Workflow authoring

Tools

Transfer events on a call

A transfer that is requested but not carried out is not an HTTP error: the call’s events record a transfer_failed whose data.error_code is one of these. For all but REFER_FAILED and REFER_NO_RESULT the caller stays with the agent. The address is always shown without a password or ? headers.

Tool tests

Reading a test and cancelling one answer only 403, 404 and 503 — plus the account-wide 401, like every route here. The three codes above belong to starting a test.

Tool and app catalogs

The last four 422s above are the ones that are not your request’s fault, and the three WORKFLOW_METADATA_* ones reach you through the republish rule in Forwarded service codes: the app catalog raises metadata_page_invalid, metadata_identity_mismatch or metadata_versions_unavailable, and the API hands it back as that name in capitals behind WORKFLOW_. They are documented here because they are the ones you will actually meet; an unfamiliar WORKFLOW_* code from these routes arrived the same way and means what its status means.

Connected accounts

Connection errors use two families. CONNECTION_INVALID, CONNECTION_CURSOR_INVALID, CONNECTION_BODY_TOO_LARGE and CONNECTION_REPLACEMENT_REQUIRED mean the request is wrong — fix it and retry. CONNECTION_NOT_FOUND and CONNECTION_ATTEMPT_CLOSED mean the connection or the sign-in attempt is gone — start a new one. CONNECTION_STILL_CONNECTED means the record has to be disconnected before it can be taken off the list — send the DELETE first. CONNECTION_ATTEMPT_OPEN means somebody is connecting it again right now — wait for that authorization to end, or cancel it, before reconnecting or removing it. CONNECTION_RATE_LIMIT means this caller already has ten authorizations open — finish one, or cancel one with POST /tool-connections/attempts/{id}/cancel, rather than retrying — or that the workspace started more than 120 in the last ten minutes, which only a loop reaches. CONNECTION_CONFIG_UNAVAILABLE, CONNECTION_STORAGE_UNAVAILABLE and CONNECTION_UNAVAILABLE are temporary — wait and retry. AUTH_LINK_UNKNOWN and AUTH_REDEMPTION_UNKNOWN mean the sign-in did not complete; start a fresh connection rather than reusing the handoff. Errors never echo credentials.

API keys

Retired endpoints

GET /integrations and DELETE /integrations/{id} listed and revoked the native Google Calendar and Gmail credentials. Both now answer 410 with code: ENDPOINT_RETIRED (it was the lowercase endpoint_retired, the one code not in capitals), and they will stop answering at all in the release after this one. The root lists them apart, under retired (status, code and endpoints), in the same METHOD /path form as every route in its endpoints — for example GET /agents/{id}. The native Google Calendar and Gmail integrations are retired, so GET and DELETE /integrations return 410 ENDPOINT_RETIRED. Connect Google Calendar or Gmail as a connected app (Tool connections) and use their actions in a workflow. An agent that still has a native step keeps it until the end of its 30-day notice period; Yappr moves it to the connected app once you connect it. A flow you send can’t contain an integration_call node: saving one is rejected as FLOW_INVALID. So while an agent still has its native step, PATCH /agents/{id} can’t replace its flow_config; every other setting updates as usual, and the step keeps running until Yappr moves it.

Leads

An agent tags a lead during a call the same way anything else changes one: through PATCH /leads/{id} with tags (names) or tag_ids. Either list replaces every tag the lead carries, and either is applied whole — one unknown name or id refuses the request rather than writing the rest, so a typo cannot quietly take a tag off the lead. The agent’s own extraction parameters do not write tags: they are extracted into the call’s extracted_data and the call.analyzed payload, which your own service reads before deciding which tag to apply.

Do Not Call

SIP endpoints

Reading calls

Webhook deliveries

Billing

Campaigns

Phone numbers

Releasing a number keeps it until the end of the period already paid for, then releases it; keep undoes that until then.

Carrier accounts (your own Telnyx account)

A call from one of these numbers that Telnyx refuses before it rings (the dial turned down, the key refused, the app gone) is recorded as failed: if POST /calls was placing it right away, it answers 422 with the reason in error and no webhook is sent; a queued or campaign call sends call.failed with the reason in data.error_reason. One Telnyx refuses while it rings ends as failed, and the agent’s call.failed webhook carries data.hangup_cause carrier_rejected (SIP 401, 403 or 407) or carrier_number_invalid (404, 484 or 604). The SIP code is on the account, in last_error.sip_code — see Bring your own carrier. For an agent that runs a published workflow, POST /calls accepts a call request (202) and the call is placed afterwards. Pausing an account switches its numbers off, so a new request from one of them answers 400 INVALID_FROM_NUMBER; 422 with code carrier_account_paused or carrier_account_unavailable is answered only while the number is still switched on although its account is paused or no longer connected, and nothing is accepted. A request already accepted waits while its number’s account is paused: it is placed if the account is turned back on before its expires_at, and otherwise ends expired with error_code request_expired. When the call is placed and your Telnyx account refuses it before it rings, the request ends failed with error_code request_failed, once, and its call is failed.

Outbound calls and call requests

Test calls

POST /agents/{id}/test-call rings your own phone with an agent. It answers the outbound-call codes above where they apply (invalid_destination, SELF_CALL_NOT_ALLOWED, BILLING_ERROR, SPEND_BUDGET_REACHED, WORKFLOW_UNPUBLISHED, WORKFLOW_ADMISSION_UNAVAILABLE), and these of its own:

The browser data plane

A page that runs a call — the Web SDK, a shared link’s page, the dashboard’s test tab — talks to a handful of routes on the same host as this API, https://api.goyappr.com, that never take the secret key: POST /web-call (the browser’s offer), POST /turn-credentials, POST /web-call/cancel and the browser’s call request (/web-call/call-requests…). They take a session token from POST /calls {"type":"web"} as x-yappr-web-token, a call request’s capability as x-yappr-call-request-key, a shared link, or a dashboard sign-in. GET / lists them under browser, and each is an operation in the OpenAPI file with that host as its server. Their refusals have the same shape as every other here; a credential that is missing or not ours is 401 UNAUTHORIZED rather than MISSING_KEY / INVALID_KEY. The offer’s VOICE_CONNECTION_REFUSED and VOICE_UNAVAILABLE (in the table above) spend the token: mint a new session before connecting again.

Forwarded service codes

Two routes pass a failure through from a service behind the API instead of translating it, so they can answer with a code that is not in any table above. Treat these by HTTP status, not by code — the codes are not part of the published contract and can change without notice. Neither carries customer data, and neither is worth branching on. Report the code if you need support to trace it.