---
type: api
title: Delete an agent
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-delete-agent-builder-agents-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-delete-agent-builder-agents-id
products:
  - Kibana
---

# Delete an agent

Availability: 9.2+

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

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

#### Path Parameters

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

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

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.

## Response

Indicates a successful response

## 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
}
```

