# Delete AI agent

> Delete an agent.

Source: https://docs.mycrmsim.com/docs/ai-agents/delete-ai-agent

```http
DELETE https://backend.mysmsgateway.app/api/v1/ext/ai-agents/{id}
```

- Category: myCRMSIM AI Agents / AI Agents
- Auth: Bearer access token
- Scope: `ai_agents.write`

It stops answering at once. Cannot be undone; to stop it for now, set `status` to `paused` instead.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Agent id. Example: `a3f1c2d4-5b6e-4f70-8a91-b2c3d4e5f607` |
| `workspace_id` | query | number | yes | A workspace of the installer. Example: `7` |

## Response 200

OK

```json
{
  "success": true,
  "message": "AI agent deleted",
  "data": {
    "id": "a3f1c2d4-5b6e-4f70-8a91-b2c3d4e5f607"
  }
}
```

## Response 401

Missing or invalid token

```json
{
  "success": false,
  "message": "Invalid or expired access token."
}
```

## Response 403

Missing scope

```json
{
  "success": false,
  "message": "Missing scope(s): ai_agents.write. This integration was granted: …"
}
```

## Response 404

workspace_id does not exist or is not the installer's (same response for both)

```json
{
  "success": false,
  "message": "Workspace not found or not accessible to this token"
}
```

## Response 404

The agent does not exist or is in another workspace

```json
{
  "success": false,
  "message": "AI agent not found or not accessible to this token"
}
```
