Transition a conversation's AI mode
Change a conversation’s ai_mode between ai, human, and closed.
Operators use this to take over from the AI dispatcher (ai → human),
hand back to AI (human → ai), or terminate (* → closed).
closed is terminal — the next inbound message starts a new conversation.
Idempotent: PATCHing the same ai_mode returns the current state with
changed: false and does NOT publish a conversation.mode_changed event.
Audit row written to conversation_mode_history; SSE subscribers (the
dashboard) receive the transition in near-real-time on the
/v1/conversations/{id}/stream channel.
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Path parameters
Request
Target mode for this conversation. ai — the AI dispatcher
handles inbound; human — operator has taken over; closed
— conversation terminated, next inbound starts a new one.
Operator-provided reason; recorded in the audit log.
Response
Mode transition applied (or no-op for same-mode PATCH)
The mode BEFORE this transition. Equals to_mode on no-op PATCH.
false for same-mode PATCH (idempotent no-op, no audit row written).
Identity of the caller that initiated the transition
(e.g. api:key_xxx, ai_pipeline). Recorded in the audit
log even when reason is empty.