Send a message to an agent and get its reply
POST /Platform/chat/send
Send a message to an agent and get its reply.
Runs one full agent turn, tools included, and returns when the turn
is finished. Identity comes from normal org authentication; identity
claims in the request are never accepted. To continue, pass the
returned conversation_id back on the next call. branch
selects the configuration that drives the turn and must match the
conversation's branch when continuing one. mock applies to one
call only, so send it on every turn of a mocked conversation.
Side effects: a real turn (no mock) runs the agent's tools for
real, which can reach people and systems outside Hilus (messages,
bookings, writes), and stores the conversation. Each stored
assistant message carries metadata.llm_request_id, the id the
lab uses to diagnose or replay that reply.
Body parameters
agent_id: str. Agent ID (must belong to your organization).message: optional str. User message text.conversation_id: optional str. Continue an existing conversation (must belong to this agent and the requested branch; mismatches are rejected).attachments: optional List[Any]. List of{type, data(base64), filename}dicts.branch: optional str. Branch whose entity state drives the turn (default: your configured branch).mock: optional bool. When True, tools with amock_responsereturn it and all irreversible tools are short-circuited — real writes never happen. Read-only tools still hit the real backend. A mocked turn marks the conversationsimulated.store: optional bool. Persist the conversation. Defaults tonot mock: a real turn is always stored; a mocked turn is EPHEMERAL by default (runs entirely in memory, nothing is written,branchonly selects the state to read andmainis allowed;conversation_idisnullso it cannot be continued).mock=true, store=truepersists the mocked conversation and follows the simulation branch rule: it never lands onmain(an omittedbranchbecomeslab/sim-<agent_id>;branch='main'is refused). Continuing a mocked conversation (conversation_id) requiresstore=true.store=falsewithoutmockis refused.payload: optional UiSubmission. A page's answer (ui_idof a page the agent showed in this conversation, and itsvaluesby control id). It is validated against that page and the message text becomes the summary the agent reads, somessageis then ignored.
Returns
ChatResponse
conversation_id: optional str or null. Conversation to continue by id; null for an ephemeral turn.response: optional str or null. The assistant's reply text.messages: optional List[MessageData] or null. Messages this turn added after yours: tool calls, their results and the replies.
Example request
curl -X POST "https://api.hilus.ai/Platform/chat/send" \
-H "Authorization: Bearer $HILUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'