Send Message

Send a message to a Thinklio agent on behalf of a user. The agent processes the message and returns a response.

Overview

The Channel API treats your integration as a channel adapter — the same model as Telegram or web chat, accessed programmatically. Your system sends messages in, responses come back. Sessions maintain conversational context across multiple messages.

Request

Messages are sent to a specific channel. The channel must be configured for API access in the Thinklio dashboard. Each message belongs to a session; if you omit session_id, a new session is created.

Response

Responses include the agent's reply text, metadata about the interaction, and session context for continuing the conversation.

Streaming

Set stream: true to receive the response as a Server-Sent Events stream. Each chunk contains a delta of the response text. The stream closes with a [DONE] event.

Governance

All messages are subject to the org's content policies and the agent's tool restrictions. If a message is blocked by policy, you will receive a 403 with code policy_violation. Budget limits are enforced per interaction; if the budget is exhausted, you will receive a 403 with code budget_exceeded.

Endpoints

POST/v1/channels/{channel_id}/messagesBeta

Send a message to an agent

Send a message to a Thinklio agent through a channel. If session_id is omitted, a new session is created automatically. Set stream to true for a Server-Sent Events response.

Parameters

NameTypeInRequiredDescription
channel_idstringpathYesThe unique identifier of the channel to send the message through.

Request Body

{
  "session_id": "ses_01hxyz... (optional)",
  "message": "string (required)",
  "stream": "boolean (optional, default false)",
  "metadata": "object (optional)"
}

Response

{
  "id": "msg_01hxyz...",
  "session_id": "ses_01hxyz...",
  "role": "assistant",
  "content": "string",
  "created_at": "2026-03-19T12:00:00Z",
  "tokens": 142,
  "model": "string"
}