Finalize the visible text of stored messages

Record what a human actually saw for messages this conversation already stores. A chat client can only compute an assistant message's final visible text after the stream closes and its own parsers, postprocessors, and plugins have run; this is the channel for sending that back, so the transcript reopens showing what the visitor read rather than the model-channel payload. It is projection-only: it can fill or replace `displayContent` and nothing else, never creating a message or touching model content, role, ordering, timestamps, count, ownership, or title. The batch applies all-or-nothing, and the write is guarded by a compare-and-swap on `conversationRevision`, so it can never overwrite a turn the chat path persisted concurrently. Replaying an identical projection is a no-op that performs no write and returns the same `conversationRevision`. A genuinely changed projection advances the revision and refreshes the list `preview`, but deliberately does NOT change `updatedAt` — a closing tab must not reorder the visitor's history. Authorization is exact: the live session must be bound to this conversation, on top of the visitor secret. Small and bounded on purpose, so a client can send it with `keepalive: true` on page exit.

Path parameters

idstringRequired

Conversation id — must be this session’s own.

Headers

x-visitor-tokenstringRequired

The browser’s anonymous visitor secret (cvt_…) returned by /client/init. It is what scopes the request to one visitor’s own conversations, so a request without it is refused. Sent as a header so it never lands in access logs or Referer.

x-identity-proofstringOptional1-8192 characters

Optional fresh hosted end-user identity proof. When admitted and already bound to the presented visitor, expands the request from this exact browser to sibling visitors for the same verified person. Without it, even a previously bound visitor remains exact-browser scoped.

Query parameters

sessionIdstringRequired

Client session id from /client/init.

Request

This endpoint expects an object.
messageslist of objectsRequired

Projections to finalize, applied atomically. Total displayContent across the batch is capped at 49152 characters so the request fits the browser keepalive budget.

Response

Projections finalized (or already current).

conversationRevisionstring
The conversation's change token after this call. Unchanged when the projections were already current, so a client can replay a lost finalization safely. Compare for equality only.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error