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

# Release Number

> Release a number bought from Yappr. Requires `phone_numbers:purchase`.

A number whose subscription is paid up is **kept until the end of the period already
paid for**, then released: it keeps answering and placing calls until then, and its rent
does not renew. The answer is `released: false` with `release_at`, and
GET /phone-numbers lists the same date as `scheduled_release_at`. A number whose payment
is overdue, or that has no subscription, is released now: `released: true`, and it is no
longer listed.

[POST /phone-numbers/{id}/keep](/api-reference/phone-numbers/keep) undoes a scheduled
release until `release_at`. Releasing a number that is already scheduled answers the same
date and changes nothing.

A campaign that still calls from the number, or a call on it in progress, refuses the
release; nothing is changed. A number from your own Telnyx account (`provider: external`)
is removed with DELETE /carrier-accounts/{id}/numbers/{phone_number_id} instead, and a
`phone_system` number is switched off on its SIP endpoint. It takes no body and no query
parameters.


Stops paying for a number you bought from Yappr. Required scope:
`phone_numbers:purchase`. In the dashboard, the same release is **Release** on
the number under Phone Numbers.

```bash theme={null}
curl -X POST "$YAPPR_API_URL/phone-numbers/c0ffee00-0000-4000-8000-000000000001/release" \
  --header "Authorization: Bearer $YAPPR_API_KEY"
```

It takes no body and no query parameters: anything sent is refused by name with
`400 PHONE_NUMBER_REQUEST_INVALID`, and nothing is changed.

## What happens to the number

* **Paid up: kept until the end of the period already paid for, then released.**
  The number keeps answering and placing calls as before until `release_at`, and
  its rent does not renew. [`GET /phone-numbers`](https://docs.goyappr.com/api-reference/phone-numbers/list)
  lists the same date as `scheduled_release_at`, with `next_renewal_at: null`.
* **Payment overdue, or no subscription: released now.** The number stops working
  at once and is no longer listed.
* **Changed your mind?** [Keep the number](https://docs.goyappr.com/api-reference/phone-numbers/keep.md) any
  time before `release_at`, and it renews as before.
* **Already scheduled?** Releasing it again answers the same `release_at` and
  changes nothing.
* **In use?** A campaign that still calls from the number, or a call on it in
  progress, refuses the release, and nothing is changed. Give the campaign another
  caller number (or stop or delete it), or wait for the call to end.

A released number is gone for good: it cannot be kept after `release_at`, and
buying it again is a new purchase.

## When a payment keeps failing

You don't have to release a number whose rent can't be charged. When a monthly
payment fails, the workspace is emailed and the payment is retried automatically
for about three weeks; the number keeps working meanwhile. If no retry goes
through, the subscription ends and the number is released the same way, without
a call to this endpoint. A payment that goes through in time keeps the number.

## Response

```json Kept until the end of the paid period theme={null}
{
  "phone_number_id": "c0ffee00-0000-4000-8000-000000000001",
  "released": false,
  "release_at": "2026-11-18T04:16:32.000Z"
}
```

```json Released now theme={null}
{
  "phone_number_id": "c0ffee00-0000-4000-8000-000000000001",
  "released": true,
  "release_at": null
}
```

| Field | What it tells you |
| - | - |
| `phone_number_id` | The number you released. |
| `released` | `true` when the number is gone now. `false` when it is still yours until `release_at`. |
| `release_at` | When a scheduled release happens: the end of the period already paid for. `null` when the number was released now. |

## Numbers that are not released here

| `provider` | What to do instead |
| - | - |
| `external` | A number in [your own Telnyx account](https://docs.goyappr.com/concepts/bring-your-own-carrier.md). Yappr never releases it: remove it from this workspace with [`DELETE /carrier-accounts/{id}/numbers/{phone_number_id}`](https://docs.goyappr.com/api-reference/carrier-accounts/remove-number), using its `carrier_account.id`. |
| `phone_system` | The business number of an extension that calls out through your own phone system. Switch outbound calls off on its SIP endpoint with [`PATCH /sip-endpoints/{id}`](https://docs.goyappr.com/api-reference/sip-endpoints/update) (`register.outbound.enabled: false`), or delete that endpoint. |

## Errors

| HTTP | Code | When |
| - | - | - |
| `400` | `PHONE_NUMBER_REQUEST_INVALID` | A body field or query parameter was sent. It takes neither; `issues[]` names each one. Nothing was changed. |
| `403` | `INSUFFICIENT_SCOPE` | The key does not hold `phone_numbers:purchase`. |
| `403` | `API_KEY_AGENT_SCOPED` | The key is [limited to some agents](https://docs.goyappr.com/api-reference/introduction.md#limiting-a-key-to-some-agents). Numbers belong to the whole workspace, so such a key cannot release one. |
| `404` | `NOT_FOUND` | No such number in this workspace, or it was released already. |
| `404` | `RESOURCE_ID_INVALID` | The id in the path is not an id. |
| `409` | `NUMBER_IN_CAMPAIGN` | A campaign that has not ended still calls from this number. Give it another caller number, or stop or delete it, first. Nothing was changed. |
| `409` | `NUMBER_ON_LIVE_CALL` | A call on this number is in progress. Try again when it ends. Nothing was changed. |
| `409` | `PHONE_SYSTEM_NUMBER` | The number calls out through your phone system. See the table above. Nothing was changed. |
| `409` | `NUMBER_FROM_OWN_CARRIER` | The number is in your own Telnyx account. See the table above. Nothing was changed. |
| `500` | `PHONE_RELEASE_FAILED` | A release that runs now could not run. Try again in a minute. |
| `500` | `PHONE_RELEASE_INCOMPLETE` | A release that runs now did not finish at the carrier, or the number is still listed. Yappr has been notified; contact support if it stays listed. |
| `503` | `BILLING_UNAVAILABLE` | Billing, or the number's checks, could not be reached. Nothing was changed. Try again in a minute. |


## OpenAPI

````yaml POST /phone-numbers/{id}/release
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:
  /phone-numbers/{id}/release:
    post:
      tags:
        - Phone Numbers
      summary: Release number
      description: >
        Release a number bought from Yappr. Requires `phone_numbers:purchase`.


        A number whose subscription is paid up is **kept until the end of the
        period already

        paid for**, then released: it keeps answering and placing calls until
        then, and its rent

        does not renew. The answer is `released: false` with `release_at`, and

        GET /phone-numbers lists the same date as `scheduled_release_at`. A
        number whose payment

        is overdue, or that has no subscription, is released now: `released:
        true`, and it is no

        longer listed.


        [POST /phone-numbers/{id}/keep](/api-reference/phone-numbers/keep)
        undoes a scheduled

        release until `release_at`. Releasing a number that is already scheduled
        answers the same

        date and changes nothing.


        A campaign that still calls from the number, or a call on it in
        progress, refuses the

        release; nothing is changed. A number from your own Telnyx account
        (`provider: external`)

        is removed with DELETE /carrier-accounts/{id}/numbers/{phone_number_id}
        instead, and a

        `phone_system` number is switched off on its SIP endpoint. It takes no
        body and no query

        parameters.
      operationId: releasePhoneNumber
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: >
            Scheduled (`released: false`, `release_at` the end of the paid
            period) or released now (`released: true`, `release_at: null`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumberRelease'
              examples:
                scheduled:
                  summary: Kept until the end of the paid period
                  value:
                    phone_number_id: c0ffee00-0000-4000-8000-000000000001
                    released: false
                    release_at: '2026-11-18T04:16:32.000Z'
                released_now:
                  summary: Payment overdue, released now
                  value:
                    phone_number_id: c0ffee00-0000-4000-8000-000000000001
                    released: true
                    release_at: null
        '400':
          description: >-
            PHONE_NUMBER_REQUEST_INVALID: a body field or query parameter was
            sent. It takes neither. Nothing was changed. issues[] names each
            one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >
            INSUFFICIENT_SCOPE — the key lacks `phone_numbers:purchase`.
            API_KEY_AGENT_SCOPED — the key is limited to agents, and numbers
            belong to the whole workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            NOT_FOUND: no such number in this workspace (or it was released
            already). RESOURCE_ID_INVALID: the id in the path is not an id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >
            Nothing changed.

            - `NUMBER_IN_CAMPAIGN` — a campaign that has not ended calls from
            this number. Give it another caller number, or stop or delete it,
            first.

            - `NUMBER_ON_LIVE_CALL` — a call on this number is in progress. Try
            again when it ends.

            - `PHONE_SYSTEM_NUMBER` — the number calls out through your phone
            system (`provider: phone_system`). Switch outbound calls off on its
            SIP endpoint (PATCH /sip-endpoints/{id}, `register.outbound.enabled:
            false`), or delete that endpoint.

            - `NUMBER_FROM_OWN_CARRIER` — the number is in your own Telnyx
            account (`provider: external`). Remove it from this workspace with
            DELETE /carrier-accounts/{id}/numbers/{phone_number_id}.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >
            - `PHONE_RELEASE_FAILED` — a release that runs now could not run.
            Try again in a minute.

            - `PHONE_RELEASE_INCOMPLETE` — a release that runs now did not
            finish at the carrier, or the number is still listed. Yappr has been
            notified; contact support if it stays listed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            BILLING_UNAVAILABLE: billing, or the number's checks, could not be
            reached. Nothing was changed. Try again in a minute.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PhoneNumberRelease:
      type: object
      required:
        - phone_number_id
        - released
        - release_at
      properties:
        phone_number_id:
          type: string
          format: uuid
        released:
          type: boolean
          description: >
            True when the number is gone now: released at the carrier, its
            subscription ended, and no longer listed by GET /phone-numbers.
            False when it is still yours: kept until `release_at`, or kept for
            good.
        release_at:
          type: string
          format: date-time
          nullable: true
          description: >
            When a scheduled release happens: the end of the period already paid
            for. The number keeps working until then. Null when the number was
            released now, or no release is scheduled. GET /phone-numbers lists
            the same date as `scheduled_release_at`.
    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
  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.