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

# Delete Phone Number

> Delete a phone number from your DialNexa workspace.

Destructive
Deletes a phone number from your DialNexa workspace and stops future use of that number in DialNexa. The number is unlinked from its agents, with `unlink_reason` set to `number_deleted` in [Get Agent Phone Number History](https://dialnexa.com/docs/api-reference/v1/agents/phone-number-history.md). For a bring-your-own number, DialNexa removes the SIP connection and its credentials. For a rented number, DialNexa releases the provider rental.

## When to use this

* **Workspace cleanup**: remove numbers you no longer use for inbound or outbound calls.
* **SIP trunk teardown**: remove a bring-your-own number and its SIP routing credentials from DialNexa.
* **Cost control**: stop future rental activity for numbers that should no longer be billed through the workspace.

Do not call this endpoint for numbers that are still part of an active production flow. If you only need to inspect the number first, use [Get Phone Number Details](https://dialnexa.com/docs/api-reference/v1/phone-numbers/get.md).

## Before you delete

Confirm these conditions before sending the request:

* The number is not a system default phone number.
* No calls are live on the number.
* No batch that is running, paused, scheduled, waiting, or active dials from the number.
* No active workflows are using the number.
* Any inbound routing that depends on this number has been moved to another number.
* You are comfortable losing the current provider rental or SIP trunk connection.

## Example request

```bash theme={null}
curl -X DELETE "https://api.dialnexa.com/v1/organization-phone-numbers/phn_mfk3p8z2c4v6bn" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Result

A successful request returns `200 OK` with the success envelope, whose `data` is the number `200`. After deletion, the number no longer appears in [List Phone Numbers](https://dialnexa.com/docs/api-reference/v1/phone-numbers/list.md).

## Errors

* `404 Not Found` is returned when the phone number does not exist in this workspace or has already been deleted. A number that belongs to another workspace is reported the same way.
* `409 Conflict` is returned when the number is a system default, or is still in use. For a number in use, `data.code` is `PHONE_NUMBER_HAS_LIVE_CALLS`, `NUMBER_USED_BY_BATCH`, or `PHONE_NUMBER_USED_IN_ACTIVE_WORKFLOWS`, handled as described in [Detach Agent Phone Number](https://dialnexa.com/docs/api-reference/v1/agents/detach-phone-number.md#errors-and-recovery).
* `502 Bad Gateway` is returned when the telephony provider does not release the rented number, the number's provider does not support release, or DialNexa cannot remove the SIP trunk. The number is not deleted and stays in your workspace; retry later or contact support.

## Related endpoints

* [List Phone Numbers](https://dialnexa.com/docs/api-reference/v1/phone-numbers/list.md): confirm which numbers are available in your workspace.
* [Detach Agent Phone Number](https://dialnexa.com/docs/api-reference/v1/agents/detach-phone-number.md): remove a number from one agent without deleting it.
* [Get Phone Number Details](https://dialnexa.com/docs/api-reference/v1/phone-numbers/get.md): inspect a number before deleting it.
* [Buy Phone Number](https://dialnexa.com/docs/api-reference/v1/phone-numbers/buy.md): purchase a replacement provider number.
* [Link SIP Trunk](https://dialnexa.com/docs/api-reference/v1/phone-numbers/link-sip-trunk.md): connect a bring-your-own number.


## OpenAPI

````yaml DELETE /v1/organization-phone-numbers/{id}
openapi: 3.0.0
info:
  title: DialNexa API
  description: Public `/v1` REST API for the DialNexa voice AI platform.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: Agents
  - name: Batch Calls
  - name: Calls
  - name: Knowledge Base
  - name: Languages
  - name: LLMs
  - name: Phone Numbers
  - name: Organization Folders
  - name: Transcribers
  - name: Webhooks
  - name: Voices
  - name: Workflows
  - name: Workflow Leads
  - name: Authentication
  - name: Agent Builder
  - name: Agent Evaluations
paths:
  /v1/organization-phone-numbers/{id}:
    delete:
      tags:
        - Phone Numbers
      summary: Delete Phone Number
      description: >-
        Deletes a workspace phone number, releases its provider rental or SIP
        connection, unlinks it from its agents, and prevents future DialNexa
        routing. The request is blocked if the number is a system default, has
        live calls, is used by a batch that is running, paused, scheduled or
        waiting, or is used by an active workflow. If the provider rental or SIP
        trunk cannot be released, the request fails with 502 and the number is
        kept.
      operationId: deletePhoneNumber
      parameters:
        - name: id
          required: true
          in: path
          description: Phone number ID
          schema:
            example: phn_mfk3p8z2c4v6bn
            type: string
      responses:
        '200':
          description: Phone number deleted successfully. data is the number 200.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                  - statusCode
                  - message
                  - data
                  - timestamp
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  error:
                    type: boolean
                    enum:
                      - false
                  statusCode:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: Success
                  data:
                    type: integer
                    enum:
                      - 200
                  timestamp:
                    type: string
                    format: date-time
              examples:
                success:
                  summary: Successful response
                  value:
                    success: true
                    error: false
                    statusCode: 200
                    message: Success
                    data: 200
                    timestamp: '2026-09-07T06:00:00.000Z'
        '401':
          description: Unauthorized - missing or invalid API key.
        '404':
          description: Phone number not found.
        '409':
          description: >-
            Conflict: the number is a system default, has live calls
            (PHONE_NUMBER_HAS_LIVE_CALLS), is used by a batch that is running,
            paused, scheduled or waiting (NUMBER_USED_BY_BATCH), or is used by
            an active workflow (PHONE_NUMBER_USED_IN_ACTIVE_WORKFLOWS).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                numberUsedByBatch:
                  summary: Number used by an unfinished batch
                  value:
                    statusCode: 409
                    error: true
                    success: false
                    data:
                      code: NUMBER_USED_BY_BATCH
                      batches:
                        - id: batch_mfh2k9x7q1w3er
                          title: July renewals
                          status: running
                      live_calls: 0
                    message: >-
                      1 unfinished batch(es) ("July renewals") and 0 live
                      call(s) use this number. Change the batches' number or
                      cancel them first.
                    errors: []
                phoneNumberHasLiveCalls:
                  summary: Calls in progress on the number
                  value:
                    statusCode: 409
                    error: true
                    success: false
                    data:
                      code: PHONE_NUMBER_HAS_LIVE_CALLS
                      live_calls: 2
                      batches: []
                    message: >-
                      2 call(s) are in progress on this number. Wait for them to
                      finish, then retry.
                    errors: []
                phoneNumberUsedInActiveWorkflows:
                  summary: Number used by an active workflow
                  value:
                    statusCode: 409
                    error: true
                    success: false
                    data:
                      code: PHONE_NUMBER_USED_IN_ACTIVE_WORKFLOWS
                      affected_workflows:
                        - id: mfk3p8z2c4v6bn
                          title: Lead follow-up
                          status: active
                    message: >-
                      This phone number is used in 1 active workflow(s). Pause
                      those workflows first, then retry.
                    errors: []
        '500':
          description: Internal server error.
        '502':
          description: >-
            The telephony provider did not release the number, the provider does
            not support release, or DialNexa could not remove the SIP trunk. The
            number is not deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                providerReleaseFailed:
                  summary: Provider release failed
                  value:
                    statusCode: 502
                    error: true
                    success: false
                    data: []
                    message: >-
                      Could not release the phone number with the telephony
                      provider. Try again or contact support.
                    errors: []
      security:
        - bearer: []
components:
  schemas:
    ErrorResponse:
      type: object
      description: Error body on endpoints without response filtering.
      properties:
        statusCode:
          type: integer
          example: 404
        error:
          type: boolean
          enum:
            - true
        success:
          type: boolean
          enum:
            - false
        data:
          oneOf:
            - type: object
              properties:
                code:
                  type: string
                  description: Machine-readable refusal code.
            - type: array
              items: {}
          description: >-
            For a coded refusal, an object with code and the details listed for
            that code. Otherwise an empty array.
        message:
          type: string
        errors:
          type: array
          items:
            type: string
          description: Validation messages for a 400. Empty for other errors.
        validation_errors:
          type: array
          description: >-
            Present when uploaded rows fail number validation (batch and
            workflow lead uploads): one group per distinct error.
          items:
            type: object
            properties:
              error:
                type: string
              rows:
                type: array
                items:
                  type: integer
                description: Row numbers with this error.
              phone_numbers:
                type: array
                items:
                  type: string
        invalid_row_count:
          type: integer
          description: 'Present with validation_errors: how many rows failed.'
      required:
        - statusCode
        - error
        - success
        - data
        - message
        - errors
  securitySchemes:
    bearer:
      scheme: bearer
      type: http

````

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