Send Agent App Message
Send a user message to an Agent app. Agent apps use streaming responses only and may return message chunks, agent reasoning/tool events, generated files, and a final message_end event.
Authorizations
API Key authentication. For all API requests, include your API Key in the Authorization HTTP Header, prefixed with Bearer. Example: Authorization: Bearer {API_KEY}. Strongly recommend storing your API Key on the server-side, not shared or stored on the client-side, to avoid possible API-Key leakage that can lead to serious consequences.
Body
Request body to send an Agent app message.
Request body for sending a message to an Agent app.
User message or task for the Agent app.
Values for variables configured in the Agent Soul. Call the Get Agent App Parameters API to discover expected variable names and input controls.
End-user identifier, unique within this Agent app. Conversations, messages, and uploaded files are scoped to the same user value.
Agent apps support streaming mode only. Set this field to streaming or omit it.
streaming Conversation ID to continue. Omit this field or pass an empty string to start a new conversation, then reuse the returned conversation_id in later requests.
Files for multimodal Agent input. To attach a local file, upload it with the Upload File API first, then pass the returned file id as upload_file_id with transfer_method: local_file.
Auto-generate conversation title. If false, use the Rename Conversation API with auto_generate: true for async title generation.
Response
Successful streaming response. Agent apps return text/event-stream Server-Sent Events. Blocking JSON responses are not supported for Agent apps.
A stream of Server-Sent Events (SSE).
Parsing: Each event is a line prefixed with data: followed by a JSON object, terminated by \n\n. Strip the data: prefix before parsing the JSON, then read the event field to determine the event type. Ignore ping events, which arrive as event: ping lines (no data: payload) every 10 seconds to keep the connection alive.
Stream lifecycle: The reply streams as message events (Chatbot apps), or as agent_thought and agent_message events (Agent apps), and ends with message_end. When text-to-speech auto-play is enabled, tts_message events interleave and tts_message_end becomes the final event.
Events: Apart from ping, every event includes conversation_id, message_id, and created_at (Unix epoch seconds); all but error also include task_id.
Reply events
| Event | App | Fires on | Key fields |
|---|---|---|---|
message | Chatbot | each answer chunk (concatenate in order) | answer |
agent_message | Agent | each answer chunk (concatenate in order) | answer |
agent_thought | Agent | each reasoning or tool-call step | position, thought, tool, tool_input (JSON), observation, message_files |
message_replace | Chatbot, Agent | output moderation replaces the answer so far | answer |
message_file | Chatbot, Agent | the assistant returns a file | type, belongs_to, url |
message_end | Chatbot, Agent | the answer is complete | metadata (usage, retriever_resources) |
tts_message, tts_message_end | Chatbot, Agent | audio chunk / end, when TTS auto-play is on | audio |
Transport events
| Event | App | Fires on | Key fields |
|---|---|---|---|
error | Chatbot, Agent | a failure ends the stream; HTTP stays 200 | status (e.g. 400), code (e.g. invalid_param), message |
ping | Chatbot, Agent | keep-alive every 10 seconds | none |