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

# Delete conversation attachment

Availability: 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}`

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

#### Path Parameters

- `conversation_id` (string · max: 256)
  The unique identifier of the conversation.
- `attachment_id` (string · max: 256)
  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.<br/><br/>[Required authorization] Route required privileges: agentBuilder:read.

## Query String Parameters

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

## Response

Indicates a successful response

## Code Examples

#### Console

```console
DELETE /api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}
```

#### curl

```curl
curl -X DELETE "https://{kibana_url}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}" \
  -H "kbn-xsrf: true"
```

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

