Delete Agent
Archive an AI agent so it stops handling calls. The agent can be restored later.
DELETE
Delete (Archive) Agent
Archive an agent to remove it from active duty. Archived agents stop receiving calls immediately but their configuration and call history are preserved. You can restore them later from the platform.
This endpoint is idempotent — re-archiving an already-archived agent returns 200.
Endpoint
POST https://crmwebhook.com/functions/v1/crm-api/archive-agent
Headers
| Header | Value | Required |
|---|---|---|
x-api-key | cfy_your_api_key | Yes |
Content-Type | application/json | Yes |
Request Body
{
"agent_id": "d8f2a229-2f5c-42ba-ac65-402f2c25fee2"
}
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string (UUID) | Required | The agent to archive |
Example Request
curl -X POST \
https://crmwebhook.com/functions/v1/crm-api/archive-agent \
-H "x-api-key: cfy_your_api_key" \
-H "Content-Type: application/json" \
-d '{"agent_id": "d8f2a229-2f5c-42ba-ac65-402f2c25fee2"}'
Response Shape
{
"agent_id": "d8f2a229-2f5c-42ba-ac65-402f2c25fee2",
"archived_at": "2026-04-17T12:30:00Z"
}
Response Codes
| Status | Meaning |
|---|---|
200 | Agent archived (or already archived) |
401 | Unauthorized — invalid or missing API key |
403 | Organization/sub-account mismatch with API key scope |
404 | Agent not found |
Is this a permanent delete?
No. Archiving is a soft delete. The agent moves to the Archived tab in the platform. You can restore it from the UI at any time.
What happens to call history and recordings?
All call history, transcripts, and recordings are preserved. They remain accessible in the Call Logs section even after archiving the agent.
Can I archive via the API and restore via the API?
Currently, archiving is available via the API but restoring must be done from the platform UI under AI Agents > Archived.