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

# Unassign Phone Number

Unassign a phone number from an agent.

### Headers

<ParamField header="X-API-Key" type="string" required>
  Your API key for authentication.
</ParamField>

<ParamField header="X-Organization-Id" type="string" required>
  The organization ID.
</ParamField>

### Path Parameters

<ParamField path="agent_id" type="string" required>
  The unique identifier of the agent.
</ParamField>

<ParamField path="phone_number_id" type="string" required>
  The unique identifier of the phone number to unassign.
</ParamField>

### Permissions

* `phone_numbers:update` (admin, agent\_manager)

### Response

<ResponseField name="success" type="boolean">
  Indicates if the unassignment was successful.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable success message.
</ResponseField>

<ResponseField name="data" type="object">
  The updated agent object.
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Phone number unassigned successfully",
    "data": {
      "agent_id": "agent_a1b2c3d4e5f6",
      "agent_name": "Sales Rep",
      "assigned_phone_number_ids": [],
      "updated_at": "2024-01-20T15:00:00Z"
    }
  }
  ```
</ResponseExample>

### Errors

<ResponseField name="404" type="object">
  Agent not found.
</ResponseField>

<ResponseField name="403" type="object">
  Access denied to agent.
</ResponseField>

<ResponseField name="400" type="object">
  Phone number not assigned to this agent.
</ResponseField>
