---
type: api
title: Update conversation 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-put-agent-builder-conversations-conversation-id-attachments-attachment-id
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-put-agent-builder-conversations-conversation-id-attachments-attachment-id
products:
  - Kibana
---

# Update conversation attachment

Availability: 9.2+

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

## Paths

- `PUT` `/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}`
- `PUT` `/s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_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

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

## Description

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

Update an attachment content. Creates a new version if content changed.<br/><br/>[Required authorization] Route required privileges: agentBuilder:read.

## Request Body

`application/json`

- `data` (object) — required
  The new attachment data/content.
- `description` (string) — optional
  Optional new description for the attachment.

## Response

Indicates a successful response

## Code Examples

#### Console

```console
PUT /api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}
{
  "data": "This is the updated content"
}
```

#### curl

```curl
curl -X PUT "https://{kibana_url}/api/agent_builder/conversations/{conversation_id}/attachments/{attachment_id}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "data": "This is the updated content"
}'
```

## Response Examples

#### Update attachment response

Example response returning the updated attachment with new version

```json
{
  "attachment": {
    "active": true,
    "current_version": 2,
    "description": "Meeting notes",
    "id": "att-abc123",
    "type": "text",
    "versions": [
      {
        "content_hash": "sha256-abc",
        "created_at": "2025-01-06T10:00:00.000Z",
        "data": "Original content",
        "estimated_tokens": 10,
        "version": 1
      },
      {
        "content_hash": "sha256-def",
        "created_at": "2025-01-06T11:00:00.000Z",
        "data": "This is the updated content",
        "estimated_tokens": 12,
        "version": 2
      }
    ]
  },
  "new_version": 2
}
```

