Skip to content

Stream Conversation

GET
/v1/chat/conversations/{conversation_id}/stream
curl --request GET \
--url https://api.uavcrew.ai/v1/chat/conversations/example/stream \
--header 'Authorization: Bearer <token>'

SSE endpoint for real-time conversation updates.

Connect with EventSource: const es = new EventSource(‘/v1/chat/conversations/{id}/stream’); es.addEventListener(‘message’, (e) => { … }); es.addEventListener(‘typing’, (e) => { … });

Events: - message: New/complete message (authoritative, from DB) - typing: Participant is typing - participant_joined: New participant added - participant_left: Participant removed - read_receipt: Participant marked as read - stream_start: Agent started generating (create empty bubble) data: { participant_id } - stream_chunk: Token batch from agent (append to bubble) data: { participant_id, delta, chunk_index } - stream_error: Agent generation failed (clear partial bubble) data: { participant_id } - tool_call: Agent is invoking an MCP tool data: { participant_id, tool_name } - handoff_announce: Routing handed off to a different AI participant. data: { from_participant_id, to_participant_id, reason, trigger } trigger ∈ { “invite_agent”, “mention”, “default_route” } On a fresh-add invite turn, ordering is: participant_joined → handoff_announce → invitee’s stream_start → stream_chunk* → stream_end → message On an already-present target, participant_joined is skipped.

Streaming flow: stream_start → stream_chunk* → message (final) Clients should replace accumulated stream text with the authoritative message payload when the final ‘message’ event arrives.

conversation_id
required
Conversation Id
string

Successful Response

Media typeapplication/json

Example generated

example

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}