Documentation
Conversational Triage API
Build your solution
Handoff

Handoff

A handoff is the API telling your application that control should pass back to it: the user asked for a human, declined AI triage, or wants something triage cannot do. The conversation does not end — you decide what happens next.

Handoff detection is opt-in per conversation through handoff_policies in settings. An empty list, which is the default, disables it entirely.

Enabling detectors

JSON
{
  "settings": {
    "handoff_policies": ["stop_intent_handoff", "pre_triage_handoff"]
  }
}
PolicyDetectsActive
stop_intent_handoffUser requests to leave triage — asking for a human, declining AI triage, and similar.Throughout the conversation.
pre_triage_handoffNon-triage workflow requests.Only before initial clinical findings have been collected.

Values must be known policy members; anything else is rejected as a validation error.

Receiving a handoff

A handoff record surfaces in two places, depending on transport:

  • Blocking turns — the handoff field on the Turn, null when none was recorded.
  • Streaming and WebSocket — a conversation.handoff.requested event, emitted only when at least one detector is enabled.
JSON
{
  "type": "conversation.handoff.requested",
  "handoff": {
    "reason": "stop_intent_detected",
    "user_request": "Can I talk to a real doctor?"
  }
}
FieldTypeDescription
reasonHandoffReasonWhy control should be handed off.
user_requeststringThe request that triggered the handoff, verbatim or paraphrased.
reasonMeaning
stop_intent_detectedThe user wants to stop the current conversation — asking for a human, declining AI triage.
non_triage_intent_detectedThe user wants a different, non-triage workflow, before clinical findings were collected.

What your application does

The API records the handoff and keeps the conversation usable; routing is yours. Typical responses:

  • transfer to a live agent, passing user_request along as context;
  • switch the user into a different workflow — appointment booking, prescription renewal — when the reason is non_triage_intent_detected;
  • offer a choice between continuing triage and leaving.

You can also read the current assessment at the moment of handoff and hand the partial triage state to whoever takes over.

ℹ️

A handoff and a termination are mutually exclusive: a turn that terminates the conversation never emits conversation.handoff.requested, and terminating clears any handoff recorded earlier. See Lifecycle and terminal states.

Was this page helpful?