Skip to main content
DELETE
Delete Agent
Destructive Deletes an agent and all of its versions from your workspace. The agent disappears from List Agents and can no longer be assigned to phone numbers or used for new calls. Historical call logs that reference it remain available.

When to use this

  • Cleanup: remove test or superseded agents so pickers and audits only show agents that are in use.
  • Decommissioning: retire an agent after migrating its phone numbers and workflows to a replacement.

Before you call it

  • Deactivate any active workflows that use this agent first. While one exists, the delete returns 409 Conflict with code AGENT_USED_IN_ACTIVE_WORKFLOWS and the list of affected_workflows.
  • The agent’s phone numbers are unlinked automatically, with unlink_reason set to agent_deleted. The agent’s phone number history is not readable after the delete, because the agent no longer exists. Inbound calls to those numbers have no agent until you attach them to another one.
  • The delete is refused while one of the agent’s numbers cannot be released: 409 Conflict with code PHONE_NUMBER_HAS_LIVE_CALLS, NUMBER_USED_BY_BATCH, or PHONE_NUMBER_USED_IN_ACTIVE_WORKFLOWS. See Detach Agent Phone Number for each case.
  • Confirm the id with Get Agent Details; the delete is scoped to the workspace associated with your API key.

Result

The agent no longer appears in API results, but existing call history stays readable. A 404 Not Found means the agent does not exist in this workspace; a 409 Conflict means an active workflow still uses it or one of its numbers is still in use. See API errors for the standard error format.

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Agent ID

Example:

"agent_2g7Xy3tY53gRlp"

Response

Agent deleted successfully.

The standard envelope without a data member.

success
enum<boolean>
required
Available options:
true
error
enum<boolean>
required
Available options:
false
statusCode
integer
required
Example:

200

message
string
required
Example:

"Success"

timestamp
string<date-time>
required