> ## 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.

# Stop Answering a Number's Calls in Yappr

> **Stop answering here.** Puts the number back on the connection it was on
before it was configured (`carrier_state.previous_connection_name`), or on no
connection if it had none, so its calls go where they went before. Its agents
stay assigned and calls out from it keep working. If its connection was
already changed away from the app in Telnyx, Yappr records that and changes
nothing (`changed: false`). Yappr reads the number back before recording the
change. Requires `carrier_accounts:manage`. It runs even while Yappr has
switched carrier accounts off for the workspace (never `403
CARRIER_ACCOUNTS_NOT_ENABLED`), so a line is never stranded on Yappr's app.


**Stop answering here.** Undoes [answer a number's calls in Yappr](https://docs.goyappr.com/api-reference/carrier-accounts/configure-number.md):
Yappr puts the number back on the connection it was on before
(`carrier_state.previous_connection_name`), or on no connection if it had none, so its
calls go where they went before. That connection is the only setting Yappr changes in
your Telnyx account. Requires `carrier_accounts:manage`.

It works even while Yappr has switched carrier accounts off for the workspace: putting a
number back is never refused `CARRIER_ACCOUNTS_NOT_ENABLED`, so a line is never stranded
on Yappr's app.

The number stays in Yappr: its agents stay assigned, calls out from it keep working, and
its `carrier_state.state` reads `not_configured` again. You can configure it again at any
time.

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

```json theme={null}
{
  "data": {
    "id": "e2a4…",
    "number": "+972501234567",
    "provider": "external",
    "sip_inbound_configured": false,
    "carrier_state": {
      "state": "not_configured",
      "telnyx_status": "active",
      "current_connection_name": "Office PBX",
      "previous_connection_name": null,
      "blockers": [],
      "notes": [],
      "removed_at": null
    }
  },
  "changed": true
}
```

If the number's connection was already changed away from the app in Telnyx, Yappr records
that and sends nothing (`changed: false`).

Yappr changes the connection, then reads the number back. If Telnyx still shows it on the
app, nothing is recorded and the answer is `502 RESTORE_NOT_APPLIED`: its calls still
reach Yappr. Try again in a minute.

To stop answering on every configured number of an account at once and disconnect it,
[disconnect](https://docs.goyappr.com/api-reference/carrier-accounts/delete.md) with `?restore_routing=true`.

## If the old connection is gone

If the connection the number was on no longer exists in Telnyx, Telnyx refuses to put it
back and the answer is `409 PREVIOUS_ROUTING_GONE`. The number's calls still reach Yappr.
Pick a connection for it yourself in Telnyx (**Numbers → My Numbers**), then
[sync](https://docs.goyappr.com/api-reference/carrier-accounts/sync.md): its `carrier_state.state` reads
`not_configured`.

## Errors

| Status | `code` | Meaning |
| - | - | - |
| 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 | `PREVIOUS_ROUTING_GONE` | Telnyx refused to put the number back, usually because that connection no longer exists. See above. |
| 409 | `CONNECTION_REQUIRED`, `NUMBER_REMOVED_FROM_TELNYX` | The account has no Call Control App, or Telnyx no longer lists the number. |
| 422 | `TELNYX_KEY_REJECTED` | Telnyx refused the saved key, and the account pauses. Change the number's connection in Telnyx yourself, or fix the key and try again. |
| 422 | `TELNYX_REFUSED_CHANGE`, `TELNYX_REFUSED_REQUEST` | Telnyx refused the change, or refused the request with the key's permissions. Nothing changed. |
| 502 | `RESTORE_NOT_APPLIED` | Telnyx accepted the change, but the number still reads back on the app, so its calls still reach Yappr. Try again in a minute. |
| 503 | `TELNYX_UNAVAILABLE` | Telnyx did not answer, or was busy. Nothing changed; try again. |


## OpenAPI

````yaml DELETE /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
    delete:
      tags:
        - Carrier Accounts
      summary: Stop answering a number's calls in Yappr
      description: >
        **Stop answering here.** Puts the number back on the connection it was
        on

        before it was configured (`carrier_state.previous_connection_name`), or
        on no

        connection if it had none, so its calls go where they went before. Its
        agents

        stay assigned and calls out from it keep working. If its connection was

        already changed away from the app in Telnyx, Yappr records that and
        changes

        nothing (`changed: false`). Yappr reads the number back before recording
        the

        change. Requires `carrier_accounts:manage`. It runs even while Yappr has

        switched carrier accounts off for the workspace (never `403

        CARRIER_ACCOUNTS_NOT_ENABLED`), so a line is never stranded on Yappr's
        app.
      operationId: restoreCarrierAccountNumber
      responses:
        '200':
          description: >-
            Its calls go back to where they went before (`carrier_state.state`
            is `not_configured`)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/PhoneNumber'
                  changed:
                    type: boolean
                    description: >-
                      `false` when the number was no longer on the app: nothing
                      was sent to Telnyx.
        '404':
          description: '`CARRIER_ACCOUNT_NOT_FOUND` or `NUMBER_NOT_FOUND`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >
            - `PREVIOUS_ROUTING_GONE` — Telnyx refused to put the number back,
            usually
              because that connection no longer exists. Its calls still reach Yappr.
              Pick a connection for it in Telnyx (Numbers → My Numbers), then sync.
            - `CONNECTION_REQUIRED` — the account has no Call Control App.

            - `NUMBER_REMOVED_FROM_TELNYX` — Telnyx no longer lists the number.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >
            - `TELNYX_KEY_REJECTED` — Telnyx refused the saved key; the account
            pauses.
              Change the number's connection in Telnyx yourself, or fix the key and try again.
            - `TELNYX_REFUSED_CHANGE` — Telnyx refused the change. Nothing
            changed.

            - `TELNYX_REFUSED_REQUEST` — Telnyx accepted the key but refused the
            request
              (check the key's permissions). Nothing changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            `RESTORE_NOT_APPLIED` — Telnyx accepted the change, but the number
            still reads back on the app, so its calls still reach Yappr. Nothing
            was recorded; try again in a minute.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            `TELNYX_UNAVAILABLE` — Telnyx did not answer. Nothing changed; 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.
  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.