Send a message
cURL
POST /messaging/v1/messages
Request body
The message to send to the agent.
Your identifier for the end user. New threads are attributed to this user.
Continue an existing thread. Omit it to start a new one — the created
thread’s id is returned in the response.
Signed image URL for vision input.
Per-message values for the agent’s configured context variables.
Response
The thread the message landed on — newly created when the request omitted
thread_id. Pass it back to continue the conversation.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 ascards. Each card is the same entity in two
self-contained representations, so you pick the one that fits your stack:
The card as a ready-to-render JSX string — drop it straight into a React UI.
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.
The card’s position in the reply.
Example card
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
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
The interaction to regenerate — the
message.id from a previous response.The message to replay: the original text, or an edited variant.
End user to attribute the rerun to. Omitted, the thread’s original user is
kept.
Signed image URL on the replayed message.
Pin the rerun to a specific agent version instead of the live one.
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.