Persist Chat
Persist a completed chat turn (after the client has streamed the assistant reply) to the conversation history.
Authentication: Required — Bearer token. No AI connector required.
Request body:
conversation_id— Conversation/client idbase_messages— Prior{ role, content }turns to persistassistant_content— The assistant’s reply (sanitized for end users; any embedded internal payload is stripped)intent(optional) — Stored in internal metadataaction_context(optional, default{})safe_intent(optional) — When true the system prompt is excluded from saved historytotal_tokens(optional) — When > 0, records intent token usage
Response:
data.status—okdata.assistant_content— The sanitized assistant text that was stored
Side effects: Writes ChatHistory; records token usage when total_tokens > 0.
Errors:
422—{ error: { message } }on a raised error
Authentication
AuthorizationBearer
Bearer authentication of the form Bearer <token>, where token is your auth token.
Request
This endpoint expects an object.
conversation_id
base_messages
assistant_content
intent
action_context
safe_intent
total_tokens
Response
OK