> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goyappr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Answer a Number's Calls in Yappr

> Moves the number's calls to Yappr. In your Telnyx account, the number's
connection changes from where its calls go today to the account's Call
Control App, and its inbound agent answers them. That connection is the only
setting Yappr changes. Yappr checks the number with Telnyx first, makes the
change, then reads it back, and remembers the connection it replaced so
[Stop answering here](/api-reference/carrier-accounts/restore-number) can put
it back. On a number already configured it changes nothing. Requires
`carrier_accounts:manage`. Limit: 200 per workspace per day.

**Ask first.** Send the request once without `confirm` (an empty body): nothing
changes, and the answer is `400 CONFIRM_REQUIRED` with `warnings`, read from
your Telnyx account as it answers (voicemail included), and
`current_connection_name`. What Telnyx does not answer just then comes from the
last sync, which does not read voicemail. Show them, then send `{"confirm": true}`.

**What changes:** calls to the number stop reaching the connection it was on,
and the inbound agent you pick in Yappr answers them instead. Until the number
has an inbound agent, its callers are turned away.

**What stays the same:** messaging, the emergency address, caller name (CNAM),
tags, number-level recording, forwarding on failure, call screening, voicemail,
and calls out from your own phone system that show this number. Settings of
these that are on come back in `warnings`.

**Cost:** Telnyx bills your account for these calls; Yappr bills the agent
minutes as usual.


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](https://docs.goyappr.com/api-reference/phone-numbers/configure.md)
(`inbound_agent_id`) before or after. Calls out from the number work whether it is
configured or not. The numbers come from a [sync](https://docs.goyappr.com/api-reference/carrier-accounts/sync.md):
`phone_number_id` is a number's `id` in the account's `numbers`.

```bash theme={null}
curl -X POST https://api.goyappr.com/carrier-accounts/7c1e…/numbers/e2a4…/configure \
  -H "Authorization: Bearer ypr_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "confirm": true }'
```

```json theme={null}
{
  "data": {
    "id": "e2a4…",
    "number": "+972501234567",
    "provider": "external",
    "inbound_agent_id": "5b0f…",
    "sip_inbound_configured": true,
    "carrier_state": {
      "state": "ready",
      "telnyx_status": "active",
      "current_connection_name": "Yappr",
      "previous_connection_name": "Office PBX",
      "blockers": [],
      "notes": ["number_recording"],
      "removed_at": null
    }
  },
  "changed": true,
  "warnings": ["number_recording", "connection_change"]
}
```

`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}`.

```bash theme={null}
curl -X POST https://api.goyappr.com/carrier-accounts/7c1e…/numbers/e2a4…/configure \
  -H "Authorization: Bearer ypr_live_..."
```

```json theme={null}
{
  "error": "Send {\"confirm\": true}. This changes the number's connection in your Telnyx account, so its calls stop reaching where they go today.",
  "code": "CONFIRM_REQUIRED",
  "warnings": ["number_recording", "voicemail", "connection_change"],
  "current_connection_name": "Office PBX"
}
```

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](https://docs.goyappr.com/api-reference/carrier-accounts/sync.md) 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](https://docs.goyappr.com/api-reference/call-windows/get.md) 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](https://docs.goyappr.com/api-reference/carrier-accounts/restore-number.md) 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:

| `warnings` | What it means |
| - | - |
| `connection_change` | Calls to the number stop reaching the connection they reach today (`current_connection_name`) and come to Yappr. Not listed for a number on no connection, or already on the app. |

Yappr changes only the connection. If one of these is on for the number in Telnyx, it stays
on, and `warnings` lists it:

| `warnings` | What it means |
| - | - |
| `number_recording` | Telnyx records calls to this number too, so each call is recorded, and billed, twice. You can turn it off in Telnyx. |
| `forwarding_on_failure` | Your "forward on failure" setting stays on. |
| `voicemail` | Telnyx voicemail stays on for the number. |
| `call_screening` | Telnyx screens callers before Yappr gets the call. |

`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](https://docs.goyappr.com/api-reference/carrier-accounts/sync.md), 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](https://docs.goyappr.com/api-reference/carrier-accounts/restore-number.md).

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

| Status | `code` | Meaning |
| - | - | - |
| 400 | `CONFIRM_REQUIRED` | The body is not `{"confirm": true}`, so nothing changed. It carries `warnings` and `current_connection_name`: the ask-first answer (above). |
| 403 | `CARRIER_ACCOUNTS_NOT_ENABLED` | Yappr has switched carrier accounts off for this workspace. Contact Yappr support. |
| 404 | `CARRIER_ACCOUNT_NOT_FOUND`, `NUMBER_NOT_FOUND` | Not in this workspace, or not a number of this account. |
| 404 | `RESOURCE_ID_INVALID` | The account or the number segment is not an id at all. |
| 409 | `CONNECTION_REQUIRED` | [Choose the Call Control App](https://docs.goyappr.com/api-reference/carrier-accounts/connection.md) first. |
| 409 | `NUMBER_REMOVED_FROM_TELNYX` | Telnyx no longer lists the number in your account. |
| 409 | `NUMBER_NOT_READY` | Its status in Telnyx is not `active` yet (for example, a port is pending). |
| 409 | `CARRIER_ACCOUNT_PAUSED` | Telnyx refused the key, or the Call Control App is gone. Fix it, then [turn the account back on](https://docs.goyappr.com/api-reference/carrier-accounts/reactivate.md). A pause for refused calls does not stop this. |
| 409 | `NUMBER_ON_YAPPR_PLATFORM` | The number is on a connection Yappr itself uses. Yappr does not move it. |
| 409 | `VOICE_NOT_READY` | Yappr cannot answer calls on your numbers right now, for example during an update. Nothing changed; try again in a few minutes. |
| 422 | `NUMBER_FORWARDS_ALL_CALLS` | Telnyx forwards every call to this number elsewhere, so Yappr would never get them. Turn off call forwarding for it in Telnyx, then sync. |
| 422 | `NUMBER_HAS_TRANSLATED_NUMBER` | Telnyx delivers its calls as another number. Remove the translated number in Telnyx, then sync. |
| 422 | `NUMBER_HAS_TECH_PREFIX` | Telnyx adds a tech prefix to the dialled number before the call arrives, so Yappr could not match it. Turn off the tech prefix for this number in Telnyx, then sync. |
| 422 | `TELNYX_REFUSED_CHANGE` | Telnyx refused the change. Nothing changed. |
| 422 | `TELNYX_REFUSED_REQUEST` | Telnyx accepted the key but refused to read or change the number. Check the key's permissions in Telnyx. Nothing changed, and the account does not pause. |
| 422 | `TELNYX_KEY_REJECTED` | Telnyx refused the saved key. The account pauses. |
| 429 | `RATE_LIMITED` | 200 numbers configured in this workspace today. `Retry-After` says when the day's window resets. |
| 502 | `CONFIGURE_NOT_APPLIED` | Telnyx took the change, but the number reads back on another connection. Check it in Telnyx (**Numbers → My Numbers**), then try again. |
| 503 | `TELNYX_UNAVAILABLE` | Telnyx did not answer. Try again. |


## OpenAPI

````yaml POST /carrier-accounts/{id}/numbers/{phone_number_id}/configure
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /carrier-accounts/{id}/numbers/{phone_number_id}/configure:
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
          format: uuid
      - name: phone_number_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
    post:
      tags:
        - Carrier Accounts
      summary: Answer a number's calls in Yappr
      description: >
        Moves the number's calls to Yappr. In your Telnyx account, the number's

        connection changes from where its calls go today to the account's Call

        Control App, and its inbound agent answers them. That connection is the
        only

        setting Yappr changes. Yappr checks the number with Telnyx first, makes
        the

        change, then reads it back, and remembers the connection it replaced so

        [Stop answering here](/api-reference/carrier-accounts/restore-number)
        can put

        it back. On a number already configured it changes nothing. Requires

        `carrier_accounts:manage`. Limit: 200 per workspace per day.


        **Ask first.** Send the request once without `confirm` (an empty body):
        nothing

        changes, and the answer is `400 CONFIRM_REQUIRED` with `warnings`, read
        from

        your Telnyx account as it answers (voicemail included), and

        `current_connection_name`. What Telnyx does not answer just then comes
        from the

        last sync, which does not read voicemail. Show them, then send
        `{"confirm": true}`.


        **What changes:** calls to the number stop reaching the connection it
        was on,

        and the inbound agent you pick in Yappr answers them instead. Until the
        number

        has an inbound agent, its callers are turned away.


        **What stays the same:** messaging, the emergency address, caller name
        (CNAM),

        tags, number-level recording, forwarding on failure, call screening,
        voicemail,

        and calls out from your own phone system that show this number. Settings
        of

        these that are on come back in `warnings`.


        **Cost:** Telnyx bills your account for these calls; Yappr bills the
        agent

        minutes as usual.
      operationId: configureCarrierAccountNumber
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                confirm:
                  type: boolean
                  enum:
                    - true
                  description: >
                    `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.
      responses:
        '200':
          description: >
            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).
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PhoneNumber'
                  changed:
                    type: boolean
                    description: >-
                      `false` when the number was already on the app: nothing
                      was sent to Telnyx.
                  warnings:
                    type: array
                    items:
                      type: string
                      enum:
                        - forwarding_on_failure
                        - number_recording
                        - call_screening
                        - voicemail
                        - connection_change
                    description: >
                      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`).
        '400':
          description: >
            `CONFIRM_REQUIRED` — the body is not `{"confirm": true}`, so nothing
            changed.

            This is also the ask-first answer: it carries `warnings`, read from
            your

            Telnyx account before anything moves (voicemail included; whatever
            Telnyx

            does not answer just then comes from the last sync, without
            voicemail), and

            `current_connection_name`, where the number's calls go today. Show
            them, then

            send `{"confirm": true}`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    properties:
                      warnings:
                        type: array
                        description: >
                          What Configure changes for the number, and its
                          settings in Telnyx that stay on,

                          read from your Telnyx account with your key (from the
                          last sync, without

                          `voicemail`, for whatever Telnyx does not answer just
                          then):

                          - `connection_change` — calls to the number stop
                          reaching the connection they
                            reach today (`current_connection_name`) and come to Yappr. Not listed for a
                            number already on the app, or on no connection.
                          - `number_recording` — Telnyx records these calls too,
                          so each call is recorded,
                            and billed, twice. You can turn it off in Telnyx.
                          - `forwarding_on_failure` — your "forward on failure"
                          setting stays on.

                          - `call_screening` — Telnyx screens callers before
                          Yappr gets the call.

                          - `voicemail` — Telnyx voicemail stays on for the
                          number.
                        items:
                          type: string
                          enum:
                            - forwarding_on_failure
                            - number_recording
                            - call_screening
                            - voicemail
                            - connection_change
                      current_connection_name:
                        type: string
                        nullable: true
                        example: Office PBX
        '403':
          $ref: '#/components/responses/CarrierAccountsNotEnabled'
        '404':
          description: >-
            `CARRIER_ACCOUNT_NOT_FOUND` or `NUMBER_NOT_FOUND` (not a number of
            this account).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >
            Nothing changed in Telnyx.

            - `CONNECTION_REQUIRED` — choose the Call Control App first.

            - `NUMBER_REMOVED_FROM_TELNYX` — Telnyx no longer lists the number
            in your account.

            - `NUMBER_NOT_READY` — its status in Telnyx is not `active` yet.

            - `CARRIER_ACCOUNT_PAUSED` — Telnyx refused the key, or the app is
            gone. Fix it
              and turn the account back on first. (A pause for refused calls does not stop this.)
            - `NUMBER_ON_YAPPR_PLATFORM` — the number is on a connection Yappr
            itself uses. Yappr does not move it.

            - `VOICE_NOT_READY` — Yappr cannot answer calls on your numbers
            right now,
              for example during an update. Try again in a few minutes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >
            - `NUMBER_FORWARDS_ALL_CALLS` — Telnyx forwards every call to this
            number
              elsewhere, so Yappr would never get them. Turn call forwarding off for it in
              Telnyx, then sync. Nothing changed.
            - `NUMBER_HAS_TRANSLATED_NUMBER` — Telnyx delivers its calls as
            another
              number. Remove the translated number in Telnyx, then sync. Nothing changed.
            - `NUMBER_HAS_TECH_PREFIX` — Telnyx adds a tech prefix to the
            dialled number
              before the call arrives, so Yappr could not match it. Turn off the tech
              prefix for this number in Telnyx, then sync. Nothing changed.
            - `TELNYX_REFUSED_CHANGE` — Telnyx refused the change. Nothing
            changed.

            - `TELNYX_REFUSED_REQUEST` — Telnyx accepted the key but refused to
            read or
              change the number (check the key's permissions). Nothing changed; the
              account does not pause.
            - `TELNYX_KEY_REJECTED` — Telnyx refused the saved key; the account
            pauses.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '`RATE_LIMITED` — 200 numbers configured in this workspace today.'
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            `CONFIGURE_NOT_APPLIED` — Telnyx took the change, but the number
            reads back on another connection. Check it in Telnyx (Numbers → My
            Numbers), then try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '`TELNYX_UNAVAILABLE` — Telnyx did not answer. Try again.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PhoneNumber:
      type: object
      properties:
        id:
          type: string
          format: uuid
        number:
          type: string
          example: '+972551234567'
        friendly_name:
          type: string
          nullable: true
        provider:
          type: string
          description: >
            Where the number comes from: `telnyx` for a number bought from
            Yappr,

            `external` for a number in your own Telnyx account, added to a

            [carrier account](/api-reference/carrier-accounts/add-number),
            `phone_system`

            for the business number of an extension endpoint that calls out
            through your own

            phone system
            ([register.outbound](/concepts/sip-trunks#outbound-calls-through-the-extension)):

            switched on and off on that endpoint, never released here, no rent,
            and no calls in

            (they reach the endpoint's own agent; `inbound_agent_id` and
            `inbound_split` are

            refused with `422 FIELD_NOT_ALLOWED`).
          enum:
            - telnyx
            - external
            - phone_system
        status:
          type: string
          enum:
            - active
            - pending_requirements
            - suspended
        is_active:
          type: boolean
        inbound_agent_id:
          type: string
          format: uuid
          nullable: true
        outbound_agent_id:
          type: string
          format: uuid
          nullable: true
        inbound_split:
          nullable: true
          description: |
            The A/B test on incoming calls, or `null` when the number always
            answers with `inbound_agent_id`.

            **`percent` is the share of calls that go to the SECOND agent**
            (`agent_id` below). The agent already bound to the number takes the
            rest — a `percent` of 30 means 70% of calls to `inbound_agent_id`
            and 30% to the second agent. The dashboard slider shows the first
            agent's share and stores `100 - slider`; the API always states the
            second agent's.

            Which agent answers a given call is fixed for that call: it is
            derived from the carrier's call id, so a redelivered webhook and
            every internal re-derivation agree. If the second agent cannot take
            calls (inactive, an unpublished workflow, or a different kind of
            agent from the first), the call goes to the first agent and the call
            record says so.
          allOf:
            - $ref: '#/components/schemas/AgentSplit'
        outbound_split:
          nullable: true
          description: |
            The same thing for calls this number places: when `POST /calls` is
            sent without an `agent_id`, this split decides which agent calls.
            An explicit `agent_id` always wins. BYOC SIP endpoints carry no
            split.
          allOf:
            - $ref: '#/components/schemas/AgentSplit'
        sip_inbound_configured:
          type: boolean
          description: |
            Whether carrier-side routing for incoming calls is in place. On an
            `external` number: whether the number is on Yappr's Call Control App
            in your Telnyx account, so calls to it reach Yappr.
        sip_outbound_configured:
          type: boolean
        country_code:
          type: string
          nullable: true
        monthly_cost:
          type: number
          nullable: true
          description: >
            The number's monthly price in cents, before VAT, as listed for it.
            Whether Yappr charges it is `rent`. Null on an `external` number.
        rent:
          description: >
            Whether Yappr charges the number's monthly rent. Returned by GET
            /phone-numbers and PATCH /phone-numbers/{id}; not part of a number
            embedded elsewhere (a campaign's from_phone_number, a carrier
            account's numbers).
          allOf:
            - $ref: '#/components/schemas/PhoneNumberRent'
        next_renewal_at:
          type: string
          format: date-time
          nullable: true
          description: >
            When the rent next renews: monthly, on the day and time the
            subscription started (the last day of a shorter month). Null when
            `rent.included`, and when the number's release is scheduled
            (`scheduled_release_at`): it does not renew. Returned by GET
            /phone-numbers and PATCH /phone-numbers/{id}.
        scheduled_release_at:
          type: string
          format: date-time
          nullable: true
          description: >
            When a number released with POST /phone-numbers/{id}/release goes:
            the end of the period already paid for. Until then the number keeps
            working as before; POST /phone-numbers/{id}/keep undoes the release.
            Null when no release is scheduled.
        created_at:
          type: string
          format: date-time
        phone_system:
          type: object
          nullable: true
          description: >
            The extension endpoint a `phone_system` number calls out through;
            `null` on every

            other number.
          properties:
            sip_endpoint_id:
              type: string
              format: uuid
            sip_endpoint_name:
              type:
                - string
                - 'null'
        carrier_account:
          type: object
          nullable: true
          description: >
            The Telnyx account an `external` number calls through. `null` on
            numbers

            bought from Yappr, and for a key without `carrier_accounts:read` —

            `provider: external` still says the number is your own. On a number
            a

            [disconnect](/api-reference/carrier-accounts/delete) kept for its
            history,

            `status` is `disconnected`: `GET /carrier-accounts/{id}` no longer
            finds the

            account, and its `id` is what removes the number

            (`DELETE /carrier-accounts/{id}/numbers/{phone_number_id}`).
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            provider:
              type: string
              enum:
                - telnyx
            status:
              type: string
              enum:
                - untested
                - active
                - paused
                - disconnected
        carrier_state:
          type: object
          nullable: true
          description: >
            Where an `external` number stands in your Telnyx account. `null` on

            numbers bought from Yappr, and for a key without

            `carrier_accounts:read`. `state` is the first of these that applies:

            `telnyx_gone` (Telnyx no longer lists it: a sync found it gone,
            since

            `removed_at`; it cannot call), `removed` (Removed from this
            workspace: a

            disconnect kept it for its call history, since `removed_at`; it may
            still be

            in your Telnyx account, it cannot call, and `carrier_account.status`
            is

            `disconnected`), `not_ready` (Telnyx lists it

            with a status other than `active`), `paused` (its carrier account is

            paused), `blocked` (not configured, and a setting in `blockers`
            stops

            Yappr answering it), `not_configured` (calls out work; calls in
            still

            ring at `current_connection_name` until you configure it with

            `POST /carrier-accounts/{id}/numbers/{phone_number_id}/configure`)
            and

            `ready` (calls to it are answered here).
          properties:
            state:
              type: string
              enum:
                - ready
                - not_configured
                - blocked
                - paused
                - not_ready
                - telnyx_gone
                - removed
            telnyx_status:
              type: string
              nullable: true
              description: >-
                The number's status in Telnyx, as of the last sync. `null` until
                a sync has read it.
            current_connection_name:
              type: string
              nullable: true
              description: >-
                The connection the number is on in Telnyx, as of the last sync.
                `null` when it is on none.
            previous_connection_name:
              type: string
              nullable: true
              description: >-
                The connection the number goes back to when you stop answering
                it here. `null` when it had none.
            blockers:
              type: array
              items:
                type: string
                enum:
                  - forwarding_always
                  - translated_number
                  - tech_prefix
              description: >
                Telnyx settings that stop Yappr answering the number. Configure
                is refused while any is on.

                `forwarding_always`: Telnyx forwards every call to it elsewhere.
                `translated_number`: Telnyx

                delivers its calls as another number. `tech_prefix`: Telnyx adds
                a tech prefix to the dialled

                number, so Yappr could not match it. Change the setting in
                Telnyx, then sync.
            notes:
              type: array
              items:
                type: string
                enum:
                  - number_recording
                  - forwarding_on_failure
                  - call_screening
                  - off_by_owner
                  - off_until_active
                  - off_while_paused
              description: >
                Telnyx voice settings on the number that configuring leaves on
                (recording, forwarding when

                unanswered, call screening). They stay as they are when you
                configure it. When the number is

                switched off (`is_active` is `false`, so it places no calls),
                one more note says why:

                `off_by_owner` (an owner or admin switched it off; it stays off
                until one switches it on),

                `off_until_active` (Telnyx did not list it as active; the sync
                switches it on once Telnyx does)

                or `off_while_paused` (its carrier account paused; turning the
                account back on switches it on).
            removed_at:
              type: string
              format: date-time
              nullable: true
              description: >-
                When the number went out of use here, on a `telnyx_gone` or
                `removed` number. `null` on every other.
        ownership_verified_at:
          type: string
          format: date-time
          nullable: true
          description: >
            When your Telnyx API key last proved that this `external` number is
            an

            active number in your account. `null` means that is not proven now:
            Telnyx

            no longer lists it as active, or its account was disconnected. The
            number is

            not callable until a [test](/api-reference/carrier-accounts/test) or
            a sync

            finds it again. Always `null` on numbers bought from Yappr.
    Error:
      type: object
      required:
        - error
        - code
      description: >
        Every error response - the secret-key API and the browser data plane
        alike - carries a

        human-readable `error` and a stable machine `code`, and a refusal that
        names what is

        wrong with the request carries `issues[]` too. Branch on `code`, never
        on the `error`

        text. A refusal that names nothing more specific carries the code its
        status means:

        `BAD_REQUEST` (400), `UNAUTHORIZED` (401, the browser data plane; the
        secret-key API

        answers `MISSING_KEY`, `INVALID_KEY` or `EXPIRED_KEY`), `BILLING_ERROR`
        (402),

        `FORBIDDEN` (403), `NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405),
        `CONFLICT` (409),

        `GONE` (410), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415),

        `UNPROCESSABLE_REQUEST` (422), `RATE_LIMIT` (429), `INTERNAL_ERROR`
        (500),

        `UPSTREAM_ERROR` (502), `SERVICE_UNAVAILABLE` (503), `UPSTREAM_TIMEOUT`
        (504). Some

        refusals add members of their own beside these (a call request's
        `status`, a workflow's

        `current_version`); the operation says which.
      properties:
        error:
          type: string
          description: The refusal, in one sentence for a person. Its wording may change.
        code:
          type: string
          description: The stable code to branch on.
        issues:
          type: array
          description: >
            Each thing at fault, on a 400 or 422 that names them: every query
            parameter or body field, not just the first. `path` is the
            parameter's name or the field's location.
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                description: >-
                  query_param_unknown, query_param_repeated, query_param_blank,
                  query_param_invalid, field_unknown, field_required,
                  field_invalid, or the route's own word.
              path:
                type: string
              message:
                type: string
    AgentSplit:
      type: object
      description: |
        A two-agent A/B test. `percent` is the share of calls the second agent
        (`agent_id`) takes; the resource's existing agent takes `100 - percent`.
      properties:
        agent_id:
          type: string
          format: uuid
          description: The second agent — the one being tested against the existing one.
        percent:
          type: integer
          minimum: 1
          maximum: 99
          description: Share of calls routed to `agent_id`, 1–99.
      required:
        - agent_id
        - percent
    PhoneNumberRent:
      type: object
      required:
        - included
        - reason
        - monthly_price_cents
        - last_charged_at
      properties:
        included:
          type: boolean
          description: >
            False when a rent was charged for the number in the last 40 days
            (each renewal is a phone_number row on GET /billing/transactions);
            true when none was.
        reason:
          type: string
          nullable: true
          enum:
            - own_carrier
            - not_charged
            - no_subscription
            - phone_system
            - null
          description: >
            Why the rent is included: `own_carrier` - a number in your own
            Telnyx account, whose rent Telnyx bills you; `not_charged` - a
            monthly subscription is on record but has charged nothing in the
            last 40 days; `no_subscription` - a Yappr number with no
            subscription (one Yappr set up for you); `phone_system` - a number
            that calls out through your own phone system, which Yappr does not
            rent. Null when the rent is charged.
        monthly_price_cents:
          type: integer
          nullable: true
          description: The monthly rent before VAT, paid by card. Null when included.
        last_charged_at:
          type: string
          format: date-time
          nullable: true
          description: The newest rent charge in the last 40 days, or null.
  responses:
    CarrierAccountsNotEnabled:
      description: >
        `CARRIER_ACCOUNTS_NOT_ENABLED` — Yappr has switched calling out through
        your own

        Telnyx account off for this workspace. It is available in every
        workspace, so this

        is only the emergency-off answer; contact Yappr support. Every
        carrier-accounts

        route answers this while it is off (check with

        [GET /carrier-accounts/status](/api-reference/carrier-accounts/status)).
        An API key

        without the route's scope gets a 403 of its own.
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Error'
              - type: object
                properties:
                  enabled:
                    type: boolean
                    example: false
          example:
            error: >-
              Calling out through your own Telnyx account is switched off for
              this workspace. Contact Yappr support.
            code: CARRIER_ACCOUNTS_NOT_ENABLED
            enabled: false
  headers:
    RetryAfter:
      description: Whole seconds to wait before sending the request again. Never zero.
      schema:
        type: integer
        minimum: 1
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        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`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.