---
title: "Send chat message (streaming)"
method: POST
path: "/api/agent_builder/converse/async"
tags: ["agent builder"]
---

# Send chat message (streaming)

`POST /api/agent_builder/converse/async`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/agent_builder/converse/async</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-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.

## Event types

The endpoint emits Server-Sent Events (SSE) with the following custom event types:

`conversation_id_set`

Sets the conversation ID.

Schema:
```json
{
  "conversation_id": "uuid"
}
```

---

`conversation_created`

Fires when a new conversation is persisted and assigned an ID.

Schema:
```json
{
  "conversation_id": "uuid",
  "title": "conversation title"
}
```

---

`conversation_updated`

Fires when a conversation is updated.

Schema:
```json
{
  "conversation_id": "uuid",
  "title": "updated conversation title"
}
```

---

`reasoning`

Handles reasoning-related data.

Schema:
```json
{
  "reasoning": "plain text reasoning content",
  "transient": false
}
```

---

`tool_call`

Triggers when a tool is invoked.

Schema:
```json
{
  "tool_call_id": "uuid",
  "tool_id": "tool_name",
  "params": {}
}
```

---

`tool_progress`

Reports progress of a running tool.

Schema:
```json
{
  "tool_call_id": "uuid",
  "message": "progress message"
}
```

---

`tool_result`

Returns results from a completed tool call.

Schema:
```json
{
  "tool_call_id": "uuid",
  "tool_id": "tool_name",
  "results": []
}
```

**Note:** `results` is an array of `ToolResult` objects.

---

`message_chunk`

Streams partial text chunks.

Schema:
```json
{
  "message_id": "uuid",
  "text_chunk": "partial text"
}
```

---

`message_complete`

Indicates message stream is finished.

Schema:
```json
{
  "message_id": "uuid",
  "message_content": "full text content of the message"
}
```

---

`thinking_complete`

Marks the end of the thinking/reasoning phase.

Schema:
```json
{
  "time_to_first_token": 0
}
```

**Note:** `time_to_first_token` is in milliseconds.

---

`round_complete`

Marks end of one conversation round.

Schema:
```json
{
  "round": {}
}
```

**Note:** `round` contains the full round json object.

---

## Event flow

A typical conversation round emits events in this sequence:

1. `reasoning` (potentially multiple, some transient)
2. `tool_call` (if tools are used)
3. `tool_progress` (zero or more progress updates)
4. `tool_result` (when tool completes)
5. `thinking_complete`
6. `message_chunk` (multiple, as text streams)
7. `message_complete`
8. `round_complete`

<br/><br/>[Required authorization] Route required privileges: agentBuilder:read.

## Headers

- `kbn-xsrf` string, required

## Request body

- object
  - `_execution_mode` 'local' | 'task_manager' — define how to execute the agent (local execution or via task_manager)
  - `access_control` object — Optional conversation access control. Defaults to private.
    - `access_mode` 'private' | 'public', required — 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.
  - `action` 'regenerate' — The action to perform. "regenerate" re-executes the last round with the original input. Requires conversation_id.
  - `agent_id` string — The ID of the agent to chat with. Defaults to the default Elastic AI agent.
  - `attachments` object[] — Optional attachments to send with the message.
    - `data` object — Payload of the attachment. Required unless `origin` is provided (content is resolved once at send time).
    - `description` string — Human-readable label for the attachment.
    - `group_id` string — Stable identifier for the logical group this attachment belongs to. Attachments sharing the same group_id were submitted together as a single logical entity.
    - `hidden` boolean — When true, the attachment will not be displayed in the UI.
    - `id` string — Optional id for the attachment.
    - `origin` string — Origin string (for example, saved object ID) for by-reference attachments. When provided without `data`, the content is resolved once using the attachment type’s `resolve` hook.
    - `type` string, required — Type of the attachment.
  - `browser_api_tools` object[] — Optional browser API tools to be registered as LLM tools with browser.* namespace. These tools execute on the client side.
    - `description` string, required — Description of what the browser API tool does.
    - `id` string, required — Unique identifier for the browser API tool.
    - `schema` unknown, required
  - `capabilities` object — Controls agent capabilities during conversation. Currently supports visualization rendering for tabular tool results.
    - `visualizations` boolean — When true, allows the agent to render tabular data from tool results as interactive visualizations using custom XML elements in responses.
  - `configuration_overrides` object — Runtime configuration overrides. These override the stored agent configuration for this execution only.
    - `enable_elastic_capabilities` boolean — Whether to enable built-in Elastic skills for this execution.
    - `instructions` string — Custom instructions for the agent.
    - `skill_ids` string[] — 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.
    - `tools` object[] — Tool selection to enable for this execution.
      - `tool_ids` string[], required
  - `connector_id` string, nullable — Optional connector ID for the agent to use for model routing. Mutually exclusive with `inference_id`; omit or use only one.
  - `conversation_id` string — Optional existing conversation ID to continue a previous conversation.
  - `execution_id` string — 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_id` string, nullable — Optional inference endpoint ID for model routing (public alias for the same internal identifier as `connector_id`). Mutually exclusive with `connector_id`.
  - `input` string — The user input message to send to the agent.
  - `prompts` object — Use this field to respond to a `confirmation`, `authorization`, or `ask_user_question` prompt. Send an `allow` boolean to answer a `confirmation` prompt, an `authorized` boolean to answer an `authorization` prompt, or an `answers` array (one entry per question) to answer an `ask_user_question` prompt.

## Response `200`

Indicates a successful response

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/versions/531c9e2a7d23/schema)
