v1

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-304917042.1 MB
runtime v2

End a v2 conversation through the close pipeline (admin)

conv_* replacement for the retired POST /v1/runtime/end_session.

The legacy endpoint drove Runtime.end_session(triggered_by="admin"), which under PersistStrategy.PER_TURN (every HTTP channel) reduced to the same unified close pipeline SessionService.close_session now owns: flip to CLOSED, stamp the meta close-out columns + retention, and enqueue the post-session finalize chain (PII scrub → summarize + memory-sync). So this is a straight call to close_session — there is no separate v2 Runtime to construct.

The conversation id is taken from the PATH and org-scoped (cross-org / missing → 404 inside close_sessionget_session_for_org); the legacy body's session_id / end_user_id / agent_id / channel fields are accepted for wire-compat but ignored. reason defaults to AGENT_INITIATED (the same RESOLVED outcome category the legacy admin close used when no explicit reason was supplied).

Response mirrors the legacy TurnResult shape (messages=[], status="ended") — the admin UI ignores the body and only awaits the 200.

post/v1/v2/conversations/{conversation_id}/end_session

Path parameters

conversation_idstring uuid required

Request body

end_user_idstring uuid required
session_idstring uuid required
agent_idstring uuid nullable
channelstring
reasonstring nullable

Response

Successful Response

session_idstring uuid nullable
status'idle' | 'running_turn' | 'end_requested' | 'end_processing' | 'ended' | 'error' required

In-memory lifecycle status of a Runtime instance.

Distinct from ConversationSession.status (DB column). The DB status is the durable end-state of a session row; this enum is the per-instance live signal that channel runtimes consult after each run_turn to decide whether to call end_session.

handoffobject nullable
session_statusstring nullable
errorstring nullable
model_usedstring nullable
token_countinteger nullable
latency_msinteger nullable