Spaces method and path for this operation:
post /s/{space_id}/api/agent_builder/conversations/{conversation_id}/attachments
Refer to Spaces for more information.
Create a new attachment for a conversation with version tracking.
[Required authorization] Route required privileges: agentBuilder:read.
Body
-
The attachment data/content. Required unless origin is provided.
-
Human-readable description of the attachment.
-
Optional custom ID for the attachment.
-
Origin string (for example, saved object ID) for by-reference attachments. When provided without data, the content is resolved once at creation time.
-
The type of the attachment (e.g., text, esql, visualization).
POST
/api/agent_builder/conversations/{conversation_id}/attachments
curl \
--request POST 'https://<KIBANA_URL>/api/agent_builder/conversations/{conversation_id}/attachments' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: true" \
--data '{"data":"Internal system data","description":"System context","hidden":true,"type":"text"}'
Request examples
Create hidden attachment example
Example request for creating a hidden attachment
{
"data": "Internal system data",
"description": "System context",
"hidden": true,
"type": "text"
}
Example request for creating a JSON attachment with custom ID
{
"data": {
"configuration": {
"enabled": true,
"threshold": 50
},
"metadata": {
"source": "user_input"
}
},
"description": "Application settings",
"id": "custom-attachment-id",
"type": "json"
}
Example request for creating a text attachment
{
"data": "This is the content of my text attachment",
"description": "Meeting notes",
"type": "text"
}
Response examples (200)
Example response returning the created attachment
{
"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
}
]
}
}