# Detach phone number (/docs/api-reference/phone-numbers/detachPhoneNumber)

> Detach a phone number from its associated agent.



**POST** `/phone_number/detach`

Detach a phone number from its associated agent.

```yaml
operationId: detachPhoneNumber
requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        required:
          - phone_number_id
        properties:
          phone_number_id:
            type: integer
            description: ID of the phone number to detach.
            example: 23
responses:
  '200':
    description: Phone number detached.
    content:
      application/json:
        schema:
          type: object
          properties:
            phone_number_id:
              type: integer
            message:
              type: string
        example:
          phone_number_id: 23
          message: Phone Number +15551234567 Detached Successfully.
```

**Python SDK**

```python
import os
from omnidimension import Client

# Initialize the client
api_key = os.environ.get('OMNIDIM_API_KEY')
client = Client(api_key)

# Detach a phone number from its associated agent
phone_number_id = 123  # Replace with your phone number ID
response = client.phone_number.detach(phone_number_id)
print(response)
```

**curl**

```bash
curl -X POST "https://backend.omnidim.io/api/v1/phone_number/detach" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY"
```
