Create conversation attachment Technical Preview

POST /api/agent_builder/conversations/{conversation_id}/attachments

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.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Path parameters

  • conversation_id string Required

    The unique identifier of the conversation.

application/json

Body

  • description string

    Human-readable description of the attachment.

  • hidden boolean

    Whether the attachment should be hidden from the user.

  • id string

    Optional custom ID for the attachment.

  • type string Required

    The type of the attachment (e.g., text, json, visualization_ref).

Responses

  • 200 application/json

    Indicates a successful response

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