Skip to main content
POST
Answer a number's calls in Yappr
Moves a number’s calls to Yappr, so the number’s inbound agent answers them. In your Telnyx account, one setting changes: the number’s connection moves from where its calls go today to the account’s Call Control App. Requires carrier_accounts:manage. Limit: 200 per workspace per day. Pick the inbound agent with POST /phone-numbers/configure (inbound_agent_id) before or after. Calls out from the number work whether it is configured or not. The numbers come from a sync: phone_number_id is a number’s id in the account’s numbers.
carrier_state.state reads ready, or paused while the account is paused because Telnyx refused calls (that pause does not stop configuring).

Ask first

Send the request once without confirm (an empty body, or {}). Nothing changes: the answer is 400 CONFIRM_REQUIRED with warnings and current_connection_name, where the number’s calls go today. Show them to whoever decides, then send {"confirm": true}.
Yappr reads the ask-first warnings from your Telnyx account with your key, as it answers: the number’s connection, its voice settings and its voicemail. Whatever Telnyx does not answer just then (or a number the sync has not read a Telnyx id for yet) comes from the last sync instead, and the last sync does not read voicemail, so voicemail can be missing from that answer. The 200 reads them all again, live, as the change is made.

Read this before you send confirm: true

What changes
  • Calls to the number stop reaching the connection it is on today (carrier_state.current_connection_name, for example your office phone system). The inbound agent you pick in Yappr answers them instead.
  • Until the number has an inbound agent, its callers are turned away.
  • Calls to it are handled like calls to a number bought from Yappr: your credit, your call time windows and Yappr’s capacity all apply, and a call Yappr turns away does not go on to your old connection.
What stays the same
  • Messaging, the emergency address, caller name (CNAM) and tags.
  • Calls out from your own phone system that show this number.
  • Everything else in your Telnyx account, including the number’s own settings below.
Cost: Telnyx bills your account for these calls (the minutes, plus its call control, streaming and recording fees). Yappr bills the agent minutes as usual. To undo: stop answering here puts the number back on the connection it was on (carrier_state.previous_connection_name), or on no connection if it had none. You can also change the connection yourself in Telnyx, under Numbers → My Numbers.

Warnings

connection_change is the one thing that changes: Yappr changes only the connection. If one of these is on for the number in Telnyx, it stays on, and warnings lists it: number_recording, forwarding_on_failure and call_screening also show on the number itself, in carrier_state.notes. Three settings make Yappr refuse instead, because Yappr would never get the calls, or could not tell which number they were for: forwarding every call elsewhere (422 NUMBER_FORWARDS_ALL_CALLS), a translated number (422 NUMBER_HAS_TRANSLATED_NUMBER) and a tech prefix added to the dialled number (422 NUMBER_HAS_TECH_PREFIX). The number shows blocked with the reason in carrier_state.blockers. Turn the setting off in Telnyx, sync, then try again.

How it is done

  1. Yappr asks Telnyx, with your key, for the number’s status, connection and settings, live.
  2. It changes the number’s connection to the account’s Call Control App. Nothing else is sent to Telnyx.
  3. It reads the number back. If Telnyx shows another connection, the answer is 502 CONFIGURE_NOT_APPLIED.
  4. It remembers the connection it replaced, for stop answering here.
A number already on the app is recorded as configured and nothing is sent to Telnyx (changed: false), so sending it twice is safe.

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
phone_number_id
string<uuid>
required

Body

application/json
confirm
enum<boolean>

true makes the change: it says you have read what changes and want this number's calls to reach Yappr. Leave it out (an empty body, or {}) to ask first: nothing changes, and the answer is 400 CONFIRM_REQUIRED with the warnings to show.

Available options:
true

Response

Configured: calls to the number reach Yappr. carrier_state.state is ready, or paused while the account is paused because Telnyx refused calls (that pause does not stop configuring).

data
object
changed
boolean

false when the number was already on the app: nothing was sent to Telnyx.

warnings
enum<string>[]

The same list the ask-first answer gave, read again as the change was made: connection_change when the number moved, and the settings Yappr left on (carrier_state.notes shows those too, except voicemail).

Available options:
forwarding_on_failure,
number_recording,
call_screening,
voicemail,
connection_change