---
type: api
title: Delete an agent
description: Delete an agent by ID. This action cannot be undone. To learn more about agents, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).<br/><br/>[Required authorization] Route required privileges: agentBuilder:manageAgents.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-delete-agent-builder-agents-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-delete-agent-builder-agents-id
products:
  - Kibana
---

# Delete an agent

Availability: Generally available since 9.2

- Server: `https://{kibana_url}`

## Paths

- `DELETE` `/api/agent_builder/agents/{id}`

#### Path parameters

- `id` (string) — required
  The unique identifier of the agent to delete.

## Description

Delete an agent by ID. This action cannot be undone. To learn more about agents, refer to the [agents documentation](https://www.elastic.co/docs/explore-analyze/ai-features/agent-builder/agent-builder-agents).

## Required authorization

- Privileges: `agentBuilder:manageAgents`

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Response

Indicates a successful response

`application/json`

## Code examples

#### Console

```console
DELETE kbn://api/agent_builder/agents/{id}
```

#### curl

```curl
curl \
  -X DELETE "${KIBANA_URL}/api/agent_builder/agents/{id}" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true"
```

## Response examples

#### Delete agent response

Example response showing that deletion of the agent has been successful

```json
{
  "success": true
}
```

