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

# Detach Numbers from Trunk

> Unmap one or more numbers from a SIP trunk

Unmap one or more numbers from this trunk. Detaching deletes the number's bridge mapping,
fires deprovision, sets the number back to `NOT_ASSIGNED`, and releases channels.

<Note>
  **Prerequisites:** API Token + Org-Handle. See [Authentication](/api/get-started/authentication).
</Note>

### Headers

| Name          | Type   | Required | Description                |
| ------------- | ------ | -------- | -------------------------- |
| Authorization | string | Yes      | `Token <your-api-key>`     |
| Org-Handle    | string | Yes      | Organization domain handle |
| Content-Type  | string | Yes      | `application/json`         |

### Path parameters

| Name | Type    | Required | Description |
| ---- | ------- | -------- | ----------- |
| id   | integer | Yes      | Trunk id    |

### Request body

| Field       | Type       | Required | Description      |
| ----------- | ---------- | -------- | ---------------- |
| number\_ids | integer\[] | Yes      | Numbers to unmap |

### Partial success

Each `data.numbers` entry reports `ok`/`error`. A number that isn't mapped to this trunk
returns `ok: false` with `"Number is not mapped to this trunk."`

<ResponseExample>
  ```json 200 theme={null}
  {
    "status_code": 200,
    "message": "Numbers unmapped from trunk.",
    "data": {
      "trunk_id": 21,
      "numbers": [
        { "number_id": 501, "ok": true }
      ]
    }
  }
  ```

  ```json 404 theme={null}
  { "status_code": 404, "message": "Trunk not found." }
  ```
</ResponseExample>

```bash cURL theme={null}
curl -s -X POST "https://unpod.ai/api/v2/platform/telephony/trunks/21/detach-numbers/" \
  -H "Authorization: Token <your-api-key>" \
  -H "Org-Handle: <your-org-handle>" \
  -H "Content-Type: application/json" \
  -d '{"number_ids": [501]}'
```


## OpenAPI

````yaml POST /api/v2/platform/telephony/trunks/{id}/detach-numbers/
openapi: 3.0.3
info:
  title: Unpod API
  description: REST API for Unpod Voice AI Platform
  version: 2.0.0
servers:
  - url: https://unpod.ai/
    description: QA
  - url: https://unpod.ai/
    description: Production
security: []
tags:
  - name: Organisation
  - name: Spaces
  - name: Agents
  - name: Tasks
  - name: Runs
  - name: Call Logs
  - name: Analytics
  - name: Providers
  - name: Bridges
  - name: Numbers
  - name: Trunks
  - name: Telephony
  - name: Billing
paths:
  /api/v2/platform/telephony/trunks/{id}/detach-numbers/:
    post:
      tags:
        - Trunks
      summary: Detach Numbers from Trunk
      operationId: detachNumbersFromTrunk
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            example: 21
        - $ref: '#/components/parameters/OrgHandle'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - number_ids
              properties:
                number_ids:
                  type: array
                  items:
                    type: integer
                  example:
                    - 501
            example:
              number_ids:
                - 501
      responses:
        '200':
          description: Numbers unmapped from trunk (partial-success per number)
          content:
            application/json:
              example:
                status_code: 200
                message: Numbers unmapped from trunk.
                data:
                  trunk_id: 21
                  numbers:
                    - number_id: 501
                      ok: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Trunk not found
          content:
            application/json:
              example:
                status_code: 404
                message: Trunk not found.
      security:
        - TokenAuth: []
components:
  parameters:
    OrgHandle:
      name: Org-Handle
      in: header
      required: true
      schema:
        type: string
        example: unpod.tv
      description: Organization domain handle
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API token
      content:
        application/json:
          example:
            status_code: 401
            message: Authentication credentials were not provided.
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Format: Token <your-api-key>'

````