Submit one user turn to an existing chat session.
Drives the agent through one LLM round-trip and returns only the new assistant turn(s)
(tool turns first, final reply last). The full transcript stays on the server. Supply
idempotency_key to make the submit safely retryable — a repeated request with the
same key (even after the original response finalised the session) replays the previous
assistant turn without re-running the LLM.
Idempotency
Network retries (especially over SMS) can re-submit the same logical turn twice. Always send anidempotency_key (any client-chosen unique value, e.g. UUID or sessionId+turnNumber) so the
server can dedupe. The retry returns the prior assistant response — including when the original
turn finalised the session.Path Parameters
Body
Request body for POST /api/v1/chats/{id}/messages — submits a single user turn to
the named session. The response contains only the assistant turn(s) produced this round,
not the full transcript (the transcript lives on the server and is retrievable via
GET /api/v1/chats/{id}).
User-supplied message content for this turn.
Optional idempotency key. When supplied, a retried submit with the same key returns the previous assistant response without re-running the LLM. Bound to the session, not global. Capped at 128 characters.
Turn-level additional_data overrides merged on top of the session's persisted
bag. Reserved keys (DashaAI.BlackBox.AgentAPI.TextChat.ChatReservedKeys) are dropped before merge.
Response
Submit succeeded. Inspect is_final to decide whether to keep submitting.
Response to POST /api/v1/chats/{id}/messages. Returns only the new assistant turn(s)
produced this round (per the plan's "returns only the new assistant turn(s)" requirement),
plus the post-turn session status so clients don't need a follow-up GET to learn whether
the agent finished the conversation.
New messages produced this turn. Ordered: assistant tool-turns first (each bundling its tool calls with their executed responses), final plain-text assistant reply last.
True when the agent signalled end-of-conversation this turn (e.g. invoked the
finishTheConversation built-in tool) and the session has been finalised. After
this point, further submits return 409 Conflict.
Post-turn session status: active while accepting new turns, final after
finalisation (matches the state filter on the list endpoint).