Skip to main content
POST
Sync numbers
Reads every number in your Telnyx account, with your API key, and brings each one into this workspace as a phone number with provider: "external". You don’t add numbers one by one: they appear in GET /phone-numbers and on the account’s numbers, with the same agent settings as any number. Requires carrier_accounts:manage. A sync changes nothing in your Telnyx account and places no call. Yappr runs one when you choose the Call Control App, on every test and Turn back on, and once a day. Call it yourself after you buy, port or release numbers in Telnyx. A workspace has 48 sync runs a day, whatever starts them; continuing a run already in progress is free. To learn whether an account is synced at all — and why not — without running one, read its sync_status on GET /carrier-accounts/, or sync on GET /carrier-accounts/status.

What a sync does to each number

When a number is switched off

A number that cannot call out has is_active: false, and carrier_state.notes says why. What switched it off decides what switches it back on: A number someone in your workspace switched off stays off through every sync. The sync still proves every active number again (ownership_verified_at), so you can configure any of them and have its calls answered, whether it is on or off.

A number another workspace uses

A number is in Yappr once. If several workspaces connect the same Telnyx account, a number one of them already has is never taken over by another: the sync counts it in held_elsewhere and lists it in held_elsewhere_numbers (up to 100, without saying which workspace has it). It is added here by the first sync after that workspace removes it (DELETE …/numbers/, which changes nothing in Telnyx and keeps its call history there). That workspace’s own syncs then skip it. held_elsewhere_details says why each number the sync kept out is not here ({phone_number, reason}, never which workspace): the numbers in held_elsewhere_numbers, then the ones in excluded.

Numbers you removed

A number you took out with DELETE …/numbers/ is skipped by every sync of this workspace, so another workspace connected to the same Telnyx account can take it. Each sync lists the ones it skipped in excluded (up to 100). To have one here again, send POST /carrier-accounts//numbers with the number: it is added here again (201), and the syncs keep it up to date from then on — unless another workspace has taken it since: then 409 NUMBER_ALREADY_REGISTERED until that workspace removes it. A number that left your Telnyx account and came back under a new Telnyx id is synced as usual.

Large accounts

A sync reads a large account in parts. complete: false means there is more to read: call sync again, or let Yappr read the next part: it carries on within 5 minutes, where this one stopped (the counts are the run’s so far, and synced_at is null). An account with more than 10,000 numbers answers 422 TOO_MANY_NUMBERS. run and batch hold every count, of the run so far and of the last part, including a few the top level leaves out: unchanged, restored, missing, dropped, skipped_stale, invalid and excluded. Numbers that left your account are marked gone (telnyx_gone) only at the end of a whole read. Telnyx’s list can shift while a large account is read in parts, so there a number is marked gone only when two complete reads in a row miss it, and a read during which the list changed removes nothing. The account keeps what the last sync found on GET /carrier-accounts/: last_synced_at, sync (with in_progress: true while a large account is still being read) and, when it failed, last_sync_error.

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

Response

Synced. For a large account, one more part read (see complete).

data
object