---
title: "Detach a phone number from the agent that answers it"
method: POST
path: "/v1/phone-numbers/{number_id}/detach-agent"
---

# Detach a phone number from the agent that answers it

`POST /v1/phone-numbers/{number_id}/detach-agent`

## Request

- Base URL: `https://api.skysay.ai`
- URL: `https://api.skysay.ai/v1/phone-numbers/{number_id}/detach-agent`
- Auth: none declared

A pure control-plane unbind: the number stays imported and owned by the workspace, its Number rules become disabled, and no carrier or provider operation happens. Inbound calls are then declined until an agent is attached again or the rules are changed. A number whose rules already answer without an agent replays as a no-op with idempotent: true. Optionally name the binding your confirmation showed with expected_agent_id, or expected_agent_endpoint_id for a rule that answers through an endpoint alone; if the number meanwhile answers with a different one the command refuses with 409 instead of detaching it.

## Request body

- object
  - `expected_agent_endpoint_id` string: The agent endpoint you expect to be answering, for a rule that answers through an endpoint whose owning agent you cannot name. Checked the same way as expected_agent_id; send either, both, or neither.
  - `expected_agent_id` string: The agent you expect to be answering. The command refuses with 409 when a different agent answers by the time it runs, or when the rule no longer names an agent at all; a binding that is already gone entirely still replays as the idempotent no-op.

## Response `200`

Number rules after the detach

## Other responses

- `409`: The number now answers with a binding other than the one named; nothing was detached

---

[API](https://skmtc.dev/skysay/apis/skysay-api.md) · [All operations](https://skmtc.dev/skysay/apis/skysay-api/llms.txt) · [OpenAPI document](https://skmtc.dev/skysay/apis/skysay-api/revisions/148c7e111260?raw)
