Skip to main content
DELETE
Disconnect carrier account
Deletes the saved API key, and the account’s numbers stop working in this workspace. Their past calls stay in your call history, and nothing changes to the numbers in Telnyx. Requires carrier_accounts:manage.
restore is there only when you sent ?restore_routing=true:

Numbers that answer in Yappr

A number configured to answer in Yappr has to go back to its own connection first, or its calls would reach nobody. Send ?restore_routing=true and Yappr puts each such number back on the connection it was on before (up to 50 per request), reports it in restore, then disconnects. Without it, the answer is 409 CARRIER_ACCOUNT_HAS_CONFIGURED_NUMBERS; you can also stop answering on each one first. Campaigns and live calls are checked first: if a campaign calls from one of the numbers (409 CARRIER_NUMBERS_USED_BY_CAMPAIGNS) or a call is in progress (409 CARRIER_ACCOUNT_HAS_LIVE_CALLS), no number is moved. If Telnyx will not put a number back, or more than 50 are configured, nothing is disconnected: the answer is 409 CARRIER_ACCOUNT_HAS_CONFIGURED_NUMBERS with the same restore object, ok: false. Each number in restore.failed has a code: PREVIOUS_ROUTING_GONE (pick a connection for it in Telnyx), RESTORE_NOT_APPLIED (Telnyx accepted the change but the number still reads back on the app; try again in a minute), TELNYX_KEY_REJECTED (fix the key, or change the numbers in Telnyx yourself; the rest of the batch is not tried), TELNYX_REFUSED_CHANGE, TELNYX_REFUSED_REQUEST, TELNYX_UNAVAILABLE or NUMBER_REMOVED_FROM_TELNYX. While restore.remaining is above 0, send the same request again. You no longer remove the numbers yourself first (CARRIER_ACCOUNT_HAS_NUMBERS is retired).

The numbers

A number nothing points at is deleted. A number with history (past calls, a campaign, a charge) is kept, so that history stays: it is switched off, its carrier_state.state is removed and its carrier_account.status is disconnected. It may still be in your Telnyx account: connect the account again and its first sync brings back the ones Telnyx still lists. carrier_state.notes says whether one comes back on: off_until_active, and the sync switches it back on once Telnyx lists it as active; off_by_owner if someone in your workspace had switched it off before the disconnect, and it comes back switched off until someone switches it on. To let another workspace connected to the same Telnyx account take one, remove it with this account’s id; its history stays.

The app and the key

If Yappr created the Call Control App for you, Yappr deletes it from your Telnyx account too and reports it in telnyx_connection_deleted (null when the app was yours, false when Telnyx did not confirm the delete: remove it in Telnyx yourself). Yappr never deletes your API key: delete it in Telnyx yourself.

Errors

Authorizations

Authorization
string
header
required

Your Yappr API key (e.g. ypr_live_...). Generate one in the dashboard under Settings → API Keys. No key is 401 MISSING_KEY; a key that is not one of ours, or is revoked, is 401 INVALID_KEY; an expired one is 401 EXPIRED_KEY. A valid key without the scope an operation needs is 403 INSUFFICIENT_SCOPE on every operation, and the message names the scope. Every response, a 401 included, carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a minute per API key. Every 429, whatever its code, carries Retry-After (whole seconds, never zero): the per-key budget's RATE_LIMIT asks for what is left of the minute, a route's daily cap (RATE_LIMITED) for the time until that cap resets. All four headers are listed in Access-Control-Expose-Headers, so a browser can read them. A path the API does not serve (an unknown sub-path, an id left empty) is 404 ROUTE_NOT_FOUND, and a method a served path does not take is 405 METHOD_NOT_ALLOWED with an Allow header; both are answered before any scope check, and nothing is read or changed. A trailing slash is ignored where it cannot be an id left empty (POST /calls/ is POST /calls) and refused where it can (GET /calls/). A doubled slash inside a path is merged into one before the request reaches the API (GET //calls is GET /calls).

Path Parameters

id
string<uuid>
required

Query Parameters

restore_routing
boolean
default:false

true first moves every configured number back to the connection it was on in your Telnyx account, then disconnects.

Response

Disconnected

success
boolean
id
string<uuid>
telnyx_connection_deleted
boolean | null

null when Yappr did not create the app; false when Telnyx did not confirm deleting it.

restore
object

What ?restore_routing=true did before a disconnect: each configured number put back on the connection it was on, up to 50 a request. Present only when you sent restore_routing=true.