Send chat message (streaming)
https://{kibana_url}
- POST /api/agent_builder/converse/async
- POST /s/{space_id}/api/agent_builder/converse/async
Refer to Spaces for more information.
Send a message to an agent and receive real-time streaming events. This asynchronous endpoint provides live updates as the agent processes your request, allowing you to see intermediate steps and progress. Use this for interactive experiences where you want to monitor the agent's thinking process.
The endpoint emits Server-Sent Events (SSE) with the following custom event types:
conversation_id_set
Sets the conversation ID.
Schema:
{
"conversation_id": "uuid"
}
conversation_created
Fires when a new conversation is persisted and assigned an ID.
Schema:
{
"conversation_id": "uuid",
"title": "conversation title"
}
conversation_updated
Fires when a conversation is updated.
Schema:
{
"conversation_id": "uuid",
"title": "updated conversation title"
}
reasoning
Handles reasoning-related data.
Schema:
{
"reasoning": "plain text reasoning content",
"transient": false
}
tool_call
Triggers when a tool is invoked.
Schema:
{
"tool_call_id": "uuid",
"tool_id": "tool_name",
"params": {}
}
tool_progress
Reports progress of a running tool.
Schema:
{
"tool_call_id": "uuid",
"message": "progress message"
}
tool_result
Returns results from a completed tool call.
Schema:
{
"tool_call_id": "uuid",
"tool_id": "tool_name",
"results": []
}
Note: results is an array of ToolResult objects.
message_chunk
Streams partial text chunks.
Schema:
{
"message_id": "uuid",
"text_chunk": "partial text"
}
message_complete
Indicates message stream is finished.
Schema:
{
"message_id": "uuid",
"message_content": "full text content of the message"
}
thinking_complete
Marks the end of the thinking/reasoning phase.
Schema:
{
"time_to_first_token": 0
}
Note: time_to_first_token is in milliseconds.
round_complete
Marks end of one conversation round.
Schema:
{
"round": {}
}
Note: round contains the full round json object.
A typical conversation round emits events in this sequence:
reasoning(potentially multiple, some transient)tool_call(if tools are used)tool_progress(zero or more progress updates)tool_result(when tool completes)thinking_completemessage_chunk(multiple, as text streams)message_completeround_complete
[Required authorization] Route required privileges: agentBuilder:read.
Request
-
_execution_mode -
define how to execute the agent (local execution or via task_manager)
-
Values:
localtask_manager -
access_controlobject -
Optional conversation access control. Defaults to private.
-
access_moderequired -
Access mode to apply when creating a new conversation. Set to public to make the conversation visible to other users who can access the underlying agent. This setting is ignored when continuing an existing conversation.
-
Values:
privatepublic -
actiondeprecated -
Deprecated and ignored. The "regenerate" action has been removed; the field is still accepted for backward compatibility.
-
Values:
regenerate -
agent_idstring · default: elastic-ai-agent -
The ID of the agent to chat with. Defaults to the default Elastic AI agent.
-
attachmentsobject -
Optional attachments to send with the message.
-
datamap string to object -
Payload of the attachment. Required unless
originis provided (content is resolved once at send time). -
descriptionstring · max: 1024 -
Human-readable label for the attachment.
-
group_idstring · max: 256 -
Stable identifier for the logical group this attachment belongs to. Attachments sharing the same group_id were submitted together as a single logical entity.
-
When true, the attachment will not be displayed in the UI.
-
idstring -
Optional id for the attachment.
-
originstring -
Origin string (for example, saved object ID) for by-reference attachments. When provided without
data, the content is resolved once using the attachment type’sresolvehook. -
typestringrequired -
Type of the attachment.
-
browser_api_toolsobject -
Optional browser API tools to be registered as LLM tools with browser.* namespace. These tools execute on the client side.
-
descriptionstringrequired -
Description of what the browser API tool does.
-
idstringrequired -
Unique identifier for the browser API tool.
-
schemaobjectrequired -
JSON Schema defining the tool parameters (JsonSchema7Type).
-
configuration_overridesobject -
Runtime configuration overrides. These override the stored agent configuration for this execution only.
-
enable_elastic_capabilitiesboolean -
Whether to enable built-in Elastic skills for this execution.
-
instructionsstring -
Custom instructions for the agent.
-
skill_idsstring · max: 100 -
Skill IDs to enable for this execution, replacing the stored skill list. Note: only fully restricts the available skill set when enable_elastic_capabilities is also set to false.
-
connector_idstringnullable -
Optional connector ID for the agent to use for model routing. Mutually exclusive with
inference_id; omit or use only one. -
conversation_idstring · max: 256 -
Optional existing conversation ID to continue a previous conversation.
-
execution_idstring -
Optional client-generated execution ID. Provide it to address this execution later (for example, to abort it). Must be unique; defaults to a server-generated ID.
-
inference_idstringnullable -
Optional inference endpoint ID for model routing (public alias for the same internal identifier as
connector_id). Mutually exclusive withconnector_id. -
inputstring · max: 100000 -
The user input message to send to the agent.
-
project_routingstring · max: 2048 -
Cross-project search routing expression resolved from the header project picker, applied to the run's searches. Serverless (CPS) only; ignored elsewhere.
-
promptsmap string to anyOf -
Use this field to respond to a
confirmation,authorization, orask_user_questionprompt. Send anallowboolean to answer aconfirmationprompt, anauthorizedboolean to answer anauthorizationprompt, or ananswersarray (one entry per question) to answer anask_user_questionprompt. -
read_onlyboolean -
When true, the created conversation is presented as read-only in the UI: its history is shown but no message input is offered. This carries no authorization meaning — the conversation can still be continued through the API. This setting is ignored when continuing an existing conversation.
-
reasoning_level -
Reasoning effort level for the LLM. One of: none, minimal, low, medium, high, xhigh. Support depends on the underlying model and provider.
-
Values:
noneminimallowmediumhighxhigh
Response
Indicates a successful response