Agents
Delete Agent
Delete an agent by ID from your workspace.
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 Conflictwith codeAGENT_USED_IN_ACTIVE_WORKFLOWSand the list ofaffected_workflows. - The agent’s phone numbers are unlinked automatically, with
unlink_reasonset toagent_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 Conflictwith codePHONE_NUMBER_HAS_LIVE_CALLS,NUMBER_USED_BY_BATCH, orPHONE_NUMBER_USED_IN_ACTIVE_WORKFLOWS. See Detach Agent Phone Number for each case. - Confirm the
idwith 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. A404 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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Agent ID
Example:
"agent_2g7Xy3tY53gRlp"