Add events to a conversation Experimental; added in 9.6.0

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

Spaces method and path for this operation:

post /s/{space_id}/api/agent_builder/conversations/{conversation_id}/_add_events

Refer to Spaces for more information.

Append custom events to a conversation's timeline. The caller must be the owner, a member, or the conversation must be public. Server assigns id, created_at, and actor for each event; the body provides type and data. Only registered custom event types are accepted — built-in lifecycle types are rejected. To learn more about agent conversations, refer to the agent chat documentation.

[Required authorization] Route required privileges: agentBuilder:read.

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.

    Maximum length is 256.

application/json

Body

  • events array[object] Required

    Events to append. Between 1 and 10.

    At least 1 but not more than 10 elements.

    Hide events attributes Show events attributes object
    • data object Required

      The event payload. Its shape is defined by the event type.

      Additional properties are allowed.

    • type string Required

      The registered custom event type.

      Minimum length is 1, maximum length is 256.

Responses

  • 200 application/json

    Indicates a successful response

POST /api/agent_builder/conversations/{conversation_id}/_add_events
curl \
  -X POST "${KIBANA_URL}/api/agent_builder/conversations/${CONVERSATION_ID}/_add_events" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "elastic-api-version: 2023-10-31" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      { "type": "text_note", "data": { "text": "A note on this conversation" } }
    ]
  }'
POST kbn://api/agent_builder/conversations/${CONVERSATION_ID}/_add_events
{
  "events": [
    { "type": "text_note", "data": { "text": "A note on this conversation" } }
  ]
}
Request example
Example request appending two custom events to a conversation
{
  "events": [
    {
      "data": {
        "text": "First note on this conversation"
      },
      "type": "text_note"
    },
    {
      "data": {
        "text": "Second note on this conversation"
      },
      "type": "text_note"
    }
  ]
}
Response examples (200)
Example response returning the materialized events with server-assigned fields
{
  "events": [
    {
      "actor": {
        "id": "u_abc123_uid",
        "type": "user",
        "username": "elastic"
      },
      "created_at": "2026-09-14T10:00:00.000Z",
      "data": {
        "text": "First note on this conversation"
      },
      "id": "7d3f1a2b-4c5e-6f7a-8b9c-0d1e2f3a4b5c",
      "type": "text_note"
    },
    {
      "actor": {
        "id": "u_abc123_uid",
        "type": "user",
        "username": "elastic"
      },
      "created_at": "2026-09-14T10:00:00.000Z",
      "data": {
        "text": "Second note on this conversation"
      },
      "id": "8e4f2b3c-5d6f-7a8b-9c0d-1e2f3a4b5c6d",
      "type": "text_note"
    }
  ]
}