GET /api/sessions/:id/messages
Get paginated messages for a session. Authentication: RequiredPath Parameters
Session ID
Query Parameters
Number of messages to return (1-200)
Return messages before this sequence number (for pagination)
Response
Array of messages in reverse chronological order
Whether there are more messages available
Example
Pagination
To fetch older messages, use thebeforeSeq parameter with the lowest seq from the current page:
Errors
403- Access denied (session belongs to different namespace)404- Session not found503- Hub not connected
POST /api/sessions/:id/messages
Send a message to an active session. Authentication: RequiredPath Parameters
Session ID
Request Body
Message text (required if no attachments)
Client-generated ID for optimistic updates
Array of attachment metadata objects
Response
Example: Text Message
Example: Message with Attachment
Errors
400- Invalid body or missing text/attachments403- Access denied404- Session not found409- Session not active503- Hub not connected
Message Flow
- Upload file (if needed):
POST /api/sessions/:id/upload - Send message:
POST /api/sessions/:id/messageswith attachment metadata - Receive response: Agent processes and responds via WebSocket/SSE