Skip to main content
Send a message and get the agent’s reply. The agent is identified by your access token, and the conversation thread is created automatically on the first message — there is no separate “create thread” call. Three ways to receive the reply:

Send a message

cURL

POST /messaging/v1/messages

Request body

string
required
The message to send to the agent.
string
required
Your identifier for the end user. New threads are attributed to this user.
string
Continue an existing thread. Omit it to start a new one — the created thread’s id is returned in the response.
string
Signed image URL for vision input.
object
Per-message values for the agent’s configured context variables.

Response

string
The thread the message landed on — newly created when the request omitted thread_id. Pass it back to continue the conversation.
object
The agent’s reply: id (the interaction id — used for reruns and traces), text, cards, followup_suggestions, and token counts.

Cards

When the agent surfaces entities — products, bookings, search results — the reply carries them as cards. Each card is the same entity in two self-contained representations, so you pick the one that fits your stack:
string
The card as a ready-to-render JSX string — drop it straight into a React UI.
object
The card as structured JSON — build your own UI in any framework (Vue, Angular, mobile, …). entity is a flat key–value map of the card’s fields; sub_entities holds nested groups such as product variants, each with a name and a list of items in the same key–value shape.
Whether the agent flagged this card as its top recommendation.
number
The card’s position in the reply.
Example card
The keys inside entity and sub_entities[].items are defined by your agent’s card templates — treat them as data, not as a fixed schema.

Stream the reply (SSE)

POST /messaging/v1/messages/stream takes the same request body and streams the reply token-by-token over server-sent events.
cURL
Events are JSON objects discriminated on type: The stream ends with a standalone data: [DONE] terminator.
Example stream

Resuming a dropped stream

event and message frames carry a monotonic seq. If the connection drops, reconnect with the standard Last-Event-ID header set to the last seq you saw — missed events replay without running the turn again:

Rerun an interaction

Regenerate a previous interaction — with the original or edited text — against the agent’s live version. The rerun happens on a new thread branched from the original, so the source conversation is untouched.
cURL

POST /messaging/v1/threads/{threadId}/rerun

Request body

string
required
The interaction to regenerate — the message.id from a previous response.
string
required
The message to replay: the original text, or an edited variant.
string
End user to attribute the rerun to. Omitted, the thread’s original user is kept.
string
Signed image URL on the replayed message.
string
Pin the rerun to a specific agent version instead of the live one.
string
Pin to a specific version tag (e.g. v3.2).

Response

Same shape as send: thread_id is the new thread the rerun created, and message is the regenerated reply.