---
type: api
title: Delete conversation attachment
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/operation/operation-delete-agent-builder-conversations-conversation-id-attachments-attachment-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/operation/operation-delete-agent-builder-conversations-conversation-id-attachments-attachment-id
products:
  - Kibana
---

# Delete conversation attachment

Availability: Experimental since 9.2

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

## Paths

- `DELETE` `/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}`
- `DELETE` `/s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}`

#### Path parameters

- `conversation_id` (string · max length: 256) — required
  The unique identifier of the conversation.
- `attachment_id` (string · max length: 256) — required
  The unique identifier of the attachment to delete.

## Description

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

Delete an attachment. By default performs a soft delete (can be restored). Use permanent=true to permanently remove unreferenced attachments.

## Required authorization

- Privileges: `agentBuilder:read`

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

## Query string parameters

- `permanent` (boolean) — optional
  If true, permanently removes the attachment (only for unreferenced attachments).

## 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/conversations/CONVERSATION_ID/attachments/ATTACHMENT_ID
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/agent_builder/conversations/${CONVERSATION_ID}/attachments/${ATTACHMENT_ID}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Permanent delete attachment response

Example response for permanent delete (cannot be restored)

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

#### Soft delete attachment response

Example response for soft delete (can be restored)

```json
{
  "permanent": false,
  "success": true
}
```

