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: read_agent_builder.
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","type":"text","hidden":true,"description":"System context"}'
Request examples
Create hidden attachment example
Example request for creating a hidden attachment
{
"data": "Internal system data",
"type": "text",
"hidden": true,
"description": "System context"
}
Example request for creating a JSON attachment with custom ID
{
"id": "custom-attachment-id",
"data": {
"metadata": {
"source": "user_input"
},
"configuration": {
"enabled": true,
"threshold": 50
}
},
"type": "json",
"description": "Application settings"
}
Example request for creating a text attachment
{
"data": "This is the content of my text attachment",
"type": "text",
"description": "Meeting notes"
}
Response examples (200)
Example response returning the created attachment
{
"attachment": {
"id": "att-abc123",
"type": "text",
"active": true,
"versions": [
{
"data": "This is the content of my text attachment",
"version": 1,
"created_at": "2025-01-06T10:00:00.000Z",
"content_hash": "sha256-xyz",
"estimated_tokens": 12
}
],
"description": "Meeting notes",
"current_version": 1
}
}