Skip to content

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

User sends a chat message, optionally targeting an agent.

Attributes: content: The message text (may contain @mentions). thread_id: Existing thread ID, or None to create new.

object
content
required
string
thread_id
Any of:
string

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
agent_message
required

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
a2a_task_id
required
Any of:
string
artifacts
required
Any of:
Array<string>
content
required
string
created_at
required
string format: date-time
id
required
string format: uuid
message_type
required
string
metadata
required
Any of:
object
key
additional properties
any
sender_id
required
Any of:
string
sender_role
required
string
thread_id
required
string format: uuid
thread_id
required
string format: uuid
user_message
required

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
a2a_task_id
required
Any of:
string
artifacts
required
Any of:
Array<string>
content
required
string
created_at
required
string format: date-time
id
required
string format: uuid
message_type
required
string
metadata
required
Any of:
object
key
additional properties
any
sender_id
required
Any of:
string
sender_role
required
string
thread_id
required
string format: uuid

422

Validation Error

object
detail
Array<object>
object
ctx
object
input
loc
required
Array
msg
required
string
type
required
string