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

# Create conversation attachment

Availability: 9.2+

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

## Paths

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

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

## Description

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

Create a new attachment for a conversation with version tracking.<br/><br/>[Required authorization] Route required privileges: agentBuilder:read.

## Request Body

`application/json`

- `data` (object) — required
  The attachment data/content. Required unless origin is provided.
- `description` (string · max: 2048) — optional
  Human-readable description of the attachment.
- `hidden` (boolean) — optional
  Whether the attachment should be hidden from the user.
- `id` (string · max: 256) — optional
  Optional custom ID for the attachment.
- `origin` (string · max: 2048) — optional
  Origin string (for example, saved object ID) for by-reference attachments. When provided without data, the content is resolved once at creation time.
- `render_inline` (boolean · default: false) — optional
  When true, the attachment is rendered inline in the UI when the conversation is opened, without the agent referencing it.
- `type` (string · max: 256) — required
  The type of the attachment (e.g., text, esql, visualization).

## Response

Indicates a successful response

## Code Examples

#### Console

```console
POST /api/agent_builder/conversations/{conversation_id}/attachments
{
  "data": "Internal system data",
  "description": "System context",
  "hidden": true,
  "type": "text"
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/agent_builder/conversations/{conversation_id}/attachments" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "data": "Internal system data",
  "description": "System context",
  "hidden": true,
  "type": "text"
}'
```

## Response Examples

#### Create attachment response

Example response returning the created attachment

```json
{
  "attachment": {
    "active": true,
    "current_version": 1,
    "description": "Meeting notes",
    "id": "att-abc123",
    "type": "text",
    "versions": [
      {
        "content_hash": "sha256-xyz",
        "created_at": "2025-01-06T10:00:00.000Z",
        "data": "This is the content of my text attachment",
        "estimated_tokens": 12,
        "version": 1
      }
    ]
  }
}
```

