> ## Documentation Index
> Fetch the complete documentation index at: https://cpaas.fireflo.au/llms.txt
> Use this file to discover all available pages before exploring further.

# DELETE /v1/agents/{agent_id}

> Delete an AI agent; one that has been live is kept for the record and switched off.

Deletes an agent. A draft that never went live is removed. Any other agent is kept for the record: it is switched off, leaves every pipeline, its open plans stop and it stops working its contacts — and its activity still reads. Either way it no longer appears in the list.

> [!NOTE]
>
> Needs the `agents:write` scope.

## Path parameters

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| `agent_id` | integer | Yes | The agent's id. |

## Request

```bash cURL theme={null}
curl -X DELETE "https://api.fireflo.au/v1/agents/15" \
  -H "Authorization: Bearer $OMNI_API_KEY"
```

```python Python theme={null}
import os

import requests

response = requests.delete(
    "https://api.fireflo.au/v1/agents/15",
    headers={"Authorization": f"Bearer {os.environ['OMNI_API_KEY']}"},
)
print(response.status_code)
```

```javascript Node theme={null}
const response = await fetch("https://api.fireflo.au/v1/agents/15", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.OMNI_API_KEY}` },
});
console.log(response.status);
```

## Response

`200 OK` — `outcome` is `deleted` (removed) or `archived` (kept for the record).

```json theme={null}
{
  "outcome": "deleted"
}
```

## Errors

Every refusal is `{"error": {"code", "message", "field"}}`; `field` is there when one input is at fault.

| Status | Error code | When |
| :- | :- | :- |
| 404 | `not_found` | No agent of this account's has that id. |
| 404 | `module_off` | The account doesn't have AI agents on: they aren't in its plan, or are switched off for it. |
| 403 | `scope_missing` | The key doesn't have the `agents:write` scope. |

Any request can also be refused for its key, its account or its rate (`key_required`, `invalid_key`, `account_suspended`, `plan_excludes_api`, `address_not_allowed`, `rate_limited`); see [the overview](https://cpaas.fireflo.au/api-reference/overview.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.