---
title: "Delete Agent"
method: DELETE
path: "/api/ai-agents/{agent_id}"
tags: ["ai-agents", "ai-agents"]
---

# Delete Agent

`DELETE /api/ai-agents/{agent_id}`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/ai-agents/{agent_id}`
- Auth: none declared

Delete an AI Agent (cascades to triggers, gates, etc.).

Voice-only widget protection: if removing this agent would leave the
workspace with no voice-capable agent AND there are voice_only livechat
widgets in the same workspace, return 409 with the dependent widget IDs.
The dashboard surfaces the 409 as a "bulk reassign / bulk downgrade"
prompt; passing ?bulk_downgrade=true downgrades those widgets to
display_mode='chat' inside the same transaction before the agent is
deleted (no partial state — full rollback on any per-widget failure).

Template protection (spec §5.2): refuses to delete system templates
(workspace_id=0). Templates are platform-shipped; the workspace-level
"delete" semantic is POST /api/ai-agents/<fork_id>/reset (drops the
workspace fork; the template re-surfaces in the list automatically).

## Path parameters

- `agent_id` integer, required

## Query parameters

- `bulk_downgrade` boolean

## Response `204`

Successful Response

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
