chat-ai
chat_messages

Send Message

Send a message to a conversation and stream the agent's response via SSE.

This endpoint:

  1. Validates ownership (user must own the conversation)
  2. Persists the user message
  3. Updates conversation metadata (title, preview, message_count)
  4. Creates langgraph_thread_id if missing
  5. Streams agent response via SSE with events: token, tool_start, tool_end, done, error
  6. Persists the assistant message after completion

SSE Events:

  • token: {"delta": "...", "conversation_id": "...", "client_message_id": "..."}
  • tool_start: {"tool_name": "...", "tool_call_id": "..."}
  • tool_end: {"tool_call_id": "...", "success": true/false}
  • done: {"conversation_id": "...", "message_id": "..."}
  • error: {"message": "..."}
  • heartbeat: {}
post/api/v1/chat-ai/conversations/{conversation_id}/message

Path parameters

conversation_idstring uuid required

Request body

contentstring required
client_message_idstring nullable

Optional client-side message ID for correlation

approve_writesboolean
skill_slugstring nullable

Response

Successful Response

{"stackTrail":"paths:/api/v1/chat-ai/conversations/{conversation_id}/message:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}

Changes

Changed in 2 of the 4 revisions of this API.5

    • added the optional property // to the response with the status

      response-optional-property-added

    • added the optional property // to the response with the status

      response-optional-property-added

    This revision also has 8 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new optional request property //

      new-optional-request-property

    • added the new optional request property //

      new-optional-request-property

    • added the new optional request property //

      new-optional-request-property