Send Chat Message
POST /api/v1/team-chat/chat/send
Send a user message and receive an agent response.
Parses @mentions to route to specific agents. Creates or reuses a thread. Persists both messages.
Args: body: ChatSendRequest with content and optional thread_id. user: The authenticated user context. session: Async database session.
Returns: ChatSendResponse with user_message and agent_message.
Raises: HTTPException: 409 if the tenant’s AI team is still being assembled (or failed to assemble). This is the batch fallback the chat client uses when SSE is unavailable, so it must report that state as itself rather than as a failed send.
Authorizations
Request Body required
Responses
200
Successful Response
Response after sending a chat message and receiving agent reply.
Attributes: thread_id: The thread this exchange belongs to. user_message: The persisted user message. agent_message: The persisted agent response.
object
Response schema for a persisted conversation message.
Attributes: id: Unique message identifier. thread_id: Owning thread identifier. sender_role: Agent role or “user”. sender_id: User ID if sender is human. content: Message content text. message_type: Type of message. artifacts: List of artifact IDs referenced. a2a_task_id: Link to A2A task if applicable. metadata: Extensible metadata. created_at: When the message was created.
object
Response schema for a persisted conversation message.
Attributes: id: Unique message identifier. thread_id: Owning thread identifier. sender_role: Agent role or “user”. sender_id: User ID if sender is human. content: Message content text. message_type: Type of message. artifacts: List of artifact IDs referenced. a2a_task_id: Link to A2A task if applicable. metadata: Extensible metadata. created_at: When the message was created.
object
422
Validation Error