Skip to main content
DELETE
Detach Agent Phone Number
Destructive Detach an agent phone number to stop routing that number through the agent in one direction. The number stays in your workspace and can be attached to this or another agent later. A number linked for both directions keeps the direction you did not detach.

When to use this

  • Move a number to another agent: detach it here, then attach it to the new agent.
  • Free a slot: an agent can hold only three numbers per direction.
  • Stop inbound routing: after an inbound detach, calls to the number no longer reach this agent.

Before you detach

The request is refused while the number is still in use:
  • Calls are live on the number.
  • For an outbound detach, a batch that is running, paused, scheduled, or waiting dials from the number.
  • For an outbound detach, an active workflow uses the number in a voice call step.

Detach agent phone number request

Verify the result

A 200 response returns the closed link in data, with unlinked_at set and unlink_reason of manual. Call List Agent Phone Numbers to confirm the number is gone from that direction.

Errors and recovery

Refusals carry a code in data.code. A retry after a successful detach returns 404 because the number is no longer linked in that direction.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agentId
string
required

Agent ID from List Agents.

Example:

"agent_2g7Xy3tY53gRlp"

phoneNumberId
string
required

Phone number ID from List Agent Phone Numbers.

Example:

"phn_2g7Xy3tY53gRlp"

Query Parameters

direction
enum<string>
required

The direction to detach. A number linked for both directions keeps the other one.

Available options:
inbound,
outbound

Response

Successful response.

success
boolean
required
error
boolean
required
statusCode
integer
required
message
string
required
data
object | null
required
timestamp
string<date-time>
required