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

# Restore deleted attachment

Availability: 9.2+

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

## Paths

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

- [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

- `conversation_id` (string)
  The unique identifier of the conversation.
- `attachment_id` (string)
  The unique identifier of the attachment to restore.

## Description

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

Restore a soft-deleted attachment.<br/><br/>[Required authorization] Route required privileges: agentBuilder:read.

## Response

Indicates a successful response

## Code Examples

#### Console

```console
POST /api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}/_restore
```

#### curl

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

## Response Examples

#### Restore attachment response

Example response returning the restored attachment

```json
{
  "attachment": {
    "active": true,
    "current_version": 1,
    "description": "Restored attachment",
    "id": "att-abc123",
    "type": "text",
    "versions": [
      {
        "content_hash": "sha256-xyz",
        "created_at": "2025-01-06T10:00:00.000Z",
        "data": "Restored content",
        "estimated_tokens": 10,
        "version": 1
      }
    ]
  },
  "success": true
}
```

