> For the complete documentation index, see [llms.txt](https://docs.concurrence.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.concurrence.com/api-reference/readme/platform/conversations.md).

# Conversations

## Create or start a conversation (web inbound, or outbound on a channel)

> Create a web conversation, or start one on sms or imessage with the agent's first message.\
> \
> Where the workspace's start check is on, a service that takes no text start (readiness \`\`starts\`\`) is refused\
> with 422 before a conversation is created or an opener is sent: \`\`detail\`\` is \`\`{"code", "message", "fields"}\`\`\
> and the code is \`\`start\_kind\_not\_taken\`\`, or \`\`start\_family\_unknown\`\` when the family the service runs cannot be\
> read.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"CreateConversationRequest":{"properties":{"service_id":{"type":"string","format":"uuid","title":"Service Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"channel":{"$ref":"#/components/schemas/ChannelKind","default":"web"},"recipient":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}],"description":"Destination address for an outbound conversation (E.164 for sms/imessage). Required for non-web."},"use_case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id","description":"The use case the outbound conversation is sent through. Required for non-web; the sender (FROM) is resolved from it, never caller-supplied. Must be owned by this workspace."},"instruction":{"anyOf":[{"$ref":"#/components/schemas/BackgroundString"},{"type":"null"}],"description":"Optional context steering what the agent opens with on an outbound conversation."},"force_new":{"type":"boolean","title":"Force New","description":"Outbound thread-keyed channels (sms/imessage) only: close any existing ACTIVE conversation on the computed provider thread (recipient + use case) before dispatching, so the opener materializes a brand-new conversation instead of continuing the old thread. Rejected with 422 on channel=web — every web create already starts a new conversation, so force_new is meaningless there.","default":false},"context":{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"number"},{"type":"string","maxLength":8192}]},"type":"object","maxProperties":50,"title":"Context","description":"Start-time context (key-value pairs) for the conversation. Validated against the owning service's accepted_context schema: unknown keys, missing required keys, or type mismatches are rejected with 422. Tools may bind individual keys to their parameters."},"tags":{"items":{"$ref":"#/components/schemas/ConversationTag"},"type":"array","maxItems":20,"title":"Tags","description":"Labels to set on the conversation, at most 20, each a key and an optional value. Change them later with PATCH /v1/{workspace_id}/conversations/{conversation_id}/tags."},"source":{"anyOf":[{"type":"string","enum":["playground","test"]},{"type":"null"}],"title":"Source","description":"Marks the conversation as test traffic. Set ``playground`` when the developer console Playground starts the conversation: a Playground session writes only to conversations a Playground session or test credential started, never a real one. Set ``test`` from your own test harness: the conversation is stored with source ``test``. Every turn on a ``playground`` or ``test`` conversation runs as a test turn, as for a conversation started with a test key, whatever its ``entity_id``. It stays out of analytics, production evaluations, EHR sync and billing, and its tools simulate unless a Playground conversation explicitly requests ``tool_execution=live``. Live tools retain test classification but can change connected systems. ``test`` needs ``Workspace.update`` (admin or owner) unless the key is already a test key. Web only (422 on another channel); an external user gets 403."},"tool_execution":{"anyOf":[{"type":"string","const":"live"},{"type":"null"}],"title":"Tool Execution","description":"``live`` runs this Playground conversation's tools for real: its integration calls reach the connected systems and can change them. Null (default) keeps Playground and test tools simulated; ordinary production conversations retain their existing tool behavior. Only with ``source`` ``playground`` on the web channel (422 otherwise), only for a workspace admin or owner on a production credential (403 otherwise), and fixed for the conversation's life. The conversation retains test classification and is excluded from automatic EHR sync and billing."}},"type":"object","required":["service_id"],"title":"CreateConversationRequest"},"ChannelKind":{"type":"string","enum":["voice","sms","whatsapp","email","web","imessage"],"title":"ChannelKind","description":"HSM execution channel type.\n\nDetermines how the HSM engine communicates with end users.\nEach kind maps to one or more providers."},"PhoneE164":{"type":"string","maxLength":16,"minLength":2},"BackgroundString":{"type":"string","maxLength":10000},"ConversationTag":{"properties":{"key":{"type":"string","maxLength":64,"minLength":1,"title":"Key"},"value":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Value","description":"Null for a bare label."}},"type":"object","required":["key"],"title":"ConversationTag"},"ConversationDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"channel_kind":{"$ref":"#/components/schemas/ChannelKind"},"status":{"type":"string","enum":["active","closed","completed","in-progress","failed","paused"],"title":"Status"},"lifecycle":{"type":"string","enum":["active","dormant","closed"],"title":"Lifecycle"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"turn_count":{"type":"integer","title":"Turn Count","default":0},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"has_recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Recording"},"completion_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completion Reason"},"escalation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Status"},"final_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final State"},"tags":{"items":{"$ref":"#/components/schemas/ConversationTag"},"type":"array","title":"Tags","description":"The labels an app set on the conversation, by key. Empty when it has none."},"tool_execution":{"anyOf":[{"type":"string","const":"live"},{"type":"null"}],"title":"Tool Execution","description":"Stored explicit Playground tool policy. ``live`` runs its tools for real. Null means no explicit live policy: Playground and test conversations simulate, while ordinary production conversations retain their existing tool behavior."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"What started the conversation. A text conversation reads ``test`` when a test key or the ``test`` marker started it, ``playground`` when the developer console Playground did, and null otherwise. A call reads the source its call intelligence recorded (``real``, ``simulation`` or ``playground``), and null when it recorded none, as a test call does."},"turns":{"items":{"$ref":"#/components/schemas/ConversationTurn"},"type":"array","title":"Turns","default":[]},"truncated":{"type":"boolean","title":"Truncated","description":"True when the conversation recorded more entries than one read takes (10,000), so the turns stop before the end of the conversation.","default":false},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"voice":{"anyOf":[{"$ref":"#/components/schemas/VoiceDetail"},{"type":"null"}]},"session_provider":{"anyOf":[{"type":"string","enum":["concurrence","gpt_realtime","eleven_realtime","gpt_live","grok_voice","phonic"]},{"type":"null"}],"title":"Session Provider","description":"The voice runtime that handled the conversation, as its session recorded it at start: `concurrence` (also every text conversation) or `gpt_realtime`. Null when the conversation was recorded before the platform kept it, before a text conversation's first session starts, and for an external user."},"manifest":{"anyOf":[{"$ref":"#/components/schemas/RunManifest"},{"type":"null"}],"description":"What the conversation executed with, as its first session recorded it: the agent and context graph versions, the version set and config fingerprint, the digest of the whole service config it received, the build, the models and how they sampled, the prompt templates, the voice's language, the program flags and how the region decides. A call that changed its STT or its voice's language mid-call reads as it last stood. Null when the conversation was recorded before the platform kept it, before a text conversation's first session starts, and for an external user, since it names the workspace's agent, graph and models."}},"type":"object","required":["id","channel_kind","status","lifecycle","created_at","updated_at"],"title":"ConversationDetail"},"ConversationTurn":{"properties":{"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"Stable identifier of the user exchange this message belongs to, derived deterministically from (conversation_id, turn_index) — identical across ``POST /turns`` responses and re-reads of the conversation history. User and agent messages from the same exchange share this value. Null on messages that precede the first user turn (proactive greetings, channel-event preludes)."},"turn_index":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Turn Index","description":"Zero-based ordinal of the user exchange this message belongs to (0 = first user turn). Derived server-side from the conversation's user-turn count — never stored. Null exactly when ``turn_id`` is null."},"engine_turn_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine Turn Id","description":"The agent engine's id for the turn this message opens (a user message) or answers (an agent message). One exchange can hold several engine turns, such as a tool call and the reply to its result. Null when no engine turn is recorded on the message: a filler line, a text reply, a channel event, or an older conversation that didn't record it."},"role":{"type":"string","enum":["agent","user","system"],"title":"Role"},"text":{"type":"string","title":"Text"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"The context-graph state of the conversation at this message: for a user message, the state it arrived in; for an agent message, the state after the turn's transitions. Null when the record names no state."},"speech_start_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech Start Ms","description":"Where this message's speech starts in the call's recording, in milliseconds from the start of the recording. A user message starts when the caller began speaking; an agent message when its first audio was sent, slightly before the caller heard it. Null when no position was recorded: text messages, agent lines that never played, and older calls that didn't record one."},"speech_end_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech End Ms","description":"Where this message's speech ends in the call's recording, in milliseconds from the start of the recording: when the caller stopped speaking, or when the agent line's last audio was sent. Null when no position was recorded, such as on a caller's line the call ended during."},"filler_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Type","description":"On an agent line the agent spoke while working on the reply, the kind of filler it was, such as ``receipt``, ``empathy`` or ``working``. Null on a reply and on user and system messages."},"interrupted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Interrupted","description":"On an agent line in a call, whether the caller cut it off, before or while it played. Null on user, system and text messages, and where the record doesn't say."},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelKind"},{"type":"null"}],"description":"Channel this turn occurred on. A conversation that switched channels has a self-describing per-turn history; null on turns written before per-turn attribution or on channel-less internal turns."},"content":{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","title":"Content","default":[]},"tool_calls":{"items":{"$ref":"#/components/schemas/ConversationToolCallDetail"},"type":"array","title":"Tool Calls","description":"Tool calls executed during this (agent) turn. Populated only when the request opts in via ``include_tool_calls=true``; empty otherwise and on turns that did not invoke tools.","default":[]},"artifacts":{"items":{"$ref":"#/components/schemas/ClientArtifact"},"type":"array","title":"Artifacts","description":"Validated client-safe outputs produced during this agent turn.","default":[]},"selected_action_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Action Description","description":"Description of the context-graph action selected for this turn. Null means no action was selected or no selected action was recorded."},"state_transition":{"anyOf":[{"$ref":"#/components/schemas/ConversationTurnStateTransition"},{"type":"null"}],"description":"Context-graph state transition that occurred during this turn. Null means no transition took place or no transition was recorded. Deprecated: use state_transitions instead. If multiple transitions were recorded, this field reports the first source state and final destination state, with no exit condition.","deprecated":true},"state_transitions":{"items":{"$ref":"#/components/schemas/ConversationTurnStateTransition"},"type":"array","title":"State Transitions","description":"Ordered context-graph state transitions that occurred during this turn.","default":[]},"available_actions":{"items":{"$ref":"#/components/schemas/ConversationTurnAvailableAction"},"type":"array","title":"Available Actions","description":"Action choices available in the turn's resolved context-graph state. Empty when actions cannot be resolved or the resolved state is not an action state.","default":[]},"dynamic_behavior":{"anyOf":[{"$ref":"#/components/schemas/AppliedBehavior"},{"type":"null"}],"description":"On an agent message, the dynamic behavior its reply was rendered with. Null when none was in force, and on user and system messages."}},"type":"object","required":["role","text"],"title":"ConversationTurn"},"ContentPartPayload":{"properties":{"type":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9._-]*$","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Text"},"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"provider_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Provider Id"},"metadata":{"additionalProperties":true,"type":"object","maxProperties":50,"title":"Metadata"}},"type":"object","title":"ContentPartPayload","description":"HTTP/WebSocket shape for a modality-neutral conversation content part."},"ConversationToolCallDetail":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"call_id":{"type":"string","title":"Call Id"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"result":{"type":"string","title":"Result","default":""},"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Succeeded","description":"Whether the tool call succeeded. Null when no result was recorded, for example while it still runs.","default":true},"duration_ms":{"anyOf":[{"type":"number","maximum":3600000,"minimum":0},{"type":"null"}],"title":"Duration Ms","description":"Wall-clock tool execution time in milliseconds, measured at the engage_step call site. Omitted (null) on legacy turns that did not capture timing."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Failure detail recorded for the tool call when ``succeeded`` is false. Null on successful calls or when no message was captured."}},"type":"object","required":["tool_name","call_id"],"title":"ConversationToolCallDetail"},"ClientArtifact":{"properties":{"type":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type"},"schema_version":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version"},"payload":{"$ref":"#/components/schemas/ClientArtifactPayload"}},"type":"object","required":["type","schema_version","payload"],"title":"ClientArtifact","description":"A versioned JSON payload that a client can render as a product component."},"ClientArtifactPayload":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"}]},"JsonValue":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"},{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}]},"ConversationTurnStateTransition":{"properties":{"from":{"type":"string","title":"From","description":"Source context-graph state before the turn's state transition."},"to":{"type":"string","title":"To","description":"Destination context-graph state after the turn's state transition."},"exit_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exit Condition","description":"The exit condition the agent took out of ``from``, as the context graph worded it when the hop was taken. Null on a hop out of an annotation state, which has no exit conditions, and on a hop recorded without one. Never read from the current graph."}},"type":"object","required":["from","to"],"title":"ConversationTurnStateTransition"},"ConversationTurnAvailableAction":{"properties":{"description":{"type":"string","title":"Description","description":"Human-readable description of an action available in the turn's state."}},"type":"object","required":["description"],"title":"ConversationTurnAvailableAction"},"AppliedBehavior":{"description":"The dynamic behavior an agent reply was rendered with.","properties":{"id":{"format":"uuid","title":"Id","type":"string"},"version":{"anyOf":[{"maximum":2147483647,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"The version of the behavior this reply ran with. Null on a reply recorded before behaviors were versioned.","title":"Version"},"name":{"maxLength":120,"title":"Name","type":"string"},"mode":{"$ref":"#/components/schemas/DynamicBehaviorMode"}},"required":["id","name","mode"],"title":"AppliedBehavior","type":"object"},"DynamicBehaviorMode":{"enum":["add","replace"],"type":"string"},"VoiceDetail":{"properties":{"recording_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Path"},"twilio_recording_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Twilio Recording Sid"},"twilio_recording_duration":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Twilio Recording Duration"},"has_recording":{"type":"boolean","title":"Has Recording","default":false},"barge_in_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Barge In Events","default":[]},"states_visited":{"items":{"type":"string"},"type":"array","title":"States Visited","default":[]},"participants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Participants","default":[]},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"call_analysis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Analysis"},"forwarding":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Forwarding"},"escalation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Escalation"},"safety":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safety"},"quality_breakdown":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Quality Breakdown"},"risk_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Risk Summary"},"latency_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Latency Summary"},"conversation_metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conversation Metrics"},"tool_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Summary"},"safety_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safety Summary"},"operator_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Operator Summary"},"safe_exit":{"anyOf":[{"$ref":"#/components/schemas/src__services__safe_exit_reader__SafeExit"},{"type":"null"}],"description":"The call's safe exit, from its ``call.minimal_risk`` event. Null when the call didn't take it."},"timeline":{"anyOf":[{"$ref":"#/components/schemas/ConversationTimeline"},{"type":"null"}],"description":"Where the call's lines sit in its recording, from the positions its turns carry, with the wait from each user message to the first reply. ``turn_index`` on its turns and segments is a position in this response's ``turns``, not a turn's own ``turn_index``, which counts exchanges. ``turn_id`` names that turn's exchange. A truncated read's timeline stops where its turns do. An agent line's span is from when its first audio was sent to when its last was, ahead of when the caller finished hearing it, so the timeline places no silence. Tool calls and state transitions record no position, so they stay on the turns. Null when no line has a recorded start and end."}},"type":"object","title":"VoiceDetail"},"src__services__safe_exit_reader__SafeExit":{"properties":{"trigger":{"type":"string","enum":["stt_fatal","turn_stalled","wire_failed","disclosure_failed","session_rejected","setup_failed","service_budget","caller_cap","outside_answer_hours","health_alert","data_residency_refused","attach_failed"],"title":"Trigger","description":"Why the call took the safe exit."},"outcome":{"type":"string","enum":["mrc_transferred","mrc_ended","mrc_failed"],"title":"Outcome","description":"``mrc_transferred`` once the hand-off to the human line was placed, ``mrc_failed`` when the hand-off raised\n(the caller may still be on the line), else ``mrc_ended`` (hung up). The conversation's ``completion_reason``\nreads these as ``transferred`` and ``error``."},"lines_played":{"items":{"type":"string","enum":["disclosure","transfer","end","fallback_missed","hearing_failure"]},"type":"array","title":"Lines Played","description":"The script lines that played whole, in order. ``disclosure`` is the AI and recording notice."},"disclosure_heard":{"type":"boolean","title":"Disclosure Heard","description":"The caller had heard all of the AI and recording notice before the exit began, so the exit did not\nplay it again. When false, the notice was heard only if ``lines_played`` holds ``disclosure``."},"trigger_description":{"type":"string","title":"Trigger Description","description":"``trigger`` in plain words.","readOnly":true}},"type":"object","required":["trigger","outcome","lines_played","disclosure_heard","trigger_description"],"title":"SafeExit","description":"The call's safe exit: the agent stopped and a fixed script handed the caller to a person or ended the call."},"ConversationTimeline":{"properties":{"turns":{"items":{"$ref":"#/components/schemas/TurnTimeline"},"type":"array","title":"Turns","description":"One entry per message whose speech has a recorded start and end: ``seek_to`` and ``active_start`` are where it starts and ``active_end`` where it ends, in seconds from the start of the recording."},"segments":{"items":{"$ref":"#/components/schemas/TimelineSegment"},"type":"array","title":"Segments","description":"Each placed line's speech (``caller_speech``, ``agent_speech``, ``filler``, or ``interrupted_speech`` for a reply the caller cut off; a filler stays ``filler`` when cut off, and its turn's ``filler_type`` and ``interrupted`` say both) and each ``processing_gap``: the wait from a user message's end to the first reply after it, when that reply started once the user had stopped. A line already playing when the user started answers an earlier message. Later lines start no wait: the caller had heard the agent, and an agent line's end is when its audio was sent, so the time after it isn't measured. A gap's ``e2e_ttfb_ms`` is the wait the caller heard, to the first filler that started after their line or to the reply. A wait is placed only where the user message, the reply and every line that played between them have a start and an end, so every gap ends at a line in ``turns``. Ordered by start, then end."},"avg_processing_gap_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Processing Gap Ms","description":"Mean of the placed processing gaps, in ms. Null when there are none."},"max_processing_gap_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Processing Gap Ms","description":"Longest placed processing gap, in ms. Null when there are none."},"avg_perceived_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Perceived Latency Ms","description":"Mean of the placed gaps' ``e2e_ttfb_ms``. Null when there are none."}},"type":"object","required":["turns","segments"],"title":"ConversationTimeline","description":"Where a voice call's lines sit in its recording, and the waits between them."},"TurnTimeline":{"properties":{"turn_index":{"type":"integer","title":"Turn Index","description":"The turn: its index in the response's ``turns`` on ``GET /conversations/{conversation_id}``,\nthe call-detail row the timeline was built from on ``GET /calls/{call_id}``."},"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"The conversation exchange the turn belongs to, its ``turn_id``. Set on\n``GET /conversations/{conversation_id}``, null on ``GET /calls/{call_id}`` and on a turn\nbefore the first exchange."},"seek_to":{"type":"number","title":"Seek To"},"active_start":{"type":"number","title":"Active Start"},"active_end":{"type":"number","title":"Active End"}},"type":"object","required":["turn_index","seek_to","active_start","active_end"],"title":"TurnTimeline"},"TimelineSegment":{"properties":{"type":{"type":"string","enum":["agent_speech","barge_in","caller_speech","filler","filler_hesitation","filler_nav","greeting","interrupted_speech","processing_gap","silence","silence_check","state_transition","tool_call"],"title":"Type"},"lane":{"type":"string","enum":["agent","caller","events","operator","system","tool"],"title":"Lane"},"track":{"anyOf":[{"type":"string","enum":["agent","caller","operator","system","tool"]},{"type":"null"}],"title":"Track","description":"Actor-semantic display track for the segment. Inferred for legacy producers."},"lane_id":{"anyOf":[{"type":"string","maxLength":160,"minLength":1},{"type":"null"}],"title":"Lane Id","description":"Canonical lane id. Must match PlaybackTimeline.lanes[].id after platform normalization."},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Order","description":"Canonical event order after platform time/lane normalization."},"actor":{"anyOf":[{"$ref":"#/components/schemas/TimelineActor"},{"type":"null"}],"description":"Actor responsible for the segment. Inferred for legacy producers."},"start":{"type":"number","title":"Start"},"end":{"type":"number","title":"End"},"label":{"type":"string","title":"Label"},"turn_index":{"type":"integer","title":"Turn Index","description":"The segment's turn: its index in the response's ``turns`` on\n``GET /conversations/{conversation_id}``, the call-detail row the timeline was built from on\n``GET /calls/{call_id}``, or -1 when no turn owns it (a silence, a barge-in)."},"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"The conversation exchange the segment's turn belongs to, its ``turn_id``. Set on\n``GET /conversations/{conversation_id}``, null on ``GET /calls/{call_id}`` and on segments no\nexchange owns."},"stt_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Confidence"},"eot_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eot Confidence"},"audio_window_start":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window Start"},"audio_window_end":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window End"},"engine_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Engine Ms"},"nav_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nav Ms"},"render_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Render Ms"},"audio_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Ttfb Ms"},"e2e_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"E2E Ttfb Ms"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"parent_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Call Id"},"integration_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Integration Name"},"endpoint_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Name"},"protocol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol"},"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Succeeded"},"duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Ms"},"from_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From State"},"to_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To State"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},"type":"object","required":["type","lane","start","end","label","turn_index"],"title":"TimelineSegment"},"TimelineActor":{"properties":{"kind":{"type":"string","enum":["agent","human","operator","system","tool"],"title":"Kind"},"role":{"type":"string","enum":["agent","caller","operator","runtime","state","tool"],"title":"Role"},"label":{"type":"string","title":"Label"},"participant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Id"}},"type":"object","required":["kind","role","label"],"title":"TimelineActor"},"RunManifest":{"properties":{"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"agent_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Version","description":"The agent version number the session loaded."},"context_graph_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Context Graph Id"},"context_graph_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Graph Version","description":"The context graph version number the session loaded. Null, with ``context_graph_id``, on a run of a direct\nprogram, which loads no graph."},"program_kind":{"anyOf":[{"type":"string","enum":["workflow","direct"]},{"type":"null"}],"title":"Program Kind","description":"What the session ran: ``workflow``, its service's context graph, or ``direct``, its agent version's own\nprompt and tools. Null on a run recorded before programs and on one whose engine failed to load."},"program_digest":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the canonical JSON of the direct program the session ran: its authored prompt as saved and\nits tool specs. Null on a workflow run, which its graph version identifies."},"version_set":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The service version set the session resolved its versions and models through, e.g. ``release``."},"platform_config_fingerprint":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the agent and graph version ids, the LLM model and, when the service pins dynamic\nbehaviors, each pinned set's id and version: one value per config generation."},"service_config_digest":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the canonical JSON (keys sorted, no whitespace, non-ASCII escaped) of the whole service\nconfig the session received: the service, its agent and graph versions and the behaviors its version set\npins. Any edit to that config moves it, where the fingerprint follows only the versions, the model and the\npins, so two runs that record the same digest received the same config. Null when the session loaded none."},"image_sha":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The build the session ran on: the commit the agent-engine image was built from."},"runtime_release_id":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The runtime release of the pod the session ran on."},"llm_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The model that wrote the agent's replies: the engage model, or the realtime model on gpt_realtime."},"temperature":{"anyOf":[{"type":"number","maximum":2,"minimum":0},{"type":"null"}],"title":"Temperature","description":"The sampling temperature the reply requests set. Null where they set none and the model's own\ndefault applies: every voice call, and a text run on a model family that takes none. On a\nreasoning model it rides only the requests that carry tools."},"engage_prompt_template_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the templates the reply prompt renders from. Null on gpt_realtime, whose\ninstructions aren't rendered from them."},"rendered_prompt_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"SHA256 of the opening rendered instructions, without normalization."},"prompt_renderer":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"Renderer that produced the recorded instructions."},"prompt_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"Model identifier submitted with these instructions; aliases are not resolved snapshots."},"navigation_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The model that chose each context-graph transition. Null on gpt_realtime, which doesn't navigate."},"navigation_prompt_template_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the templates each navigation decision renders from. Null on gpt_realtime."},"dynamic_behavior_prompt_template_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the template and fixed text each dynamic behavior decision renders from. Null on\ngpt_realtime, which runs no dynamic behavior, and when the service pins no enabled one."},"decider_kind":{"anyOf":[{"$ref":"#/components/schemas/DeciderKind"},{"type":"null"}],"description":"How the session's region decides: ``decisions``, OpenAI Decisions through the region's gateway.\nNavigation and the reply checks both decide through it."},"stt_provider":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The speech-to-text vendor the call ran on: the one it opened with, or the one it failed over\nto. Null on a text run."},"stt_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"tts_provider":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The vendor that voiced the call's replies. Null on a text run."},"tts_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"tts_language":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The language the call's voice spoke: the one it opened in, or the caller's language once an\nin-house call switched to it. ``multilingual`` on a gpt_realtime call left to answer in the\ncaller's language. Null on a text run."},"emergency_floor_enforced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Emergency Floor Enforced","description":"Whether the medical-emergency floor acted on what it caught, rather than only counting it."},"effect_shadow":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Effect Shadow","description":"Whether an in-house call also recorded each turn as effects, in shadow. Null off in-house voice."},"cooperative_stop":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cooperative Stop","description":"Whether an in-house call's teardown let its session stop on its own before cancelling it.\nNull off in-house voice."}},"type":"object","title":"RunManifest","description":"The configuration a run executed with: as its session started, and as it stood after\nany change the run made mid-way.\n\nA field is null when the session had nothing to record for it: a text run has no\nspeech models, and a gpt_realtime call whose engine failed to load has no agent or\ngraph version. Nothing here is read back from the service's current configuration."},"NameString":{"maxLength":256,"minLength":1,"type":"string"},"DeciderKind":{"type":"string","const":"decisions"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"OpenerFailureResponse":{"properties":{"detail":{"type":"string","title":"Detail","description":"What failed."},"outcome":{"anyOf":[{"type":"string","enum":["delivered","unknown","rejected","not_sent","error"]},{"type":"null"}],"title":"Outcome","description":"What came of the opener's send. ``delivered``: the channel took the message, and a later step failed.\n``unknown``: the send failed after the request may have reached the channel, so the message may have gone\nout. ``rejected``: the channel refused the message, so it did not go out. ``not_sent``: the agent produced\nno message to send. ``error``: the run failed before any send began. Absent when the platform has no report\nof the opener."},"reason":{"anyOf":[{"type":"string","enum":["timeout","connection","http_4xx","http_5xx","error","opted_out","invalid_content","no_opener","llm_timeout","lease_contended","session_init","persist","agent_error","unanswered"]},{"type":"null"}],"title":"Reason","description":"Why the opener ended as it did. A failed send is named by how it failed: ``timeout``, ``connection``,\n``http_4xx``, ``http_5xx`` or ``error``. A refused message is ``opted_out`` (the recipient opted out) or\n``invalid_content``. A run that sent nothing is ``no_opener`` (the agent produced no message),\n``llm_timeout`` (the model did not answer in time) or ``lease_contended`` (another run held the\nconversation). A failure in the run is ``session_init``, ``persist`` or ``agent_error``. ``unanswered``:\nthe agent runtime gave no answer. Null when the send went out and nothing failed after it. Absent when the\nplatform has no report of the opener."},"conversation_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Conversation Id","description":"The conversation the opener ran in, or null when none had been created. Absent when the platform has no\nreport of the opener."}},"type":"object","required":["detail"],"title":"OpenerFailureResponse","description":"The body of a failed outbound opener.\n\n``detail`` says what failed. ``outcome``, ``reason`` and ``conversation_id`` say what happened to the\nopener's message and where, when the platform has a report of it; a failure it has none of carries\n``detail`` alone."}}},"paths":{"/v1/{workspace_id}/conversations":{"post":{"tags":["conversations"],"summary":"Create or start a conversation (web inbound, or outbound on a channel)","description":"Create a web conversation, or start one on sms or imessage with the agent's first message.\n\nWhere the workspace's start check is on, a service that takes no text start (readiness ``starts``) is refused\nwith 422 before a conversation is created or an opener is sent: ``detail`` is ``{\"code\", \"message\", \"fields\"}``\nand the code is ``start_kind_not_taken``, or ``start_family_unknown`` when the family the service runs cannot be\nread.","operationId":"create_conversation_v1__workspace_id__conversations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"An unexpected error while sending the opener (the agent's first message) of an sms or imessage conversation. ``outcome``, ``reason`` and ``conversation_id`` say what happened to the message when the platform has a report of it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenerFailureResponse"}}}},"502":{"description":"The opener (the agent's first message) of an sms or imessage conversation failed. The message may or may not have gone out: ``outcome`` says which, and a body without ``outcome`` does not. ``reason`` says why the opener ended as it did, ``conversation_id`` names the conversation it ran in, and ``detail`` says what failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenerFailureResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}}}}
```

## Switch a conversation to another channel

> Move an active conversation onto a different channel (sms/imessage today). The durable conversation id is preserved — the same conversation continues; only its routing changes. Optionally dispatch a first agent turn on the new channel.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"SwitchChannelRequest":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelKind","description":"Target channel to move the conversation to (sms or imessage)."},"recipient":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}],"description":"Recipient address on the new channel (E.164). Required for sms/imessage."},"use_case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id","description":"The use case for the new channel, which resolves the sender. Required for sms/imessage."},"reason":{"$ref":"#/components/schemas/NameString","description":"Why the conversation is being moved (e.g. escalation, customer_request)."},"dispatch_opener":{"type":"boolean","title":"Dispatch Opener","description":"If true, immediately drive one agent turn on the new channel (e.g. 'I'll text you now').","default":false},"instruction":{"anyOf":[{"$ref":"#/components/schemas/BackgroundString"},{"type":"null"}],"description":"Optional context steering the opener when dispatch_opener=true."},"source":{"anyOf":[{"type":"string","const":"playground"},{"type":"null"}],"title":"Source","description":"Set to ``playground`` when the developer console Playground switches the conversation. Refused with 403 on a real conversation, one no Playground session or test credential started."}},"type":"object","required":["channel","reason"],"title":"SwitchChannelRequest"},"ChannelKind":{"type":"string","enum":["voice","sms","whatsapp","email","web","imessage"],"title":"ChannelKind","description":"HSM execution channel type.\n\nDetermines how the HSM engine communicates with end users.\nEach kind maps to one or more providers."},"PhoneE164":{"type":"string","maxLength":16,"minLength":2},"NameString":{"maxLength":256,"minLength":1,"type":"string"},"BackgroundString":{"type":"string","maxLength":10000},"ConversationDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"channel_kind":{"$ref":"#/components/schemas/ChannelKind"},"status":{"type":"string","enum":["active","closed","completed","in-progress","failed","paused"],"title":"Status"},"lifecycle":{"type":"string","enum":["active","dormant","closed"],"title":"Lifecycle"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"turn_count":{"type":"integer","title":"Turn Count","default":0},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"has_recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Recording"},"completion_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completion Reason"},"escalation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Status"},"final_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final State"},"tags":{"items":{"$ref":"#/components/schemas/ConversationTag"},"type":"array","title":"Tags","description":"The labels an app set on the conversation, by key. Empty when it has none."},"tool_execution":{"anyOf":[{"type":"string","const":"live"},{"type":"null"}],"title":"Tool Execution","description":"Stored explicit Playground tool policy. ``live`` runs its tools for real. Null means no explicit live policy: Playground and test conversations simulate, while ordinary production conversations retain their existing tool behavior."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"What started the conversation. A text conversation reads ``test`` when a test key or the ``test`` marker started it, ``playground`` when the developer console Playground did, and null otherwise. A call reads the source its call intelligence recorded (``real``, ``simulation`` or ``playground``), and null when it recorded none, as a test call does."},"turns":{"items":{"$ref":"#/components/schemas/ConversationTurn"},"type":"array","title":"Turns","default":[]},"truncated":{"type":"boolean","title":"Truncated","description":"True when the conversation recorded more entries than one read takes (10,000), so the turns stop before the end of the conversation.","default":false},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"voice":{"anyOf":[{"$ref":"#/components/schemas/VoiceDetail"},{"type":"null"}]},"session_provider":{"anyOf":[{"type":"string","enum":["concurrence","gpt_realtime","eleven_realtime","gpt_live","grok_voice","phonic"]},{"type":"null"}],"title":"Session Provider","description":"The voice runtime that handled the conversation, as its session recorded it at start: `concurrence` (also every text conversation) or `gpt_realtime`. Null when the conversation was recorded before the platform kept it, before a text conversation's first session starts, and for an external user."},"manifest":{"anyOf":[{"$ref":"#/components/schemas/RunManifest"},{"type":"null"}],"description":"What the conversation executed with, as its first session recorded it: the agent and context graph versions, the version set and config fingerprint, the digest of the whole service config it received, the build, the models and how they sampled, the prompt templates, the voice's language, the program flags and how the region decides. A call that changed its STT or its voice's language mid-call reads as it last stood. Null when the conversation was recorded before the platform kept it, before a text conversation's first session starts, and for an external user, since it names the workspace's agent, graph and models."}},"type":"object","required":["id","channel_kind","status","lifecycle","created_at","updated_at"],"title":"ConversationDetail"},"ConversationTag":{"properties":{"key":{"type":"string","maxLength":64,"minLength":1,"title":"Key"},"value":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Value","description":"Null for a bare label."}},"type":"object","required":["key"],"title":"ConversationTag"},"ConversationTurn":{"properties":{"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"Stable identifier of the user exchange this message belongs to, derived deterministically from (conversation_id, turn_index) — identical across ``POST /turns`` responses and re-reads of the conversation history. User and agent messages from the same exchange share this value. Null on messages that precede the first user turn (proactive greetings, channel-event preludes)."},"turn_index":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Turn Index","description":"Zero-based ordinal of the user exchange this message belongs to (0 = first user turn). Derived server-side from the conversation's user-turn count — never stored. Null exactly when ``turn_id`` is null."},"engine_turn_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine Turn Id","description":"The agent engine's id for the turn this message opens (a user message) or answers (an agent message). One exchange can hold several engine turns, such as a tool call and the reply to its result. Null when no engine turn is recorded on the message: a filler line, a text reply, a channel event, or an older conversation that didn't record it."},"role":{"type":"string","enum":["agent","user","system"],"title":"Role"},"text":{"type":"string","title":"Text"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"The context-graph state of the conversation at this message: for a user message, the state it arrived in; for an agent message, the state after the turn's transitions. Null when the record names no state."},"speech_start_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech Start Ms","description":"Where this message's speech starts in the call's recording, in milliseconds from the start of the recording. A user message starts when the caller began speaking; an agent message when its first audio was sent, slightly before the caller heard it. Null when no position was recorded: text messages, agent lines that never played, and older calls that didn't record one."},"speech_end_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech End Ms","description":"Where this message's speech ends in the call's recording, in milliseconds from the start of the recording: when the caller stopped speaking, or when the agent line's last audio was sent. Null when no position was recorded, such as on a caller's line the call ended during."},"filler_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Type","description":"On an agent line the agent spoke while working on the reply, the kind of filler it was, such as ``receipt``, ``empathy`` or ``working``. Null on a reply and on user and system messages."},"interrupted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Interrupted","description":"On an agent line in a call, whether the caller cut it off, before or while it played. Null on user, system and text messages, and where the record doesn't say."},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelKind"},{"type":"null"}],"description":"Channel this turn occurred on. A conversation that switched channels has a self-describing per-turn history; null on turns written before per-turn attribution or on channel-less internal turns."},"content":{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","title":"Content","default":[]},"tool_calls":{"items":{"$ref":"#/components/schemas/ConversationToolCallDetail"},"type":"array","title":"Tool Calls","description":"Tool calls executed during this (agent) turn. Populated only when the request opts in via ``include_tool_calls=true``; empty otherwise and on turns that did not invoke tools.","default":[]},"artifacts":{"items":{"$ref":"#/components/schemas/ClientArtifact"},"type":"array","title":"Artifacts","description":"Validated client-safe outputs produced during this agent turn.","default":[]},"selected_action_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Action Description","description":"Description of the context-graph action selected for this turn. Null means no action was selected or no selected action was recorded."},"state_transition":{"anyOf":[{"$ref":"#/components/schemas/ConversationTurnStateTransition"},{"type":"null"}],"description":"Context-graph state transition that occurred during this turn. Null means no transition took place or no transition was recorded. Deprecated: use state_transitions instead. If multiple transitions were recorded, this field reports the first source state and final destination state, with no exit condition.","deprecated":true},"state_transitions":{"items":{"$ref":"#/components/schemas/ConversationTurnStateTransition"},"type":"array","title":"State Transitions","description":"Ordered context-graph state transitions that occurred during this turn.","default":[]},"available_actions":{"items":{"$ref":"#/components/schemas/ConversationTurnAvailableAction"},"type":"array","title":"Available Actions","description":"Action choices available in the turn's resolved context-graph state. Empty when actions cannot be resolved or the resolved state is not an action state.","default":[]},"dynamic_behavior":{"anyOf":[{"$ref":"#/components/schemas/AppliedBehavior"},{"type":"null"}],"description":"On an agent message, the dynamic behavior its reply was rendered with. Null when none was in force, and on user and system messages."}},"type":"object","required":["role","text"],"title":"ConversationTurn"},"ContentPartPayload":{"properties":{"type":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9._-]*$","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Text"},"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"provider_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Provider Id"},"metadata":{"additionalProperties":true,"type":"object","maxProperties":50,"title":"Metadata"}},"type":"object","title":"ContentPartPayload","description":"HTTP/WebSocket shape for a modality-neutral conversation content part."},"ConversationToolCallDetail":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"call_id":{"type":"string","title":"Call Id"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"result":{"type":"string","title":"Result","default":""},"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Succeeded","description":"Whether the tool call succeeded. Null when no result was recorded, for example while it still runs.","default":true},"duration_ms":{"anyOf":[{"type":"number","maximum":3600000,"minimum":0},{"type":"null"}],"title":"Duration Ms","description":"Wall-clock tool execution time in milliseconds, measured at the engage_step call site. Omitted (null) on legacy turns that did not capture timing."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Failure detail recorded for the tool call when ``succeeded`` is false. Null on successful calls or when no message was captured."}},"type":"object","required":["tool_name","call_id"],"title":"ConversationToolCallDetail"},"ClientArtifact":{"properties":{"type":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type"},"schema_version":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version"},"payload":{"$ref":"#/components/schemas/ClientArtifactPayload"}},"type":"object","required":["type","schema_version","payload"],"title":"ClientArtifact","description":"A versioned JSON payload that a client can render as a product component."},"ClientArtifactPayload":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"}]},"JsonValue":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"},{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}]},"ConversationTurnStateTransition":{"properties":{"from":{"type":"string","title":"From","description":"Source context-graph state before the turn's state transition."},"to":{"type":"string","title":"To","description":"Destination context-graph state after the turn's state transition."},"exit_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exit Condition","description":"The exit condition the agent took out of ``from``, as the context graph worded it when the hop was taken. Null on a hop out of an annotation state, which has no exit conditions, and on a hop recorded without one. Never read from the current graph."}},"type":"object","required":["from","to"],"title":"ConversationTurnStateTransition"},"ConversationTurnAvailableAction":{"properties":{"description":{"type":"string","title":"Description","description":"Human-readable description of an action available in the turn's state."}},"type":"object","required":["description"],"title":"ConversationTurnAvailableAction"},"AppliedBehavior":{"description":"The dynamic behavior an agent reply was rendered with.","properties":{"id":{"format":"uuid","title":"Id","type":"string"},"version":{"anyOf":[{"maximum":2147483647,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"The version of the behavior this reply ran with. Null on a reply recorded before behaviors were versioned.","title":"Version"},"name":{"maxLength":120,"title":"Name","type":"string"},"mode":{"$ref":"#/components/schemas/DynamicBehaviorMode"}},"required":["id","name","mode"],"title":"AppliedBehavior","type":"object"},"DynamicBehaviorMode":{"enum":["add","replace"],"type":"string"},"VoiceDetail":{"properties":{"recording_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Path"},"twilio_recording_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Twilio Recording Sid"},"twilio_recording_duration":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Twilio Recording Duration"},"has_recording":{"type":"boolean","title":"Has Recording","default":false},"barge_in_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Barge In Events","default":[]},"states_visited":{"items":{"type":"string"},"type":"array","title":"States Visited","default":[]},"participants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Participants","default":[]},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"call_analysis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Analysis"},"forwarding":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Forwarding"},"escalation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Escalation"},"safety":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safety"},"quality_breakdown":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Quality Breakdown"},"risk_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Risk Summary"},"latency_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Latency Summary"},"conversation_metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conversation Metrics"},"tool_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Summary"},"safety_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safety Summary"},"operator_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Operator Summary"},"safe_exit":{"anyOf":[{"$ref":"#/components/schemas/src__services__safe_exit_reader__SafeExit"},{"type":"null"}],"description":"The call's safe exit, from its ``call.minimal_risk`` event. Null when the call didn't take it."},"timeline":{"anyOf":[{"$ref":"#/components/schemas/ConversationTimeline"},{"type":"null"}],"description":"Where the call's lines sit in its recording, from the positions its turns carry, with the wait from each user message to the first reply. ``turn_index`` on its turns and segments is a position in this response's ``turns``, not a turn's own ``turn_index``, which counts exchanges. ``turn_id`` names that turn's exchange. A truncated read's timeline stops where its turns do. An agent line's span is from when its first audio was sent to when its last was, ahead of when the caller finished hearing it, so the timeline places no silence. Tool calls and state transitions record no position, so they stay on the turns. Null when no line has a recorded start and end."}},"type":"object","title":"VoiceDetail"},"src__services__safe_exit_reader__SafeExit":{"properties":{"trigger":{"type":"string","enum":["stt_fatal","turn_stalled","wire_failed","disclosure_failed","session_rejected","setup_failed","service_budget","caller_cap","outside_answer_hours","health_alert","data_residency_refused","attach_failed"],"title":"Trigger","description":"Why the call took the safe exit."},"outcome":{"type":"string","enum":["mrc_transferred","mrc_ended","mrc_failed"],"title":"Outcome","description":"``mrc_transferred`` once the hand-off to the human line was placed, ``mrc_failed`` when the hand-off raised\n(the caller may still be on the line), else ``mrc_ended`` (hung up). The conversation's ``completion_reason``\nreads these as ``transferred`` and ``error``."},"lines_played":{"items":{"type":"string","enum":["disclosure","transfer","end","fallback_missed","hearing_failure"]},"type":"array","title":"Lines Played","description":"The script lines that played whole, in order. ``disclosure`` is the AI and recording notice."},"disclosure_heard":{"type":"boolean","title":"Disclosure Heard","description":"The caller had heard all of the AI and recording notice before the exit began, so the exit did not\nplay it again. When false, the notice was heard only if ``lines_played`` holds ``disclosure``."},"trigger_description":{"type":"string","title":"Trigger Description","description":"``trigger`` in plain words.","readOnly":true}},"type":"object","required":["trigger","outcome","lines_played","disclosure_heard","trigger_description"],"title":"SafeExit","description":"The call's safe exit: the agent stopped and a fixed script handed the caller to a person or ended the call."},"ConversationTimeline":{"properties":{"turns":{"items":{"$ref":"#/components/schemas/TurnTimeline"},"type":"array","title":"Turns","description":"One entry per message whose speech has a recorded start and end: ``seek_to`` and ``active_start`` are where it starts and ``active_end`` where it ends, in seconds from the start of the recording."},"segments":{"items":{"$ref":"#/components/schemas/TimelineSegment"},"type":"array","title":"Segments","description":"Each placed line's speech (``caller_speech``, ``agent_speech``, ``filler``, or ``interrupted_speech`` for a reply the caller cut off; a filler stays ``filler`` when cut off, and its turn's ``filler_type`` and ``interrupted`` say both) and each ``processing_gap``: the wait from a user message's end to the first reply after it, when that reply started once the user had stopped. A line already playing when the user started answers an earlier message. Later lines start no wait: the caller had heard the agent, and an agent line's end is when its audio was sent, so the time after it isn't measured. A gap's ``e2e_ttfb_ms`` is the wait the caller heard, to the first filler that started after their line or to the reply. A wait is placed only where the user message, the reply and every line that played between them have a start and an end, so every gap ends at a line in ``turns``. Ordered by start, then end."},"avg_processing_gap_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Processing Gap Ms","description":"Mean of the placed processing gaps, in ms. Null when there are none."},"max_processing_gap_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Processing Gap Ms","description":"Longest placed processing gap, in ms. Null when there are none."},"avg_perceived_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Perceived Latency Ms","description":"Mean of the placed gaps' ``e2e_ttfb_ms``. Null when there are none."}},"type":"object","required":["turns","segments"],"title":"ConversationTimeline","description":"Where a voice call's lines sit in its recording, and the waits between them."},"TurnTimeline":{"properties":{"turn_index":{"type":"integer","title":"Turn Index","description":"The turn: its index in the response's ``turns`` on ``GET /conversations/{conversation_id}``,\nthe call-detail row the timeline was built from on ``GET /calls/{call_id}``."},"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"The conversation exchange the turn belongs to, its ``turn_id``. Set on\n``GET /conversations/{conversation_id}``, null on ``GET /calls/{call_id}`` and on a turn\nbefore the first exchange."},"seek_to":{"type":"number","title":"Seek To"},"active_start":{"type":"number","title":"Active Start"},"active_end":{"type":"number","title":"Active End"}},"type":"object","required":["turn_index","seek_to","active_start","active_end"],"title":"TurnTimeline"},"TimelineSegment":{"properties":{"type":{"type":"string","enum":["agent_speech","barge_in","caller_speech","filler","filler_hesitation","filler_nav","greeting","interrupted_speech","processing_gap","silence","silence_check","state_transition","tool_call"],"title":"Type"},"lane":{"type":"string","enum":["agent","caller","events","operator","system","tool"],"title":"Lane"},"track":{"anyOf":[{"type":"string","enum":["agent","caller","operator","system","tool"]},{"type":"null"}],"title":"Track","description":"Actor-semantic display track for the segment. Inferred for legacy producers."},"lane_id":{"anyOf":[{"type":"string","maxLength":160,"minLength":1},{"type":"null"}],"title":"Lane Id","description":"Canonical lane id. Must match PlaybackTimeline.lanes[].id after platform normalization."},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Order","description":"Canonical event order after platform time/lane normalization."},"actor":{"anyOf":[{"$ref":"#/components/schemas/TimelineActor"},{"type":"null"}],"description":"Actor responsible for the segment. Inferred for legacy producers."},"start":{"type":"number","title":"Start"},"end":{"type":"number","title":"End"},"label":{"type":"string","title":"Label"},"turn_index":{"type":"integer","title":"Turn Index","description":"The segment's turn: its index in the response's ``turns`` on\n``GET /conversations/{conversation_id}``, the call-detail row the timeline was built from on\n``GET /calls/{call_id}``, or -1 when no turn owns it (a silence, a barge-in)."},"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"The conversation exchange the segment's turn belongs to, its ``turn_id``. Set on\n``GET /conversations/{conversation_id}``, null on ``GET /calls/{call_id}`` and on segments no\nexchange owns."},"stt_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Confidence"},"eot_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eot Confidence"},"audio_window_start":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window Start"},"audio_window_end":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window End"},"engine_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Engine Ms"},"nav_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nav Ms"},"render_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Render Ms"},"audio_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Ttfb Ms"},"e2e_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"E2E Ttfb Ms"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"parent_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Call Id"},"integration_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Integration Name"},"endpoint_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Name"},"protocol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol"},"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Succeeded"},"duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Ms"},"from_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From State"},"to_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To State"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},"type":"object","required":["type","lane","start","end","label","turn_index"],"title":"TimelineSegment"},"TimelineActor":{"properties":{"kind":{"type":"string","enum":["agent","human","operator","system","tool"],"title":"Kind"},"role":{"type":"string","enum":["agent","caller","operator","runtime","state","tool"],"title":"Role"},"label":{"type":"string","title":"Label"},"participant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Id"}},"type":"object","required":["kind","role","label"],"title":"TimelineActor"},"RunManifest":{"properties":{"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"agent_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Version","description":"The agent version number the session loaded."},"context_graph_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Context Graph Id"},"context_graph_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Graph Version","description":"The context graph version number the session loaded. Null, with ``context_graph_id``, on a run of a direct\nprogram, which loads no graph."},"program_kind":{"anyOf":[{"type":"string","enum":["workflow","direct"]},{"type":"null"}],"title":"Program Kind","description":"What the session ran: ``workflow``, its service's context graph, or ``direct``, its agent version's own\nprompt and tools. Null on a run recorded before programs and on one whose engine failed to load."},"program_digest":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the canonical JSON of the direct program the session ran: its authored prompt as saved and\nits tool specs. Null on a workflow run, which its graph version identifies."},"version_set":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The service version set the session resolved its versions and models through, e.g. ``release``."},"platform_config_fingerprint":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the agent and graph version ids, the LLM model and, when the service pins dynamic\nbehaviors, each pinned set's id and version: one value per config generation."},"service_config_digest":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the canonical JSON (keys sorted, no whitespace, non-ASCII escaped) of the whole service\nconfig the session received: the service, its agent and graph versions and the behaviors its version set\npins. Any edit to that config moves it, where the fingerprint follows only the versions, the model and the\npins, so two runs that record the same digest received the same config. Null when the session loaded none."},"image_sha":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The build the session ran on: the commit the agent-engine image was built from."},"runtime_release_id":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The runtime release of the pod the session ran on."},"llm_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The model that wrote the agent's replies: the engage model, or the realtime model on gpt_realtime."},"temperature":{"anyOf":[{"type":"number","maximum":2,"minimum":0},{"type":"null"}],"title":"Temperature","description":"The sampling temperature the reply requests set. Null where they set none and the model's own\ndefault applies: every voice call, and a text run on a model family that takes none. On a\nreasoning model it rides only the requests that carry tools."},"engage_prompt_template_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the templates the reply prompt renders from. Null on gpt_realtime, whose\ninstructions aren't rendered from them."},"rendered_prompt_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"SHA256 of the opening rendered instructions, without normalization."},"prompt_renderer":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"Renderer that produced the recorded instructions."},"prompt_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"Model identifier submitted with these instructions; aliases are not resolved snapshots."},"navigation_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The model that chose each context-graph transition. Null on gpt_realtime, which doesn't navigate."},"navigation_prompt_template_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the templates each navigation decision renders from. Null on gpt_realtime."},"dynamic_behavior_prompt_template_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the template and fixed text each dynamic behavior decision renders from. Null on\ngpt_realtime, which runs no dynamic behavior, and when the service pins no enabled one."},"decider_kind":{"anyOf":[{"$ref":"#/components/schemas/DeciderKind"},{"type":"null"}],"description":"How the session's region decides: ``decisions``, OpenAI Decisions through the region's gateway.\nNavigation and the reply checks both decide through it."},"stt_provider":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The speech-to-text vendor the call ran on: the one it opened with, or the one it failed over\nto. Null on a text run."},"stt_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"tts_provider":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The vendor that voiced the call's replies. Null on a text run."},"tts_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"tts_language":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The language the call's voice spoke: the one it opened in, or the caller's language once an\nin-house call switched to it. ``multilingual`` on a gpt_realtime call left to answer in the\ncaller's language. Null on a text run."},"emergency_floor_enforced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Emergency Floor Enforced","description":"Whether the medical-emergency floor acted on what it caught, rather than only counting it."},"effect_shadow":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Effect Shadow","description":"Whether an in-house call also recorded each turn as effects, in shadow. Null off in-house voice."},"cooperative_stop":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cooperative Stop","description":"Whether an in-house call's teardown let its session stop on its own before cancelling it.\nNull off in-house voice."}},"type":"object","title":"RunManifest","description":"The configuration a run executed with: as its session started, and as it stood after\nany change the run made mid-way.\n\nA field is null when the session had nothing to record for it: a text run has no\nspeech models, and a gpt_realtime call whose engine failed to load has no agent or\ngraph version. Nothing here is read back from the service's current configuration."},"DeciderKind":{"type":"string","const":"decisions"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"OpenerFailureResponse":{"properties":{"detail":{"type":"string","title":"Detail","description":"What failed."},"outcome":{"anyOf":[{"type":"string","enum":["delivered","unknown","rejected","not_sent","error"]},{"type":"null"}],"title":"Outcome","description":"What came of the opener's send. ``delivered``: the channel took the message, and a later step failed.\n``unknown``: the send failed after the request may have reached the channel, so the message may have gone\nout. ``rejected``: the channel refused the message, so it did not go out. ``not_sent``: the agent produced\nno message to send. ``error``: the run failed before any send began. Absent when the platform has no report\nof the opener."},"reason":{"anyOf":[{"type":"string","enum":["timeout","connection","http_4xx","http_5xx","error","opted_out","invalid_content","no_opener","llm_timeout","lease_contended","session_init","persist","agent_error","unanswered"]},{"type":"null"}],"title":"Reason","description":"Why the opener ended as it did. A failed send is named by how it failed: ``timeout``, ``connection``,\n``http_4xx``, ``http_5xx`` or ``error``. A refused message is ``opted_out`` (the recipient opted out) or\n``invalid_content``. A run that sent nothing is ``no_opener`` (the agent produced no message),\n``llm_timeout`` (the model did not answer in time) or ``lease_contended`` (another run held the\nconversation). A failure in the run is ``session_init``, ``persist`` or ``agent_error``. ``unanswered``:\nthe agent runtime gave no answer. Null when the send went out and nothing failed after it. Absent when the\nplatform has no report of the opener."},"conversation_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Conversation Id","description":"The conversation the opener ran in, or null when none had been created. Absent when the platform has no\nreport of the opener."}},"type":"object","required":["detail"],"title":"OpenerFailureResponse","description":"The body of a failed outbound opener.\n\n``detail`` says what failed. ``outcome``, ``reason`` and ``conversation_id`` say what happened to the\nopener's message and where, when the platform has a report of it; a failure it has none of carries\n``detail`` alone."}}},"paths":{"/v1/{workspace_id}/conversations/{conversation_id}/channel":{"post":{"tags":["conversations"],"summary":"Switch a conversation to another channel","description":"Move an active conversation onto a different channel (sms/imessage today). The durable conversation id is preserved — the same conversation continues; only its routing changes. Optionally dispatch a first agent turn on the new channel.","operationId":"switch_conversation_channel_v1__workspace_id__conversations__conversation_id__channel_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchChannelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"502":{"description":"The channel switched, but the opener (the agent's first message, ``dispatch_opener``) failed. The message may or may not have gone out: ``outcome`` says which, and a body without ``outcome`` does not. ``reason`` says why the opener ended as it did, ``conversation_id`` names the conversation it ran in, and ``detail`` says what failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenerFailureResponse"}}}}}}}}}
```

## GET /v1/{workspace\_id}/conversations/{conversation\_id}

> Get conversation detail (voice or text)

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"ConversationDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"channel_kind":{"$ref":"#/components/schemas/ChannelKind"},"status":{"type":"string","enum":["active","closed","completed","in-progress","failed","paused"],"title":"Status"},"lifecycle":{"type":"string","enum":["active","dormant","closed"],"title":"Lifecycle"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"turn_count":{"type":"integer","title":"Turn Count","default":0},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"has_recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Recording"},"completion_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completion Reason"},"escalation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Status"},"final_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final State"},"tags":{"items":{"$ref":"#/components/schemas/ConversationTag"},"type":"array","title":"Tags","description":"The labels an app set on the conversation, by key. Empty when it has none."},"tool_execution":{"anyOf":[{"type":"string","const":"live"},{"type":"null"}],"title":"Tool Execution","description":"Stored explicit Playground tool policy. ``live`` runs its tools for real. Null means no explicit live policy: Playground and test conversations simulate, while ordinary production conversations retain their existing tool behavior."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"What started the conversation. A text conversation reads ``test`` when a test key or the ``test`` marker started it, ``playground`` when the developer console Playground did, and null otherwise. A call reads the source its call intelligence recorded (``real``, ``simulation`` or ``playground``), and null when it recorded none, as a test call does."},"turns":{"items":{"$ref":"#/components/schemas/ConversationTurn"},"type":"array","title":"Turns","default":[]},"truncated":{"type":"boolean","title":"Truncated","description":"True when the conversation recorded more entries than one read takes (10,000), so the turns stop before the end of the conversation.","default":false},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"voice":{"anyOf":[{"$ref":"#/components/schemas/VoiceDetail"},{"type":"null"}]},"session_provider":{"anyOf":[{"type":"string","enum":["concurrence","gpt_realtime","eleven_realtime","gpt_live","grok_voice","phonic"]},{"type":"null"}],"title":"Session Provider","description":"The voice runtime that handled the conversation, as its session recorded it at start: `concurrence` (also every text conversation) or `gpt_realtime`. Null when the conversation was recorded before the platform kept it, before a text conversation's first session starts, and for an external user."},"manifest":{"anyOf":[{"$ref":"#/components/schemas/RunManifest"},{"type":"null"}],"description":"What the conversation executed with, as its first session recorded it: the agent and context graph versions, the version set and config fingerprint, the digest of the whole service config it received, the build, the models and how they sampled, the prompt templates, the voice's language, the program flags and how the region decides. A call that changed its STT or its voice's language mid-call reads as it last stood. Null when the conversation was recorded before the platform kept it, before a text conversation's first session starts, and for an external user, since it names the workspace's agent, graph and models."}},"type":"object","required":["id","channel_kind","status","lifecycle","created_at","updated_at"],"title":"ConversationDetail"},"ChannelKind":{"type":"string","enum":["voice","sms","whatsapp","email","web","imessage"],"title":"ChannelKind","description":"HSM execution channel type.\n\nDetermines how the HSM engine communicates with end users.\nEach kind maps to one or more providers."},"ConversationTag":{"properties":{"key":{"type":"string","maxLength":64,"minLength":1,"title":"Key"},"value":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Value","description":"Null for a bare label."}},"type":"object","required":["key"],"title":"ConversationTag"},"ConversationTurn":{"properties":{"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"Stable identifier of the user exchange this message belongs to, derived deterministically from (conversation_id, turn_index) — identical across ``POST /turns`` responses and re-reads of the conversation history. User and agent messages from the same exchange share this value. Null on messages that precede the first user turn (proactive greetings, channel-event preludes)."},"turn_index":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Turn Index","description":"Zero-based ordinal of the user exchange this message belongs to (0 = first user turn). Derived server-side from the conversation's user-turn count — never stored. Null exactly when ``turn_id`` is null."},"engine_turn_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine Turn Id","description":"The agent engine's id for the turn this message opens (a user message) or answers (an agent message). One exchange can hold several engine turns, such as a tool call and the reply to its result. Null when no engine turn is recorded on the message: a filler line, a text reply, a channel event, or an older conversation that didn't record it."},"role":{"type":"string","enum":["agent","user","system"],"title":"Role"},"text":{"type":"string","title":"Text"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"The context-graph state of the conversation at this message: for a user message, the state it arrived in; for an agent message, the state after the turn's transitions. Null when the record names no state."},"speech_start_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech Start Ms","description":"Where this message's speech starts in the call's recording, in milliseconds from the start of the recording. A user message starts when the caller began speaking; an agent message when its first audio was sent, slightly before the caller heard it. Null when no position was recorded: text messages, agent lines that never played, and older calls that didn't record one."},"speech_end_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech End Ms","description":"Where this message's speech ends in the call's recording, in milliseconds from the start of the recording: when the caller stopped speaking, or when the agent line's last audio was sent. Null when no position was recorded, such as on a caller's line the call ended during."},"filler_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Type","description":"On an agent line the agent spoke while working on the reply, the kind of filler it was, such as ``receipt``, ``empathy`` or ``working``. Null on a reply and on user and system messages."},"interrupted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Interrupted","description":"On an agent line in a call, whether the caller cut it off, before or while it played. Null on user, system and text messages, and where the record doesn't say."},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelKind"},{"type":"null"}],"description":"Channel this turn occurred on. A conversation that switched channels has a self-describing per-turn history; null on turns written before per-turn attribution or on channel-less internal turns."},"content":{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","title":"Content","default":[]},"tool_calls":{"items":{"$ref":"#/components/schemas/ConversationToolCallDetail"},"type":"array","title":"Tool Calls","description":"Tool calls executed during this (agent) turn. Populated only when the request opts in via ``include_tool_calls=true``; empty otherwise and on turns that did not invoke tools.","default":[]},"artifacts":{"items":{"$ref":"#/components/schemas/ClientArtifact"},"type":"array","title":"Artifacts","description":"Validated client-safe outputs produced during this agent turn.","default":[]},"selected_action_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Action Description","description":"Description of the context-graph action selected for this turn. Null means no action was selected or no selected action was recorded."},"state_transition":{"anyOf":[{"$ref":"#/components/schemas/ConversationTurnStateTransition"},{"type":"null"}],"description":"Context-graph state transition that occurred during this turn. Null means no transition took place or no transition was recorded. Deprecated: use state_transitions instead. If multiple transitions were recorded, this field reports the first source state and final destination state, with no exit condition.","deprecated":true},"state_transitions":{"items":{"$ref":"#/components/schemas/ConversationTurnStateTransition"},"type":"array","title":"State Transitions","description":"Ordered context-graph state transitions that occurred during this turn.","default":[]},"available_actions":{"items":{"$ref":"#/components/schemas/ConversationTurnAvailableAction"},"type":"array","title":"Available Actions","description":"Action choices available in the turn's resolved context-graph state. Empty when actions cannot be resolved or the resolved state is not an action state.","default":[]},"dynamic_behavior":{"anyOf":[{"$ref":"#/components/schemas/AppliedBehavior"},{"type":"null"}],"description":"On an agent message, the dynamic behavior its reply was rendered with. Null when none was in force, and on user and system messages."}},"type":"object","required":["role","text"],"title":"ConversationTurn"},"ContentPartPayload":{"properties":{"type":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9._-]*$","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Text"},"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"provider_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Provider Id"},"metadata":{"additionalProperties":true,"type":"object","maxProperties":50,"title":"Metadata"}},"type":"object","title":"ContentPartPayload","description":"HTTP/WebSocket shape for a modality-neutral conversation content part."},"ConversationToolCallDetail":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"call_id":{"type":"string","title":"Call Id"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"result":{"type":"string","title":"Result","default":""},"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Succeeded","description":"Whether the tool call succeeded. Null when no result was recorded, for example while it still runs.","default":true},"duration_ms":{"anyOf":[{"type":"number","maximum":3600000,"minimum":0},{"type":"null"}],"title":"Duration Ms","description":"Wall-clock tool execution time in milliseconds, measured at the engage_step call site. Omitted (null) on legacy turns that did not capture timing."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Failure detail recorded for the tool call when ``succeeded`` is false. Null on successful calls or when no message was captured."}},"type":"object","required":["tool_name","call_id"],"title":"ConversationToolCallDetail"},"ClientArtifact":{"properties":{"type":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type"},"schema_version":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version"},"payload":{"$ref":"#/components/schemas/ClientArtifactPayload"}},"type":"object","required":["type","schema_version","payload"],"title":"ClientArtifact","description":"A versioned JSON payload that a client can render as a product component."},"ClientArtifactPayload":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"}]},"JsonValue":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"},{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}]},"ConversationTurnStateTransition":{"properties":{"from":{"type":"string","title":"From","description":"Source context-graph state before the turn's state transition."},"to":{"type":"string","title":"To","description":"Destination context-graph state after the turn's state transition."},"exit_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exit Condition","description":"The exit condition the agent took out of ``from``, as the context graph worded it when the hop was taken. Null on a hop out of an annotation state, which has no exit conditions, and on a hop recorded without one. Never read from the current graph."}},"type":"object","required":["from","to"],"title":"ConversationTurnStateTransition"},"ConversationTurnAvailableAction":{"properties":{"description":{"type":"string","title":"Description","description":"Human-readable description of an action available in the turn's state."}},"type":"object","required":["description"],"title":"ConversationTurnAvailableAction"},"AppliedBehavior":{"description":"The dynamic behavior an agent reply was rendered with.","properties":{"id":{"format":"uuid","title":"Id","type":"string"},"version":{"anyOf":[{"maximum":2147483647,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"The version of the behavior this reply ran with. Null on a reply recorded before behaviors were versioned.","title":"Version"},"name":{"maxLength":120,"title":"Name","type":"string"},"mode":{"$ref":"#/components/schemas/DynamicBehaviorMode"}},"required":["id","name","mode"],"title":"AppliedBehavior","type":"object"},"DynamicBehaviorMode":{"enum":["add","replace"],"type":"string"},"VoiceDetail":{"properties":{"recording_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Path"},"twilio_recording_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Twilio Recording Sid"},"twilio_recording_duration":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Twilio Recording Duration"},"has_recording":{"type":"boolean","title":"Has Recording","default":false},"barge_in_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Barge In Events","default":[]},"states_visited":{"items":{"type":"string"},"type":"array","title":"States Visited","default":[]},"participants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Participants","default":[]},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"call_analysis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Analysis"},"forwarding":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Forwarding"},"escalation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Escalation"},"safety":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safety"},"quality_breakdown":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Quality Breakdown"},"risk_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Risk Summary"},"latency_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Latency Summary"},"conversation_metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conversation Metrics"},"tool_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Summary"},"safety_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safety Summary"},"operator_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Operator Summary"},"safe_exit":{"anyOf":[{"$ref":"#/components/schemas/src__services__safe_exit_reader__SafeExit"},{"type":"null"}],"description":"The call's safe exit, from its ``call.minimal_risk`` event. Null when the call didn't take it."},"timeline":{"anyOf":[{"$ref":"#/components/schemas/ConversationTimeline"},{"type":"null"}],"description":"Where the call's lines sit in its recording, from the positions its turns carry, with the wait from each user message to the first reply. ``turn_index`` on its turns and segments is a position in this response's ``turns``, not a turn's own ``turn_index``, which counts exchanges. ``turn_id`` names that turn's exchange. A truncated read's timeline stops where its turns do. An agent line's span is from when its first audio was sent to when its last was, ahead of when the caller finished hearing it, so the timeline places no silence. Tool calls and state transitions record no position, so they stay on the turns. Null when no line has a recorded start and end."}},"type":"object","title":"VoiceDetail"},"src__services__safe_exit_reader__SafeExit":{"properties":{"trigger":{"type":"string","enum":["stt_fatal","turn_stalled","wire_failed","disclosure_failed","session_rejected","setup_failed","service_budget","caller_cap","outside_answer_hours","health_alert","data_residency_refused","attach_failed"],"title":"Trigger","description":"Why the call took the safe exit."},"outcome":{"type":"string","enum":["mrc_transferred","mrc_ended","mrc_failed"],"title":"Outcome","description":"``mrc_transferred`` once the hand-off to the human line was placed, ``mrc_failed`` when the hand-off raised\n(the caller may still be on the line), else ``mrc_ended`` (hung up). The conversation's ``completion_reason``\nreads these as ``transferred`` and ``error``."},"lines_played":{"items":{"type":"string","enum":["disclosure","transfer","end","fallback_missed","hearing_failure"]},"type":"array","title":"Lines Played","description":"The script lines that played whole, in order. ``disclosure`` is the AI and recording notice."},"disclosure_heard":{"type":"boolean","title":"Disclosure Heard","description":"The caller had heard all of the AI and recording notice before the exit began, so the exit did not\nplay it again. When false, the notice was heard only if ``lines_played`` holds ``disclosure``."},"trigger_description":{"type":"string","title":"Trigger Description","description":"``trigger`` in plain words.","readOnly":true}},"type":"object","required":["trigger","outcome","lines_played","disclosure_heard","trigger_description"],"title":"SafeExit","description":"The call's safe exit: the agent stopped and a fixed script handed the caller to a person or ended the call."},"ConversationTimeline":{"properties":{"turns":{"items":{"$ref":"#/components/schemas/TurnTimeline"},"type":"array","title":"Turns","description":"One entry per message whose speech has a recorded start and end: ``seek_to`` and ``active_start`` are where it starts and ``active_end`` where it ends, in seconds from the start of the recording."},"segments":{"items":{"$ref":"#/components/schemas/TimelineSegment"},"type":"array","title":"Segments","description":"Each placed line's speech (``caller_speech``, ``agent_speech``, ``filler``, or ``interrupted_speech`` for a reply the caller cut off; a filler stays ``filler`` when cut off, and its turn's ``filler_type`` and ``interrupted`` say both) and each ``processing_gap``: the wait from a user message's end to the first reply after it, when that reply started once the user had stopped. A line already playing when the user started answers an earlier message. Later lines start no wait: the caller had heard the agent, and an agent line's end is when its audio was sent, so the time after it isn't measured. A gap's ``e2e_ttfb_ms`` is the wait the caller heard, to the first filler that started after their line or to the reply. A wait is placed only where the user message, the reply and every line that played between them have a start and an end, so every gap ends at a line in ``turns``. Ordered by start, then end."},"avg_processing_gap_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Processing Gap Ms","description":"Mean of the placed processing gaps, in ms. Null when there are none."},"max_processing_gap_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Processing Gap Ms","description":"Longest placed processing gap, in ms. Null when there are none."},"avg_perceived_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Perceived Latency Ms","description":"Mean of the placed gaps' ``e2e_ttfb_ms``. Null when there are none."}},"type":"object","required":["turns","segments"],"title":"ConversationTimeline","description":"Where a voice call's lines sit in its recording, and the waits between them."},"TurnTimeline":{"properties":{"turn_index":{"type":"integer","title":"Turn Index","description":"The turn: its index in the response's ``turns`` on ``GET /conversations/{conversation_id}``,\nthe call-detail row the timeline was built from on ``GET /calls/{call_id}``."},"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"The conversation exchange the turn belongs to, its ``turn_id``. Set on\n``GET /conversations/{conversation_id}``, null on ``GET /calls/{call_id}`` and on a turn\nbefore the first exchange."},"seek_to":{"type":"number","title":"Seek To"},"active_start":{"type":"number","title":"Active Start"},"active_end":{"type":"number","title":"Active End"}},"type":"object","required":["turn_index","seek_to","active_start","active_end"],"title":"TurnTimeline"},"TimelineSegment":{"properties":{"type":{"type":"string","enum":["agent_speech","barge_in","caller_speech","filler","filler_hesitation","filler_nav","greeting","interrupted_speech","processing_gap","silence","silence_check","state_transition","tool_call"],"title":"Type"},"lane":{"type":"string","enum":["agent","caller","events","operator","system","tool"],"title":"Lane"},"track":{"anyOf":[{"type":"string","enum":["agent","caller","operator","system","tool"]},{"type":"null"}],"title":"Track","description":"Actor-semantic display track for the segment. Inferred for legacy producers."},"lane_id":{"anyOf":[{"type":"string","maxLength":160,"minLength":1},{"type":"null"}],"title":"Lane Id","description":"Canonical lane id. Must match PlaybackTimeline.lanes[].id after platform normalization."},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Order","description":"Canonical event order after platform time/lane normalization."},"actor":{"anyOf":[{"$ref":"#/components/schemas/TimelineActor"},{"type":"null"}],"description":"Actor responsible for the segment. Inferred for legacy producers."},"start":{"type":"number","title":"Start"},"end":{"type":"number","title":"End"},"label":{"type":"string","title":"Label"},"turn_index":{"type":"integer","title":"Turn Index","description":"The segment's turn: its index in the response's ``turns`` on\n``GET /conversations/{conversation_id}``, the call-detail row the timeline was built from on\n``GET /calls/{call_id}``, or -1 when no turn owns it (a silence, a barge-in)."},"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"The conversation exchange the segment's turn belongs to, its ``turn_id``. Set on\n``GET /conversations/{conversation_id}``, null on ``GET /calls/{call_id}`` and on segments no\nexchange owns."},"stt_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Confidence"},"eot_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eot Confidence"},"audio_window_start":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window Start"},"audio_window_end":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window End"},"engine_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Engine Ms"},"nav_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nav Ms"},"render_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Render Ms"},"audio_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Ttfb Ms"},"e2e_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"E2E Ttfb Ms"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"parent_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Call Id"},"integration_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Integration Name"},"endpoint_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Name"},"protocol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol"},"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Succeeded"},"duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Ms"},"from_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From State"},"to_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To State"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},"type":"object","required":["type","lane","start","end","label","turn_index"],"title":"TimelineSegment"},"TimelineActor":{"properties":{"kind":{"type":"string","enum":["agent","human","operator","system","tool"],"title":"Kind"},"role":{"type":"string","enum":["agent","caller","operator","runtime","state","tool"],"title":"Role"},"label":{"type":"string","title":"Label"},"participant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Id"}},"type":"object","required":["kind","role","label"],"title":"TimelineActor"},"RunManifest":{"properties":{"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"agent_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Version","description":"The agent version number the session loaded."},"context_graph_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Context Graph Id"},"context_graph_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Graph Version","description":"The context graph version number the session loaded. Null, with ``context_graph_id``, on a run of a direct\nprogram, which loads no graph."},"program_kind":{"anyOf":[{"type":"string","enum":["workflow","direct"]},{"type":"null"}],"title":"Program Kind","description":"What the session ran: ``workflow``, its service's context graph, or ``direct``, its agent version's own\nprompt and tools. Null on a run recorded before programs and on one whose engine failed to load."},"program_digest":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the canonical JSON of the direct program the session ran: its authored prompt as saved and\nits tool specs. Null on a workflow run, which its graph version identifies."},"version_set":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The service version set the session resolved its versions and models through, e.g. ``release``."},"platform_config_fingerprint":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the agent and graph version ids, the LLM model and, when the service pins dynamic\nbehaviors, each pinned set's id and version: one value per config generation."},"service_config_digest":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the canonical JSON (keys sorted, no whitespace, non-ASCII escaped) of the whole service\nconfig the session received: the service, its agent and graph versions and the behaviors its version set\npins. Any edit to that config moves it, where the fingerprint follows only the versions, the model and the\npins, so two runs that record the same digest received the same config. Null when the session loaded none."},"image_sha":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The build the session ran on: the commit the agent-engine image was built from."},"runtime_release_id":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The runtime release of the pod the session ran on."},"llm_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The model that wrote the agent's replies: the engage model, or the realtime model on gpt_realtime."},"temperature":{"anyOf":[{"type":"number","maximum":2,"minimum":0},{"type":"null"}],"title":"Temperature","description":"The sampling temperature the reply requests set. Null where they set none and the model's own\ndefault applies: every voice call, and a text run on a model family that takes none. On a\nreasoning model it rides only the requests that carry tools."},"engage_prompt_template_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the templates the reply prompt renders from. Null on gpt_realtime, whose\ninstructions aren't rendered from them."},"rendered_prompt_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"SHA256 of the opening rendered instructions, without normalization."},"prompt_renderer":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"Renderer that produced the recorded instructions."},"prompt_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"Model identifier submitted with these instructions; aliases are not resolved snapshots."},"navigation_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The model that chose each context-graph transition. Null on gpt_realtime, which doesn't navigate."},"navigation_prompt_template_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the templates each navigation decision renders from. Null on gpt_realtime."},"dynamic_behavior_prompt_template_hash":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"``sha256:`` over the template and fixed text each dynamic behavior decision renders from. Null on\ngpt_realtime, which runs no dynamic behavior, and when the service pins no enabled one."},"decider_kind":{"anyOf":[{"$ref":"#/components/schemas/DeciderKind"},{"type":"null"}],"description":"How the session's region decides: ``decisions``, OpenAI Decisions through the region's gateway.\nNavigation and the reply checks both decide through it."},"stt_provider":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The speech-to-text vendor the call ran on: the one it opened with, or the one it failed over\nto. Null on a text run."},"stt_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"tts_provider":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The vendor that voiced the call's replies. Null on a text run."},"tts_model":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"tts_language":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"The language the call's voice spoke: the one it opened in, or the caller's language once an\nin-house call switched to it. ``multilingual`` on a gpt_realtime call left to answer in the\ncaller's language. Null on a text run."},"emergency_floor_enforced":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Emergency Floor Enforced","description":"Whether the medical-emergency floor acted on what it caught, rather than only counting it."},"effect_shadow":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Effect Shadow","description":"Whether an in-house call also recorded each turn as effects, in shadow. Null off in-house voice."},"cooperative_stop":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cooperative Stop","description":"Whether an in-house call's teardown let its session stop on its own before cancelling it.\nNull off in-house voice."}},"type":"object","title":"RunManifest","description":"The configuration a run executed with: as its session started, and as it stood after\nany change the run made mid-way.\n\nA field is null when the session had nothing to record for it: a text run has no\nspeech models, and a gpt_realtime call whose engine failed to load has no agent or\ngraph version. Nothing here is read back from the service's current configuration."},"NameString":{"maxLength":256,"minLength":1,"type":"string"},"DeciderKind":{"type":"string","const":"decisions"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/conversations/{conversation_id}":{"get":{"tags":["conversations"],"summary":"Get conversation detail (voice or text)","operationId":"get_conversation_v1__workspace_id__conversations__conversation_id__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"include_tool_calls","in":"query","required":false,"schema":{"type":"boolean","description":"Include per-turn tool_calls[] in the returned turns. Off by default so the payload stays small and (potentially PHI-bearing) tool output is opt-in, matching POST /turns?include_tool_calls=true.","default":false,"title":"Include Tool Calls"},"description":"Include per-turn tool_calls[] in the returned turns. Off by default so the payload stays small and (potentially PHI-bearing) tool output is opt-in, matching POST /turns?include_tool_calls=true."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## DELETE /v1/{workspace\_id}/conversations/{conversation\_id}

> Close a conversation

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/conversations/{conversation_id}":{"delete":{"tags":["conversations"],"summary":"Close a conversation","operationId":"close_conversation_v1__workspace_id__conversations__conversation_id__delete","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"const":"playground","type":"string"},{"type":"null"}],"description":"Set to ``playground`` when the developer console Playground closes the conversation. Refused with 403 on a real conversation, one no Playground session or test credential started.","title":"Source"},"description":"Set to ``playground`` when the developer console Playground closes the conversation. Refused with 403 on a real conversation, one no Playground session or test credential started."}],"responses":{"204":{"description":"Successful Response"},"403":{"description":"A Playground or test-credential session may not close a real conversation"},"404":{"description":"Conversation not found"},"409":{"description":"Conversation is paused while an operator holds it, or changed state during the close"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## List conversation turns (voice or text)

> Page through the turns \`\`GET /conversations/{conversation\_id}\`\` returns, ordered by exchange (\`\`turn\_index\`\`) or by \`\`timestamp\`\`. The default \`\`+turn\_index\`\` starts with the messages before the first user turn; \`\`-turn\_index\`\` starts with the newest exchange and ends with them. Messages inside one exchange keep conversation order either way. A \`\`timestamp\`\` sort puts messages with no timestamp last in either direction. \`\`role\`\`, \`\`turn\_id\`\`, \`\`from\_turn\_index\`\`/\`\`to\_turn\_index\`\` and \`\`since\`\`/\`\`until\`\` narrow the list before it is ordered and paged, so repeat the same filters with each \`\`continuation\_token\`\`. Filters combine as AND; each of \`\`role\`\` and \`\`turn\_id\`\` is an OR across its values. Up to 500 turns per page. Turns are folded from the conversation's journal on each request rather than read from a table, so \`\`truncated\`\` matches the detail's flag. When it is true, the turns stop at the read bound, before the end of the conversation, in either sort order.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"_TurnRole":{"type":"string","enum":["agent","user","system"]},"ConversationTurnListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ConversationTurn"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"},"truncated":{"type":"boolean","title":"Truncated","description":"True when the conversation recorded more entries than one read takes (10,000), so the turns stop before the end of the conversation."}},"type":"object","required":["items","has_more","truncated"],"title":"ConversationTurnListResponse"},"ConversationTurn":{"properties":{"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"Stable identifier of the user exchange this message belongs to, derived deterministically from (conversation_id, turn_index) — identical across ``POST /turns`` responses and re-reads of the conversation history. User and agent messages from the same exchange share this value. Null on messages that precede the first user turn (proactive greetings, channel-event preludes)."},"turn_index":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Turn Index","description":"Zero-based ordinal of the user exchange this message belongs to (0 = first user turn). Derived server-side from the conversation's user-turn count — never stored. Null exactly when ``turn_id`` is null."},"engine_turn_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine Turn Id","description":"The agent engine's id for the turn this message opens (a user message) or answers (an agent message). One exchange can hold several engine turns, such as a tool call and the reply to its result. Null when no engine turn is recorded on the message: a filler line, a text reply, a channel event, or an older conversation that didn't record it."},"role":{"type":"string","enum":["agent","user","system"],"title":"Role"},"text":{"type":"string","title":"Text"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"The context-graph state of the conversation at this message: for a user message, the state it arrived in; for an agent message, the state after the turn's transitions. Null when the record names no state."},"speech_start_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech Start Ms","description":"Where this message's speech starts in the call's recording, in milliseconds from the start of the recording. A user message starts when the caller began speaking; an agent message when its first audio was sent, slightly before the caller heard it. Null when no position was recorded: text messages, agent lines that never played, and older calls that didn't record one."},"speech_end_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech End Ms","description":"Where this message's speech ends in the call's recording, in milliseconds from the start of the recording: when the caller stopped speaking, or when the agent line's last audio was sent. Null when no position was recorded, such as on a caller's line the call ended during."},"filler_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Type","description":"On an agent line the agent spoke while working on the reply, the kind of filler it was, such as ``receipt``, ``empathy`` or ``working``. Null on a reply and on user and system messages."},"interrupted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Interrupted","description":"On an agent line in a call, whether the caller cut it off, before or while it played. Null on user, system and text messages, and where the record doesn't say."},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelKind"},{"type":"null"}],"description":"Channel this turn occurred on. A conversation that switched channels has a self-describing per-turn history; null on turns written before per-turn attribution or on channel-less internal turns."},"content":{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","title":"Content","default":[]},"tool_calls":{"items":{"$ref":"#/components/schemas/ConversationToolCallDetail"},"type":"array","title":"Tool Calls","description":"Tool calls executed during this (agent) turn. Populated only when the request opts in via ``include_tool_calls=true``; empty otherwise and on turns that did not invoke tools.","default":[]},"artifacts":{"items":{"$ref":"#/components/schemas/ClientArtifact"},"type":"array","title":"Artifacts","description":"Validated client-safe outputs produced during this agent turn.","default":[]},"selected_action_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Action Description","description":"Description of the context-graph action selected for this turn. Null means no action was selected or no selected action was recorded."},"state_transition":{"anyOf":[{"$ref":"#/components/schemas/ConversationTurnStateTransition"},{"type":"null"}],"description":"Context-graph state transition that occurred during this turn. Null means no transition took place or no transition was recorded. Deprecated: use state_transitions instead. If multiple transitions were recorded, this field reports the first source state and final destination state, with no exit condition.","deprecated":true},"state_transitions":{"items":{"$ref":"#/components/schemas/ConversationTurnStateTransition"},"type":"array","title":"State Transitions","description":"Ordered context-graph state transitions that occurred during this turn.","default":[]},"available_actions":{"items":{"$ref":"#/components/schemas/ConversationTurnAvailableAction"},"type":"array","title":"Available Actions","description":"Action choices available in the turn's resolved context-graph state. Empty when actions cannot be resolved or the resolved state is not an action state.","default":[]},"dynamic_behavior":{"anyOf":[{"$ref":"#/components/schemas/AppliedBehavior"},{"type":"null"}],"description":"On an agent message, the dynamic behavior its reply was rendered with. Null when none was in force, and on user and system messages."}},"type":"object","required":["role","text"],"title":"ConversationTurn"},"ChannelKind":{"type":"string","enum":["voice","sms","whatsapp","email","web","imessage"],"title":"ChannelKind","description":"HSM execution channel type.\n\nDetermines how the HSM engine communicates with end users.\nEach kind maps to one or more providers."},"ContentPartPayload":{"properties":{"type":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9._-]*$","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Text"},"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"provider_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Provider Id"},"metadata":{"additionalProperties":true,"type":"object","maxProperties":50,"title":"Metadata"}},"type":"object","title":"ContentPartPayload","description":"HTTP/WebSocket shape for a modality-neutral conversation content part."},"ConversationToolCallDetail":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"call_id":{"type":"string","title":"Call Id"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"result":{"type":"string","title":"Result","default":""},"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Succeeded","description":"Whether the tool call succeeded. Null when no result was recorded, for example while it still runs.","default":true},"duration_ms":{"anyOf":[{"type":"number","maximum":3600000,"minimum":0},{"type":"null"}],"title":"Duration Ms","description":"Wall-clock tool execution time in milliseconds, measured at the engage_step call site. Omitted (null) on legacy turns that did not capture timing."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Failure detail recorded for the tool call when ``succeeded`` is false. Null on successful calls or when no message was captured."}},"type":"object","required":["tool_name","call_id"],"title":"ConversationToolCallDetail"},"ClientArtifact":{"properties":{"type":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type"},"schema_version":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version"},"payload":{"$ref":"#/components/schemas/ClientArtifactPayload"}},"type":"object","required":["type","schema_version","payload"],"title":"ClientArtifact","description":"A versioned JSON payload that a client can render as a product component."},"ClientArtifactPayload":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"}]},"JsonValue":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"},{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}]},"ConversationTurnStateTransition":{"properties":{"from":{"type":"string","title":"From","description":"Source context-graph state before the turn's state transition."},"to":{"type":"string","title":"To","description":"Destination context-graph state after the turn's state transition."},"exit_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exit Condition","description":"The exit condition the agent took out of ``from``, as the context graph worded it when the hop was taken. Null on a hop out of an annotation state, which has no exit conditions, and on a hop recorded without one. Never read from the current graph."}},"type":"object","required":["from","to"],"title":"ConversationTurnStateTransition"},"ConversationTurnAvailableAction":{"properties":{"description":{"type":"string","title":"Description","description":"Human-readable description of an action available in the turn's state."}},"type":"object","required":["description"],"title":"ConversationTurnAvailableAction"},"AppliedBehavior":{"description":"The dynamic behavior an agent reply was rendered with.","properties":{"id":{"format":"uuid","title":"Id","type":"string"},"version":{"anyOf":[{"maximum":2147483647,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"The version of the behavior this reply ran with. Null on a reply recorded before behaviors were versioned.","title":"Version"},"name":{"maxLength":120,"title":"Name","type":"string"},"mode":{"$ref":"#/components/schemas/DynamicBehaviorMode"}},"required":["id","name","mode"],"title":"AppliedBehavior","type":"object"},"DynamicBehaviorMode":{"enum":["add","replace"],"type":"string"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/conversations/{conversation_id}/turns":{"get":{"tags":["conversations"],"summary":"List conversation turns (voice or text)","description":"Page through the turns ``GET /conversations/{conversation_id}`` returns, ordered by exchange (``turn_index``) or by ``timestamp``. The default ``+turn_index`` starts with the messages before the first user turn; ``-turn_index`` starts with the newest exchange and ends with them. Messages inside one exchange keep conversation order either way. A ``timestamp`` sort puts messages with no timestamp last in either direction. ``role``, ``turn_id``, ``from_turn_index``/``to_turn_index`` and ``since``/``until`` narrow the list before it is ordered and paged, so repeat the same filters with each ``continuation_token``. Filters combine as AND; each of ``role`` and ``turn_id`` is an OR across its values. Up to 500 turns per page. Turns are folded from the conversation's journal on each request rather than read from a table, so ``truncated`` matches the detail's flag. When it is true, the turns stop at the read bound, before the end of the conversation, in either sort order.","operationId":"list_conversation_turns_v1__workspace_id__conversations__conversation_id__turns_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"include_tool_calls","in":"query","required":false,"schema":{"type":"boolean","description":"Include per-turn tool_calls[] in the returned turns. Off by default, matching GET /conversations/{conversation_id}?include_tool_calls=true.","default":false,"title":"Include Tool Calls"},"description":"Include per-turn tool_calls[] in the returned turns. Off by default, matching GET /conversations/{conversation_id}?include_tool_calls=true."},{"name":"role","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/_TurnRole"},"maxItems":3,"description":"Keep only messages with one of these roles. Repeat the parameter for several. Classic message types map to roles: ``user-message`` and ``external-message`` to ``user``; ``agent-message`` to ``agent``; ``system-message`` to ``system``. Empty keeps every role.","title":"Role"},"description":"Keep only messages with one of these roles. Repeat the parameter for several. Classic message types map to roles: ``user-message`` and ``external-message`` to ``user``; ``agent-message`` to ``agent``; ``system-message`` to ``system``. Empty keeps every role."},{"name":"turn_id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"description":"Keep only messages of these exchanges (the ``turn_id`` each message carries). Repeat the parameter for several. Combined with ``role`` as AND. Empty keeps every exchange.","title":"Turn Id"},"description":"Keep only messages of these exchanges (the ``turn_id`` each message carries). Repeat the parameter for several. Combined with ``role`` as AND. Empty keeps every exchange."},{"name":"from_turn_index","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Keep only messages of this exchange ordinal or later. Messages before the first user turn have no ordinal, so a range drops them.","title":"From Turn Index"},"description":"Keep only messages of this exchange ordinal or later. Messages before the first user turn have no ordinal, so a range drops them."},{"name":"to_turn_index","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Keep only messages of this exchange ordinal or earlier. Must not be below ``from_turn_index``.","title":"To Turn Index"},"description":"Keep only messages of this exchange ordinal or earlier. Must not be below ``from_turn_index``."},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Keep only messages stamped at or after this time. Messages with no timestamp are dropped.","title":"Since"},"description":"Keep only messages stamped at or after this time. Messages with no timestamp are dropped."},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Keep only messages stamped before this time. Must be after ``since``. Messages with no timestamp are dropped.","title":"Until"},"description":"Keep only messages stamped before this time. Must be after ``since``. Messages with no timestamp are dropped."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationTurnListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Send a message and get the agent's response

> Send a user message and receive the agent's response. Set \`Accept: text/event-stream\` to receive an SSE stream of typed \`TurnStreamEvent\` frames (token, tool\_call\_started, tool\_call\_completed, thinking, artifact, message, state\_transition, state, done, error) instead of the synchronous JSON response. For new integrations prefer \`POST /turns/stream\`, which is always SSE. While an operator holds the conversation, a turn is taken too: the message is recorded and the agent does not answer it, so \`output\` is empty unless the platform sends an automatic reply, and \`conversation.status\` is \`paused\`. The operator's own replies are not in a turn or poll response: read them with \`GET /conversations/{conversation\_id}/turns\`.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"TurnRequest":{"properties":{"message":{"type":"string","maxLength":10000,"title":"Message","description":"The user's message. Leave it empty (with no ``content`` or media) only to kick off a conversation that has no turns yet: the agent answers with its greeting. Once the conversation has a turn, a turn with no user input is a 422.","default":""},"content":{"anyOf":[{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","maxItems":20},{"type":"null"}],"title":"Content"},"media_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Media Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"context":{"anyOf":[{"type":"string","maxLength":100000},{"type":"null"}],"title":"Context","description":"Injected into the agent's prompt as caller/patient context for this turn."},"viewport_width":{"anyOf":[{"type":"integer","maximum":500,"minimum":20},{"type":"null"}],"title":"Viewport Width"},"viewport_height":{"anyOf":[{"type":"integer","maximum":500,"minimum":5},{"type":"null"}],"title":"Viewport Height"},"wait_for_final":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Wait For Final","description":"Synchronous callers only: when a turn hands work to a background tool (``background_pending``), await this turn's answer inline instead of returning the acknowledgement immediately. The turn and the wait share one budget of about 170 seconds, so give the request a client timeout of at least 180 seconds. The response carries the answers the turn's background work commits, in order, in place of the acknowledgement, so a tool that hands off to another returns both messages; ``background_pending=false`` means ``output`` is the turn's whole answer. Otherwise (time ran out, or an earlier turn's answer is still waiting to be collected) it returns what arrived, or the acknowledgement, with ``background_pending=true``; collect the rest with ``poll=true``, and poll before sending the next turn. Send an ``Idempotency-Key`` with every waiting turn: if your own timeout fires or the connection drops first, retry with the same key, and the retry returns the answers the turn already collected instead of running it again. ``null`` (default) inherits the channel policy (web = do not wait). Ignored with ``poll=true`` (422)."},"suppress_filler":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Suppress Filler","description":"Synchronous callers only: when a turn ends ``background_pending``, omit the filler/acknowledgement text from ``output`` so a batch caller never mistakes the ack for the answer (``output`` is empty; ``background_pending=true`` is the poll-later signal). Answers a ``wait_for_final`` wait collected still come back. ``null`` (default) inherits the channel policy. Ignored with ``poll=true`` (422)."},"source":{"anyOf":[{"type":"string","const":"playground"},{"type":"null"}],"title":"Source","description":"Set to ``playground`` on every turn the developer console Playground sends, polls included. A Playground turn on a real conversation, one no Playground session or test credential started, is refused with 403."}},"type":"object","title":"TurnRequest"},"ContentPartPayload":{"properties":{"type":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9._-]*$","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Text"},"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"provider_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Provider Id"},"metadata":{"additionalProperties":true,"type":"object","maxProperties":50,"title":"Metadata"}},"type":"object","title":"ContentPartPayload","description":"HTTP/WebSocket shape for a modality-neutral conversation content part."},"TurnResponse":{"properties":{"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"Identifier of the user exchange this turn created — or, for ``poll=true`` and greeting-kickoff turns (empty ``message``), the exchange the returned messages attach to. A background delivery keeps the originating exchange even when later user turns already exist. Deterministic: matches the ``turn_id`` on this conversation's history turns, so it can anchor durable per-turn artifacts (e.g. feedback) across page reloads. Null only when the conversation has no user exchange yet (a poll or kickoff before the first user message)."},"input":{"$ref":"#/components/schemas/ConversationTurn"},"output":{"items":{"$ref":"#/components/schemas/ConversationTurn"},"type":"array","title":"Output"},"tool_calls":{"items":{"$ref":"#/components/schemas/ConversationToolCallDetail"},"type":"array","title":"Tool Calls","default":[]},"artifacts":{"items":{"$ref":"#/components/schemas/ClientArtifact"},"type":"array","title":"Artifacts","default":[]},"conversation":{"$ref":"#/components/schemas/TurnConversationSnapshot"},"background_pending":{"type":"boolean","title":"Background Pending","description":"Whether this turn's ``output`` is the final answer, or only an acknowledgement that\nwork is still running in the background.\n\n``false`` (default): ``output`` is the complete agent response for this turn.\n\n``true``: a tool crossed the server's blocking window and was handed to a background\ntask, so ``output`` is NOT the final answer — the definitive assistant answer is\nproduced later, out-of-band. Under delivery protocol v2, collect it by re-issuing\n``POST …/turns`` with ``poll=true`` (a no-message, receipt-backed claim), render or\ndurably persist the returned answer, then acknowledge its exact delivery receipt.\nThis is the per-conversation delivery contract — see\nthe web-integration paved path. (``GET /v1/{workspace_id}/events/stream?conversation_id=``\nmirrors this activity as ``text.tool_started`` / ``text.background_result`` /\n``text.agent_message`` for a view watching this one conversation, but is not the\nper-chat delivery path. The stream without ``conversation_id`` carries none of it.) A\nclient that treats a ``background_pending=true`` turn as complete without polling and\nacknowledging will miss the final answer.","default":false},"delivery":{"anyOf":[{"$ref":"#/components/schemas/TurnDelivery"},{"type":"null"}],"description":"Receipt for a background result returned by ``poll=true``. Render the response successfully, then acknowledge this delivery. Null for ordinary turns and idle/pending polls."},"delivery_protocol_version":{"anyOf":[{"type":"integer","const":2},{"type":"null"}],"title":"Delivery Protocol Version","description":"Version of the durable background-delivery protocol supported by the serving agent. Clients may retry polls only after observing version 2."}},"type":"object","required":["turn_id","input","output","conversation"],"title":"TurnResponse"},"ConversationTurn":{"properties":{"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"Stable identifier of the user exchange this message belongs to, derived deterministically from (conversation_id, turn_index) — identical across ``POST /turns`` responses and re-reads of the conversation history. User and agent messages from the same exchange share this value. Null on messages that precede the first user turn (proactive greetings, channel-event preludes)."},"turn_index":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Turn Index","description":"Zero-based ordinal of the user exchange this message belongs to (0 = first user turn). Derived server-side from the conversation's user-turn count — never stored. Null exactly when ``turn_id`` is null."},"engine_turn_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine Turn Id","description":"The agent engine's id for the turn this message opens (a user message) or answers (an agent message). One exchange can hold several engine turns, such as a tool call and the reply to its result. Null when no engine turn is recorded on the message: a filler line, a text reply, a channel event, or an older conversation that didn't record it."},"role":{"type":"string","enum":["agent","user","system"],"title":"Role"},"text":{"type":"string","title":"Text"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"The context-graph state of the conversation at this message: for a user message, the state it arrived in; for an agent message, the state after the turn's transitions. Null when the record names no state."},"speech_start_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech Start Ms","description":"Where this message's speech starts in the call's recording, in milliseconds from the start of the recording. A user message starts when the caller began speaking; an agent message when its first audio was sent, slightly before the caller heard it. Null when no position was recorded: text messages, agent lines that never played, and older calls that didn't record one."},"speech_end_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speech End Ms","description":"Where this message's speech ends in the call's recording, in milliseconds from the start of the recording: when the caller stopped speaking, or when the agent line's last audio was sent. Null when no position was recorded, such as on a caller's line the call ended during."},"filler_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Type","description":"On an agent line the agent spoke while working on the reply, the kind of filler it was, such as ``receipt``, ``empathy`` or ``working``. Null on a reply and on user and system messages."},"interrupted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Interrupted","description":"On an agent line in a call, whether the caller cut it off, before or while it played. Null on user, system and text messages, and where the record doesn't say."},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelKind"},{"type":"null"}],"description":"Channel this turn occurred on. A conversation that switched channels has a self-describing per-turn history; null on turns written before per-turn attribution or on channel-less internal turns."},"content":{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","title":"Content","default":[]},"tool_calls":{"items":{"$ref":"#/components/schemas/ConversationToolCallDetail"},"type":"array","title":"Tool Calls","description":"Tool calls executed during this (agent) turn. Populated only when the request opts in via ``include_tool_calls=true``; empty otherwise and on turns that did not invoke tools.","default":[]},"artifacts":{"items":{"$ref":"#/components/schemas/ClientArtifact"},"type":"array","title":"Artifacts","description":"Validated client-safe outputs produced during this agent turn.","default":[]},"selected_action_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Action Description","description":"Description of the context-graph action selected for this turn. Null means no action was selected or no selected action was recorded."},"state_transition":{"anyOf":[{"$ref":"#/components/schemas/ConversationTurnStateTransition"},{"type":"null"}],"description":"Context-graph state transition that occurred during this turn. Null means no transition took place or no transition was recorded. Deprecated: use state_transitions instead. If multiple transitions were recorded, this field reports the first source state and final destination state, with no exit condition.","deprecated":true},"state_transitions":{"items":{"$ref":"#/components/schemas/ConversationTurnStateTransition"},"type":"array","title":"State Transitions","description":"Ordered context-graph state transitions that occurred during this turn.","default":[]},"available_actions":{"items":{"$ref":"#/components/schemas/ConversationTurnAvailableAction"},"type":"array","title":"Available Actions","description":"Action choices available in the turn's resolved context-graph state. Empty when actions cannot be resolved or the resolved state is not an action state.","default":[]},"dynamic_behavior":{"anyOf":[{"$ref":"#/components/schemas/AppliedBehavior"},{"type":"null"}],"description":"On an agent message, the dynamic behavior its reply was rendered with. Null when none was in force, and on user and system messages."}},"type":"object","required":["role","text"],"title":"ConversationTurn"},"ChannelKind":{"type":"string","enum":["voice","sms","whatsapp","email","web","imessage"],"title":"ChannelKind","description":"HSM execution channel type.\n\nDetermines how the HSM engine communicates with end users.\nEach kind maps to one or more providers."},"ConversationToolCallDetail":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"call_id":{"type":"string","title":"Call Id"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"result":{"type":"string","title":"Result","default":""},"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Succeeded","description":"Whether the tool call succeeded. Null when no result was recorded, for example while it still runs.","default":true},"duration_ms":{"anyOf":[{"type":"number","maximum":3600000,"minimum":0},{"type":"null"}],"title":"Duration Ms","description":"Wall-clock tool execution time in milliseconds, measured at the engage_step call site. Omitted (null) on legacy turns that did not capture timing."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Failure detail recorded for the tool call when ``succeeded`` is false. Null on successful calls or when no message was captured."}},"type":"object","required":["tool_name","call_id"],"title":"ConversationToolCallDetail"},"ClientArtifact":{"properties":{"type":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type"},"schema_version":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version"},"payload":{"$ref":"#/components/schemas/ClientArtifactPayload"}},"type":"object","required":["type","schema_version","payload"],"title":"ClientArtifact","description":"A versioned JSON payload that a client can render as a product component."},"ClientArtifactPayload":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"}]},"JsonValue":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"},{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}]},"ConversationTurnStateTransition":{"properties":{"from":{"type":"string","title":"From","description":"Source context-graph state before the turn's state transition."},"to":{"type":"string","title":"To","description":"Destination context-graph state after the turn's state transition."},"exit_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exit Condition","description":"The exit condition the agent took out of ``from``, as the context graph worded it when the hop was taken. Null on a hop out of an annotation state, which has no exit conditions, and on a hop recorded without one. Never read from the current graph."}},"type":"object","required":["from","to"],"title":"ConversationTurnStateTransition"},"ConversationTurnAvailableAction":{"properties":{"description":{"type":"string","title":"Description","description":"Human-readable description of an action available in the turn's state."}},"type":"object","required":["description"],"title":"ConversationTurnAvailableAction"},"AppliedBehavior":{"description":"The dynamic behavior an agent reply was rendered with.","properties":{"id":{"format":"uuid","title":"Id","type":"string"},"version":{"anyOf":[{"maximum":2147483647,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"The version of the behavior this reply ran with. Null on a reply recorded before behaviors were versioned.","title":"Version"},"name":{"maxLength":120,"title":"Name","type":"string"},"mode":{"$ref":"#/components/schemas/DynamicBehaviorMode"}},"required":["id","name","mode"],"title":"AppliedBehavior","type":"object"},"DynamicBehaviorMode":{"enum":["add","replace"],"type":"string"},"TurnConversationSnapshot":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","enum":["active","closed","completed","in-progress","failed","paused"],"title":"Status"},"turn_count":{"type":"integer","title":"Turn Count","default":0},"updated_at":{"type":"string","title":"Updated At"},"context_graph_state":{"anyOf":[{"$ref":"#/components/schemas/ContextGraphState-Output"},{"type":"null"}]}},"type":"object","required":["id","status","updated_at"],"title":"TurnConversationSnapshot"},"ContextGraphState-Output":{"oneOf":[{"$ref":"#/components/schemas/ActionState-Output"},{"$ref":"#/components/schemas/DecisionState-Output"},{"$ref":"#/components/schemas/AnnotationState"},{"$ref":"#/components/schemas/DataCollectionState-Output"}],"discriminator":{"propertyName":"type","mapping":{"action":"#/components/schemas/ActionState-Output","annotation":"#/components/schemas/AnnotationState","data_collection":"#/components/schemas/DataCollectionState-Output","decision":"#/components/schemas/DecisionState-Output"}}},"ActionState-Output":{"properties":{"type":{"type":"string","const":"action","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"actions":{"items":{"$ref":"#/components/schemas/Action"},"type":"array","title":"Actions"},"intra_state_navigation_guidelines":{"items":{"type":"string"},"type":"array","title":"Intra State Navigation Guidelines"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines"},"boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Boundary Constraints"},"exit_conditions":{"items":{"$ref":"#/components/schemas/ExitCondition"},"type":"array","title":"Exit Conditions"},"action_tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Action Tool Call Specs","default":[]},"exit_condition_tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Exit Condition Tool Call Specs","default":[]},"wait_for":{"anyOf":[{"type":"string","enum":["surface_submission","human_approval"]},{"type":"null"}],"title":"Wait For"},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"surface_spec_template":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Surface Spec Template"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]}},"type":"object","required":["type","name","objective","actions","intra_state_navigation_guidelines","action_guidelines","boundary_constraints","exit_conditions"],"title":"ActionState","description":"User-facing engagement state with actions and exit conditions."},"Action":{"properties":{"description":{"type":"string","title":"Description"},"filler_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Hint"}},"type":"object","required":["description"],"title":"Action","description":"A single action the agent can take within a state."},"ExitCondition":{"properties":{"description":{"type":"string","title":"Description"},"next_state":{"type":"string","title":"Next State"},"filler_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Hint"}},"type":"object","required":["description","next_state"],"title":"ExitCondition"},"ToolCallSpec":{"properties":{"tool_id":{"type":"string","title":"Tool Id"},"additional_instruction":{"type":"string","title":"Additional Instruction","default":""},"navigate_on_completion":{"type":"boolean","title":"Navigate On Completion","default":false},"progress":{"anyOf":[{"$ref":"#/components/schemas/ProgressHint"},{"type":"null"}]},"result_persistence":{"type":"string","enum":["accumulate","override","ephemeral"],"title":"Result Persistence","description":"How this tool call's arguments and result are retained. 'ephemeral' is fail-closed: Platform API authoring must be enabled for the workspace, and Agent Engine honors it only on the inline text/simulation path — voice, background, and external-realtime sessions reject an ephemeral graph at init rather than journal it.","default":"accumulate"},"expects_code":{"type":"boolean","title":"Expects Code","default":false},"delivery":{"type":"string","enum":["interrupt","queue"],"title":"Delivery","default":"interrupt"},"failure_delivery":{"anyOf":[{"type":"string","enum":["interrupt","queue"]},{"type":"null"}],"title":"Failure Delivery"},"failure_delivery_by_class":{"anyOf":[{"additionalProperties":{"type":"string","enum":["interrupt","queue"]},"propertyNames":{"$ref":"#/components/schemas/FailureClass"},"type":"object"},{"type":"null"}],"title":"Failure Delivery By Class"},"execution":{"type":"string","enum":["blocking","background"],"title":"Execution","default":"blocking"},"lifecycle":{"type":"string","enum":["coupled","independent"],"title":"Lifecycle","default":"independent"},"context_bindings":{"items":{"type":"string"},"type":"array","title":"Context Bindings"},"context_binding_aliases":{"additionalProperties":{"$ref":"#/components/schemas/SlugString"},"propertyNames":{"maxLength":128,"minLength":1},"type":"object","title":"Context Binding Aliases"},"audio_fillers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Audio Fillers"},"audio_filler_triggered_after":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Filler Triggered After"}},"type":"object","required":["tool_id"],"title":"ToolCallSpec","description":"A tool call that the agent can make in a state."},"ProgressHint":{"properties":{"deterministic":{"type":"boolean","title":"Deterministic","default":false},"phrases":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"description":"Filler phrases. deterministic=true: played verbatim in order. deterministic=false: used as hints for early attempts."},{"type":"null"}],"title":"Phrases"},"trigger_delay_ms":{"anyOf":[{"type":"integer","maximum":30000,"minimum":0},{"type":"null"}],"title":"Trigger Delay Ms"},"interval_ms":{"anyOf":[{"type":"integer","maximum":30000,"minimum":100},{"type":"null"}],"title":"Interval Ms"},"mode":{"type":"string","enum":["auto","silent","backchannel","verbal"],"title":"Mode","default":"auto"},"progress_class":{"anyOf":[{"type":"string","enum":["lookup","write","external_call","compute","multi_step"]},{"type":"null"}],"title":"Progress Class"},"expected_latency_ms":{"anyOf":[{"type":"integer","maximum":60000,"minimum":0},{"type":"null"}],"title":"Expected Latency Ms"},"custom_phrase":{"anyOf":[{"type":"string","maxLength":500,"description":"Legacy: use phrases instead."},{"type":"null"}],"title":"Custom Phrase"}},"additionalProperties":false,"type":"object","title":"ProgressHint","description":"How the agent narrates waiting on a tool.\n\n``deterministic=true``: scripted — ``phrases`` play verbatim in order.\n``deterministic=false``: engine picks — ``phrases`` are hints.\n``trigger_delay_ms``: milliseconds before first filler (0 = immediate).\n``interval_ms``: milliseconds between subsequent fillers."},"FailureClass":{"type":"string","enum":["timeout","input_rejected","rounds_exhausted","generic"],"title":"FailureClass","description":"Why a tool result is a failure — produced by the executor at RUN time.\n\nUnlike ``ResultDelivery`` (a fixed config-time axis), this is a runtime\nclassification the executor knows at the moment of failure. It flavors the\nagent-facing failure wording and the world-event / status-tool observability,\nand it is ALSO an optional routing key: a state x tool binding may set\n``ToolCallSpec.failure_delivery_by_class`` to deliver differently per class\n(e.g. interrupt on timeout, queue on a generic error). With no per-class map\n(the default), failed results route by the ``failure_delivery`` floor,\nunchanged. Add a member only in the same change that wires a producer for it —\nadding one also widens the per-class routing surface, so it must be a\ndeliberate, produced class."},"SlugString":{"type":"string","maxLength":63,"minLength":2,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$"},"Guardrail":{"properties":{"name":{"type":"string","maxLength":128,"title":"Name"},"description":{"type":"string","maxLength":1000,"title":"Description"},"enforcement":{"type":"string","enum":["hard","soft"],"title":"Enforcement","default":"hard"}},"type":"object","required":["name","description"],"title":"Guardrail","description":"Typed safety rule enforced per-state (not just global freetext guidelines)."},"ChannelOverride":{"properties":{"objective":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines","default":[]},"progress":{"anyOf":[{"$ref":"#/components/schemas/ProgressHint"},{"type":"null"}]}},"type":"object","title":"ChannelOverride","description":"Per-channel behavior override for a state."},"TurnPolicy":{"properties":{"barge_in_enabled":{"type":"boolean","title":"Barge In Enabled","default":true},"context_strategy":{"type":"string","enum":["full","compact"],"title":"Context Strategy","default":"full"},"degradation_threshold":{"type":"integer","minimum":-1,"title":"Degradation Threshold","default":-1},"block_forward_call":{"type":"boolean","title":"Block Forward Call","default":false},"block_forward_call_after_turns":{"type":"integer","minimum":-1,"title":"Block Forward Call After Turns","default":-1},"stt_eot_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Eot Threshold"},"stt_eager_eot_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Eager Eot Threshold"},"stt_eot_timeout_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stt Eot Timeout Ms"}},"type":"object","title":"TurnPolicy","description":"Voice pipeline parameters declared per HSM state.\n\nLives on ActionState/DecisionState alongside guardrails, wait_for, and\nchannel_overrides.  The HSM state IS the policy — no shadow state machine.\nAll fields optional with safe defaults (production behavior unchanged\nwhen no turn_policy is set)."},"DecisionState-Output":{"properties":{"type":{"type":"string","const":"decision","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"exit_conditions":{"items":{"$ref":"#/components/schemas/ExitCondition"},"type":"array","title":"Exit Conditions"},"decision_guidelines":{"items":{"type":"string"},"type":"array","title":"Decision Guidelines","default":[]},"tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Tool Call Specs","default":[]},"wait_for":{"anyOf":[{"type":"string","enum":["surface_submission","human_approval"]},{"type":"null"}],"title":"Wait For"},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]}},"type":"object","required":["type","name","objective","exit_conditions"],"title":"DecisionState","description":"Passthrough routing state — Agent picks an exit condition, no user interaction."},"AnnotationState":{"properties":{"type":{"type":"string","const":"annotation","title":"Type"},"name":{"type":"string","title":"Name"},"inner_thought":{"type":"string","title":"Inner Thought"},"next_state":{"type":"string","title":"Next State"}},"type":"object","required":["type","name","inner_thought","next_state"],"title":"AnnotationState","description":"Injects a hardcoded inner thought (no LLM call)."},"DataCollectionState-Output":{"properties":{"type":{"type":"string","const":"data_collection","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"fields":{"items":{"$ref":"#/components/schemas/CollectionField"},"type":"array","title":"Fields"},"on_complete":{"type":"string","title":"On Complete"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines","default":[]},"boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Boundary Constraints","default":[]},"surface_fallback":{"type":"boolean","title":"Surface Fallback","default":false},"surface_fallback_after_turns":{"type":"integer","title":"Surface Fallback After Turns","default":6},"max_turns":{"type":"integer","title":"Max Turns","default":10},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]},"tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Tool Call Specs","default":[]}},"type":"object","required":["type","name","objective","fields","on_complete"],"title":"DataCollectionState","description":"Structured voice/text data collection with field tracking.\n\nThe engine presents fields conversationally, tracks completion, and\noptionally falls back to a Surface form after N turns. Each collected\nfield produces a world event with confidence 0.5."},"CollectionField":{"properties":{"key":{"type":"string","title":"Key"},"type":{"type":"string","title":"Type"},"label":{"type":"string","title":"Label"},"required":{"type":"boolean","title":"Required","default":true},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"validation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validation"},"ask_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ask Prompt"},"fhir_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Path"}},"type":"object","required":["key","type","label"],"title":"CollectionField","description":"A single field to collect during a data collection state."},"TurnDelivery":{"properties":{"delivery_id":{"type":"string","format":"uuid","title":"Delivery Id","description":"Stable identifier for this background delivery."},"request_id":{"type":"string","format":"uuid","title":"Request Id","description":"Stable poll request identifier bound to this claim."},"receipt":{"type":"string","format":"uuid","title":"Receipt","description":"Opaque receipt required to acknowledge this delivery."}},"type":"object","required":["delivery_id","request_id","receipt"],"title":"TurnDelivery"},"TurnStreamEvent":{"discriminator":{"mapping":{"artifact":"#/components/schemas/TurnArtifactEvent","done":"#/components/schemas/TurnDoneEvent","error":"#/components/schemas/TurnErrorEvent","message":"#/components/schemas/TurnMessageEvent","state":"#/components/schemas/TurnStateEvent","state_transition":"#/components/schemas/TurnStateTransitionEvent","thinking":"#/components/schemas/TurnThinkingEvent","token":"#/components/schemas/TurnTokenEvent","tool_call_completed":"#/components/schemas/TurnToolCallCompletedEvent","tool_call_started":"#/components/schemas/TurnToolCallStartedEvent"},"propertyName":"event"},"oneOf":[{"$ref":"#/components/schemas/TurnTokenEvent"},{"$ref":"#/components/schemas/TurnArtifactEvent"},{"$ref":"#/components/schemas/TurnToolCallStartedEvent"},{"$ref":"#/components/schemas/TurnToolCallCompletedEvent"},{"$ref":"#/components/schemas/TurnThinkingEvent"},{"$ref":"#/components/schemas/TurnMessageEvent"},{"$ref":"#/components/schemas/TurnStateTransitionEvent"},{"$ref":"#/components/schemas/TurnStateEvent"},{"$ref":"#/components/schemas/TurnDoneEvent"},{"$ref":"#/components/schemas/TurnErrorEvent"}]},"TurnTokenEvent":{"properties":{"event":{"const":"token","default":"token","title":"Event","type":"string"},"text":{"title":"Text","type":"string"}},"required":["text"],"title":"TurnTokenEvent","type":"object"},"TurnArtifactEvent":{"properties":{"event":{"const":"artifact","default":"artifact","title":"Event","type":"string"},"type":{"maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type","type":"string"},"schema_version":{"maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version","type":"string"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Payload"}},"required":["type","schema_version","payload"],"title":"TurnArtifactEvent","type":"object"},"TurnToolCallStartedEvent":{"properties":{"event":{"const":"tool_call_started","default":"tool_call_started","title":"Event","type":"string"},"tool_name":{"maxLength":256,"title":"Tool Name","type":"string"},"call_id":{"maxLength":256,"title":"Call Id","type":"string"},"input":{"title":"Input","type":"string"}},"required":["tool_name","call_id","input"],"title":"TurnToolCallStartedEvent","type":"object"},"TurnToolCallCompletedEvent":{"properties":{"event":{"const":"tool_call_completed","default":"tool_call_completed","title":"Event","type":"string"},"tool_name":{"maxLength":256,"title":"Tool Name","type":"string"},"call_id":{"maxLength":256,"title":"Call Id","type":"string"},"result":{"title":"Result","type":"string"},"succeeded":{"title":"Succeeded","type":"boolean"},"duration_ms":{"anyOf":[{"maximum":3600000,"minimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Wall-clock tool execution time in milliseconds, measured at the engage_step call site. Null when the upstream did not report timing (legacy/test paths).","title":"Duration Ms"}},"required":["tool_name","call_id","result","succeeded"],"title":"TurnToolCallCompletedEvent","type":"object"},"TurnThinkingEvent":{"properties":{"event":{"const":"thinking","default":"thinking","title":"Event","type":"string"},"tier":{"title":"Tier","type":"integer"},"tier_name":{"title":"Tier Name","type":"string"}},"required":["tier","tier_name"],"title":"TurnThinkingEvent","type":"object"},"TurnMessageEvent":{"properties":{"event":{"const":"message","default":"message","title":"Event","type":"string"},"role":{"title":"Role","type":"string"},"text":{"title":"Text","type":"string"}},"required":["role","text"],"title":"TurnMessageEvent","type":"object"},"TurnStateTransitionEvent":{"description":"One context-graph hop the turn took.\n\nOne frame per hop, in the order the turn took them, after the turn's ``message``\nframes. These are the hops ``POST /turns`` returns on ``output[0].state_transitions``.","properties":{"event":{"const":"state_transition","default":"state_transition","title":"Event","type":"string"},"from_state":{"title":"From State","type":"string"},"to_state":{"title":"To State","type":"string"},"exit_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The exit condition the agent took out of ``from_state``, as the context graph words it. Null on a hop out of an annotation state, which has no exit conditions.","title":"Exit Condition"}},"required":["from_state","to_state"],"title":"TurnStateTransitionEvent","type":"object"},"TurnStateEvent":{"description":"The conversation's context-graph state after the turn.\n\nSent on every turn, after any ``state_transition`` frames and before ``done``. It is\nthe state ``POST /turns`` returns on ``conversation.context_graph_state``.","properties":{"event":{"const":"state","default":"state","title":"Event","type":"string"},"context_graph_state":{"$ref":"#/components/schemas/ContextGraphState-Output"}},"required":["context_graph_state"],"title":"TurnStateEvent","type":"object"},"TurnDoneEvent":{"properties":{"event":{"const":"done","default":"done","title":"Event","type":"string"},"conversation_id":{"format":"uuid","title":"Conversation Id","type":"string"},"status":{"title":"Status","type":"string"},"turn_count":{"title":"Turn Count","type":"integer"},"background_pending":{"default":false,"description":"True when the streamed response is only an acknowledgement and the final assistant answer must be collected with the durable background-delivery protocol.","title":"Background Pending","type":"boolean"},"delivery_protocol_version":{"anyOf":[{"const":2,"type":"integer"},{"type":"null"}],"default":null,"description":"Version of the durable background-delivery protocol supported by the serving agent. Clients may retry receipt-backed polls only after observing version 2.","title":"Delivery Protocol Version"},"turn_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"description":"Identifier of the user exchange this turn belongs to — identical to the ``turn_id`` on the non-streaming ``POST /turns`` response and on this conversation's history turns, so a streaming client can anchor durable per-turn artifacts (e.g. feedback) without a follow-up read. Stamped by platform-api at the proxy boundary (agent-engine frames do not carry it). Null when the conversation has no user exchange yet (a greeting kickoff stream on a fresh conversation).","title":"Turn Id"},"turn_index":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Zero-based ordinal of the user exchange (0 = first user turn). Derived server-side; null exactly when ``turn_id`` is null.","title":"Turn Index"}},"required":["conversation_id","status","turn_count"],"title":"TurnDoneEvent","type":"object"},"TurnErrorEvent":{"description":"Terminal error frame on the turn stream.\n\nCarries a stable ``code`` so SDK consumers can branch deterministically\nwithout parsing free-form ``message`` text. ``retryable`` tells the\nconsumer whether issuing the same turn again is likely to succeed.\n``status_code`` is the upstream HTTP status when the error originated\nfrom a downstream service (agent-engine), and is otherwise omitted.","properties":{"event":{"const":"error","default":"error","title":"Event","type":"string"},"message":{"title":"Message","type":"string"},"code":{"default":"unknown","enum":["upstream_error","stream_interrupted","client_error","unknown"],"title":"Code","type":"string"},"retryable":{"default":false,"title":"Retryable","type":"boolean"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Status Code"}},"required":["message"],"title":"TurnErrorEvent","type":"object"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/conversations/{conversation_id}/turns":{"post":{"tags":["conversations"],"summary":"Send a message and get the agent's response","description":"Send a user message and receive the agent's response. Set `Accept: text/event-stream` to receive an SSE stream of typed `TurnStreamEvent` frames (token, tool_call_started, tool_call_completed, thinking, artifact, message, state_transition, state, done, error) instead of the synchronous JSON response. For new integrations prefer `POST /turns/stream`, which is always SSE. While an operator holds the conversation, a turn is taken too: the message is recorded and the agent does not answer it, so `output` is empty unless the platform sends an automatic reply, and `conversation.status` is `paused`. The operator's own replies are not in a turn or poll response: read them with `GET /conversations/{conversation_id}/turns`.","operationId":"create_turn_v1__workspace_id__conversations__conversation_id__turns_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"include_tool_calls","in":"query","required":false,"schema":{"type":"boolean","description":"Include tool call details in response","default":false,"title":"Include Tool Calls"},"description":"Include tool call details in response"},{"name":"poll","in":"query","required":false,"schema":{"type":"boolean","description":"Poll for a background result without sending a user message. Protocol v2 claims at most one ready answer and returns an opaque delivery receipt; render or durably persist the answer, then acknowledge that receipt. Returns empty output when nothing is ready. Must NOT be combined with a request-body ``message`` (422) or SSE streaming (422). Poll no more than once every ~5s per conversation. A conversation that isn't active answers a poll 409.","default":false,"title":"Poll"},"description":"Poll for a background result without sending a user message. Protocol v2 claims at most one ready answer and returns an opaque delivery receipt; render or durably persist the answer, then acknowledge that receipt. Returns empty output when nothing is ready. Must NOT be combined with a request-body ``message`` (422) or SSE streaming (422). Poll no more than once every ~5s per conversation. A conversation that isn't active answers a poll 409."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Stable UUID for replaying the same logical send or poll after an ambiguous failure. Reuse the same value only for that operation. Omission is backward-compatible but cannot provide client-controlled response-loss replay.","title":"Idempotency-Key"},"description":"Stable UUID for replaying the same logical send or poll after an ambiguous failure. Reuse the same value only for that operation. Omission is backward-compatible but cannot provide client-controlled response-loss replay."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnResponse"}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/TurnStreamEvent"}}}},"403":{"description":"The caller may not take this turn, such as an external user without the `conversations:turn` scope, asking for tool calls, or whose session is no longer active, or a Playground or test-credential session on a real conversation"},"404":{"description":"Conversation or service not found"},"409":{"description":"Conversation isn't active (it is closed, completed or failed, or an operator took it over under an older release and has not handed it back) or is busy, or the Idempotency-Key was used for a different turn"},"422":{"description":"The request is invalid, an empty kickoff turn comes after the conversation started, or the conversation's service binding is missing or corrupt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"429":{"description":"Rate limited"},"502":{"description":"Agent service failed the turn, its reply was lost or couldn't be read, or the conversation couldn't be read back after the turn"},"503":{"description":"Agent service couldn't be reached, so the turn didn't start, or the turn can't be taken right now. Retry with the same Idempotency-Key"},"504":{"description":"Agent service did not respond in time. The turn may still finish: retry with the same Idempotency-Key"}}}}}}
```

## POST /v1/{workspace\_id}/conversations/{conversation\_id}/turns/{delivery\_id}/ack

> Acknowledge a rendered background turn delivery

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"TurnDeliveryAckRequest":{"properties":{"request_id":{"type":"string","format":"uuid","title":"Request Id"},"receipt":{"type":"string","format":"uuid","title":"Receipt"},"source":{"anyOf":[{"type":"string","const":"playground"},{"type":"null"}],"title":"Source","description":"Set to ``playground`` when the developer console Playground acknowledges the delivery. Refused with 403 on a real conversation, one no Playground session or test credential started."}},"additionalProperties":false,"type":"object","required":["request_id","receipt"],"title":"TurnDeliveryAckRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/conversations/{conversation_id}/turns/{delivery_id}/ack":{"post":{"tags":["conversations"],"summary":"Acknowledge a rendered background turn delivery","operationId":"acknowledge_turn_delivery_v1__workspace_id__conversations__conversation_id__turns__delivery_id__ack_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Delivery Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnDeliveryAckRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Send a message and receive a streamed agent response

> Streaming variant of \`POST /turns\`. Always returns \`text/event-stream\` regardless of the \`Accept\` header — no JSON fallback. Each frame is a \`TurnStreamEvent\` discriminated by the \`event\` field (token, tool\_call\_started, tool\_call\_completed, thinking, artifact, message, state\_transition, state, done, error). Right before \`done\`, a turn sends a \`state\_transition\` frame per context-graph hop it took, then a \`state\` frame with the state it ended in. A turn refused before its first frame, such as a retry whose \`Idempotency-Key\` was used for a different turn, gets the same JSON error as \`POST /turns\` instead of a stream. While an operator holds the conversation, a turn is taken as \`POST /turns\` takes it: the message is recorded and the agent does not answer it, so the stream ends in \`done\` with status \`paused\` and no \`message\` frame, unless the platform sends an automatic reply. The operator's own replies are not streamed: read them with \`GET /conversations/{conversation\_id}/turns\`. Use this endpoint for new integrations; the \`Accept\`-sniffing variant remains for backward compatibility.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"TurnRequest":{"properties":{"message":{"type":"string","maxLength":10000,"title":"Message","description":"The user's message. Leave it empty (with no ``content`` or media) only to kick off a conversation that has no turns yet: the agent answers with its greeting. Once the conversation has a turn, a turn with no user input is a 422.","default":""},"content":{"anyOf":[{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","maxItems":20},{"type":"null"}],"title":"Content"},"media_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Media Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"context":{"anyOf":[{"type":"string","maxLength":100000},{"type":"null"}],"title":"Context","description":"Injected into the agent's prompt as caller/patient context for this turn."},"viewport_width":{"anyOf":[{"type":"integer","maximum":500,"minimum":20},{"type":"null"}],"title":"Viewport Width"},"viewport_height":{"anyOf":[{"type":"integer","maximum":500,"minimum":5},{"type":"null"}],"title":"Viewport Height"},"wait_for_final":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Wait For Final","description":"Synchronous callers only: when a turn hands work to a background tool (``background_pending``), await this turn's answer inline instead of returning the acknowledgement immediately. The turn and the wait share one budget of about 170 seconds, so give the request a client timeout of at least 180 seconds. The response carries the answers the turn's background work commits, in order, in place of the acknowledgement, so a tool that hands off to another returns both messages; ``background_pending=false`` means ``output`` is the turn's whole answer. Otherwise (time ran out, or an earlier turn's answer is still waiting to be collected) it returns what arrived, or the acknowledgement, with ``background_pending=true``; collect the rest with ``poll=true``, and poll before sending the next turn. Send an ``Idempotency-Key`` with every waiting turn: if your own timeout fires or the connection drops first, retry with the same key, and the retry returns the answers the turn already collected instead of running it again. ``null`` (default) inherits the channel policy (web = do not wait). Ignored with ``poll=true`` (422)."},"suppress_filler":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Suppress Filler","description":"Synchronous callers only: when a turn ends ``background_pending``, omit the filler/acknowledgement text from ``output`` so a batch caller never mistakes the ack for the answer (``output`` is empty; ``background_pending=true`` is the poll-later signal). Answers a ``wait_for_final`` wait collected still come back. ``null`` (default) inherits the channel policy. Ignored with ``poll=true`` (422)."},"source":{"anyOf":[{"type":"string","const":"playground"},{"type":"null"}],"title":"Source","description":"Set to ``playground`` on every turn the developer console Playground sends, polls included. A Playground turn on a real conversation, one no Playground session or test credential started, is refused with 403."}},"type":"object","title":"TurnRequest"},"ContentPartPayload":{"properties":{"type":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9._-]*$","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Text"},"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"provider_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Provider Id"},"metadata":{"additionalProperties":true,"type":"object","maxProperties":50,"title":"Metadata"}},"type":"object","title":"ContentPartPayload","description":"HTTP/WebSocket shape for a modality-neutral conversation content part."},"TurnStreamEvent":{"discriminator":{"mapping":{"artifact":"#/components/schemas/TurnArtifactEvent","done":"#/components/schemas/TurnDoneEvent","error":"#/components/schemas/TurnErrorEvent","message":"#/components/schemas/TurnMessageEvent","state":"#/components/schemas/TurnStateEvent","state_transition":"#/components/schemas/TurnStateTransitionEvent","thinking":"#/components/schemas/TurnThinkingEvent","token":"#/components/schemas/TurnTokenEvent","tool_call_completed":"#/components/schemas/TurnToolCallCompletedEvent","tool_call_started":"#/components/schemas/TurnToolCallStartedEvent"},"propertyName":"event"},"oneOf":[{"$ref":"#/components/schemas/TurnTokenEvent"},{"$ref":"#/components/schemas/TurnArtifactEvent"},{"$ref":"#/components/schemas/TurnToolCallStartedEvent"},{"$ref":"#/components/schemas/TurnToolCallCompletedEvent"},{"$ref":"#/components/schemas/TurnThinkingEvent"},{"$ref":"#/components/schemas/TurnMessageEvent"},{"$ref":"#/components/schemas/TurnStateTransitionEvent"},{"$ref":"#/components/schemas/TurnStateEvent"},{"$ref":"#/components/schemas/TurnDoneEvent"},{"$ref":"#/components/schemas/TurnErrorEvent"}]},"TurnTokenEvent":{"properties":{"event":{"const":"token","default":"token","title":"Event","type":"string"},"text":{"title":"Text","type":"string"}},"required":["text"],"title":"TurnTokenEvent","type":"object"},"TurnArtifactEvent":{"properties":{"event":{"const":"artifact","default":"artifact","title":"Event","type":"string"},"type":{"maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type","type":"string"},"schema_version":{"maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version","type":"string"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Payload"}},"required":["type","schema_version","payload"],"title":"TurnArtifactEvent","type":"object"},"TurnToolCallStartedEvent":{"properties":{"event":{"const":"tool_call_started","default":"tool_call_started","title":"Event","type":"string"},"tool_name":{"maxLength":256,"title":"Tool Name","type":"string"},"call_id":{"maxLength":256,"title":"Call Id","type":"string"},"input":{"title":"Input","type":"string"}},"required":["tool_name","call_id","input"],"title":"TurnToolCallStartedEvent","type":"object"},"TurnToolCallCompletedEvent":{"properties":{"event":{"const":"tool_call_completed","default":"tool_call_completed","title":"Event","type":"string"},"tool_name":{"maxLength":256,"title":"Tool Name","type":"string"},"call_id":{"maxLength":256,"title":"Call Id","type":"string"},"result":{"title":"Result","type":"string"},"succeeded":{"title":"Succeeded","type":"boolean"},"duration_ms":{"anyOf":[{"maximum":3600000,"minimum":0,"type":"number"},{"type":"null"}],"default":null,"description":"Wall-clock tool execution time in milliseconds, measured at the engage_step call site. Null when the upstream did not report timing (legacy/test paths).","title":"Duration Ms"}},"required":["tool_name","call_id","result","succeeded"],"title":"TurnToolCallCompletedEvent","type":"object"},"TurnThinkingEvent":{"properties":{"event":{"const":"thinking","default":"thinking","title":"Event","type":"string"},"tier":{"title":"Tier","type":"integer"},"tier_name":{"title":"Tier Name","type":"string"}},"required":["tier","tier_name"],"title":"TurnThinkingEvent","type":"object"},"TurnMessageEvent":{"properties":{"event":{"const":"message","default":"message","title":"Event","type":"string"},"role":{"title":"Role","type":"string"},"text":{"title":"Text","type":"string"}},"required":["role","text"],"title":"TurnMessageEvent","type":"object"},"TurnStateTransitionEvent":{"description":"One context-graph hop the turn took.\n\nOne frame per hop, in the order the turn took them, after the turn's ``message``\nframes. These are the hops ``POST /turns`` returns on ``output[0].state_transitions``.","properties":{"event":{"const":"state_transition","default":"state_transition","title":"Event","type":"string"},"from_state":{"title":"From State","type":"string"},"to_state":{"title":"To State","type":"string"},"exit_condition":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"description":"The exit condition the agent took out of ``from_state``, as the context graph words it. Null on a hop out of an annotation state, which has no exit conditions.","title":"Exit Condition"}},"required":["from_state","to_state"],"title":"TurnStateTransitionEvent","type":"object"},"TurnStateEvent":{"description":"The conversation's context-graph state after the turn.\n\nSent on every turn, after any ``state_transition`` frames and before ``done``. It is\nthe state ``POST /turns`` returns on ``conversation.context_graph_state``.","properties":{"event":{"const":"state","default":"state","title":"Event","type":"string"},"context_graph_state":{"$ref":"#/components/schemas/ContextGraphState-Output"}},"required":["context_graph_state"],"title":"TurnStateEvent","type":"object"},"ContextGraphState-Output":{"oneOf":[{"$ref":"#/components/schemas/ActionState-Output"},{"$ref":"#/components/schemas/DecisionState-Output"},{"$ref":"#/components/schemas/AnnotationState"},{"$ref":"#/components/schemas/DataCollectionState-Output"}],"discriminator":{"propertyName":"type","mapping":{"action":"#/components/schemas/ActionState-Output","annotation":"#/components/schemas/AnnotationState","data_collection":"#/components/schemas/DataCollectionState-Output","decision":"#/components/schemas/DecisionState-Output"}}},"ActionState-Output":{"properties":{"type":{"type":"string","const":"action","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"actions":{"items":{"$ref":"#/components/schemas/Action"},"type":"array","title":"Actions"},"intra_state_navigation_guidelines":{"items":{"type":"string"},"type":"array","title":"Intra State Navigation Guidelines"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines"},"boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Boundary Constraints"},"exit_conditions":{"items":{"$ref":"#/components/schemas/ExitCondition"},"type":"array","title":"Exit Conditions"},"action_tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Action Tool Call Specs","default":[]},"exit_condition_tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Exit Condition Tool Call Specs","default":[]},"wait_for":{"anyOf":[{"type":"string","enum":["surface_submission","human_approval"]},{"type":"null"}],"title":"Wait For"},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"surface_spec_template":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Surface Spec Template"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]}},"type":"object","required":["type","name","objective","actions","intra_state_navigation_guidelines","action_guidelines","boundary_constraints","exit_conditions"],"title":"ActionState","description":"User-facing engagement state with actions and exit conditions."},"Action":{"properties":{"description":{"type":"string","title":"Description"},"filler_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Hint"}},"type":"object","required":["description"],"title":"Action","description":"A single action the agent can take within a state."},"ExitCondition":{"properties":{"description":{"type":"string","title":"Description"},"next_state":{"type":"string","title":"Next State"},"filler_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Hint"}},"type":"object","required":["description","next_state"],"title":"ExitCondition"},"ToolCallSpec":{"properties":{"tool_id":{"type":"string","title":"Tool Id"},"additional_instruction":{"type":"string","title":"Additional Instruction","default":""},"navigate_on_completion":{"type":"boolean","title":"Navigate On Completion","default":false},"progress":{"anyOf":[{"$ref":"#/components/schemas/ProgressHint"},{"type":"null"}]},"result_persistence":{"type":"string","enum":["accumulate","override","ephemeral"],"title":"Result Persistence","description":"How this tool call's arguments and result are retained. 'ephemeral' is fail-closed: Platform API authoring must be enabled for the workspace, and Agent Engine honors it only on the inline text/simulation path — voice, background, and external-realtime sessions reject an ephemeral graph at init rather than journal it.","default":"accumulate"},"expects_code":{"type":"boolean","title":"Expects Code","default":false},"delivery":{"type":"string","enum":["interrupt","queue"],"title":"Delivery","default":"interrupt"},"failure_delivery":{"anyOf":[{"type":"string","enum":["interrupt","queue"]},{"type":"null"}],"title":"Failure Delivery"},"failure_delivery_by_class":{"anyOf":[{"additionalProperties":{"type":"string","enum":["interrupt","queue"]},"propertyNames":{"$ref":"#/components/schemas/FailureClass"},"type":"object"},{"type":"null"}],"title":"Failure Delivery By Class"},"execution":{"type":"string","enum":["blocking","background"],"title":"Execution","default":"blocking"},"lifecycle":{"type":"string","enum":["coupled","independent"],"title":"Lifecycle","default":"independent"},"context_bindings":{"items":{"type":"string"},"type":"array","title":"Context Bindings"},"context_binding_aliases":{"additionalProperties":{"$ref":"#/components/schemas/SlugString"},"propertyNames":{"maxLength":128,"minLength":1},"type":"object","title":"Context Binding Aliases"},"audio_fillers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Audio Fillers"},"audio_filler_triggered_after":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Filler Triggered After"}},"type":"object","required":["tool_id"],"title":"ToolCallSpec","description":"A tool call that the agent can make in a state."},"ProgressHint":{"properties":{"deterministic":{"type":"boolean","title":"Deterministic","default":false},"phrases":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"description":"Filler phrases. deterministic=true: played verbatim in order. deterministic=false: used as hints for early attempts."},{"type":"null"}],"title":"Phrases"},"trigger_delay_ms":{"anyOf":[{"type":"integer","maximum":30000,"minimum":0},{"type":"null"}],"title":"Trigger Delay Ms"},"interval_ms":{"anyOf":[{"type":"integer","maximum":30000,"minimum":100},{"type":"null"}],"title":"Interval Ms"},"mode":{"type":"string","enum":["auto","silent","backchannel","verbal"],"title":"Mode","default":"auto"},"progress_class":{"anyOf":[{"type":"string","enum":["lookup","write","external_call","compute","multi_step"]},{"type":"null"}],"title":"Progress Class"},"expected_latency_ms":{"anyOf":[{"type":"integer","maximum":60000,"minimum":0},{"type":"null"}],"title":"Expected Latency Ms"},"custom_phrase":{"anyOf":[{"type":"string","maxLength":500,"description":"Legacy: use phrases instead."},{"type":"null"}],"title":"Custom Phrase"}},"additionalProperties":false,"type":"object","title":"ProgressHint","description":"How the agent narrates waiting on a tool.\n\n``deterministic=true``: scripted — ``phrases`` play verbatim in order.\n``deterministic=false``: engine picks — ``phrases`` are hints.\n``trigger_delay_ms``: milliseconds before first filler (0 = immediate).\n``interval_ms``: milliseconds between subsequent fillers."},"FailureClass":{"type":"string","enum":["timeout","input_rejected","rounds_exhausted","generic"],"title":"FailureClass","description":"Why a tool result is a failure — produced by the executor at RUN time.\n\nUnlike ``ResultDelivery`` (a fixed config-time axis), this is a runtime\nclassification the executor knows at the moment of failure. It flavors the\nagent-facing failure wording and the world-event / status-tool observability,\nand it is ALSO an optional routing key: a state x tool binding may set\n``ToolCallSpec.failure_delivery_by_class`` to deliver differently per class\n(e.g. interrupt on timeout, queue on a generic error). With no per-class map\n(the default), failed results route by the ``failure_delivery`` floor,\nunchanged. Add a member only in the same change that wires a producer for it —\nadding one also widens the per-class routing surface, so it must be a\ndeliberate, produced class."},"SlugString":{"type":"string","maxLength":63,"minLength":2,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$"},"Guardrail":{"properties":{"name":{"type":"string","maxLength":128,"title":"Name"},"description":{"type":"string","maxLength":1000,"title":"Description"},"enforcement":{"type":"string","enum":["hard","soft"],"title":"Enforcement","default":"hard"}},"type":"object","required":["name","description"],"title":"Guardrail","description":"Typed safety rule enforced per-state (not just global freetext guidelines)."},"ChannelOverride":{"properties":{"objective":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines","default":[]},"progress":{"anyOf":[{"$ref":"#/components/schemas/ProgressHint"},{"type":"null"}]}},"type":"object","title":"ChannelOverride","description":"Per-channel behavior override for a state."},"TurnPolicy":{"properties":{"barge_in_enabled":{"type":"boolean","title":"Barge In Enabled","default":true},"context_strategy":{"type":"string","enum":["full","compact"],"title":"Context Strategy","default":"full"},"degradation_threshold":{"type":"integer","minimum":-1,"title":"Degradation Threshold","default":-1},"block_forward_call":{"type":"boolean","title":"Block Forward Call","default":false},"block_forward_call_after_turns":{"type":"integer","minimum":-1,"title":"Block Forward Call After Turns","default":-1},"stt_eot_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Eot Threshold"},"stt_eager_eot_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Eager Eot Threshold"},"stt_eot_timeout_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stt Eot Timeout Ms"}},"type":"object","title":"TurnPolicy","description":"Voice pipeline parameters declared per HSM state.\n\nLives on ActionState/DecisionState alongside guardrails, wait_for, and\nchannel_overrides.  The HSM state IS the policy — no shadow state machine.\nAll fields optional with safe defaults (production behavior unchanged\nwhen no turn_policy is set)."},"DecisionState-Output":{"properties":{"type":{"type":"string","const":"decision","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"exit_conditions":{"items":{"$ref":"#/components/schemas/ExitCondition"},"type":"array","title":"Exit Conditions"},"decision_guidelines":{"items":{"type":"string"},"type":"array","title":"Decision Guidelines","default":[]},"tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Tool Call Specs","default":[]},"wait_for":{"anyOf":[{"type":"string","enum":["surface_submission","human_approval"]},{"type":"null"}],"title":"Wait For"},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]}},"type":"object","required":["type","name","objective","exit_conditions"],"title":"DecisionState","description":"Passthrough routing state — Agent picks an exit condition, no user interaction."},"AnnotationState":{"properties":{"type":{"type":"string","const":"annotation","title":"Type"},"name":{"type":"string","title":"Name"},"inner_thought":{"type":"string","title":"Inner Thought"},"next_state":{"type":"string","title":"Next State"}},"type":"object","required":["type","name","inner_thought","next_state"],"title":"AnnotationState","description":"Injects a hardcoded inner thought (no LLM call)."},"DataCollectionState-Output":{"properties":{"type":{"type":"string","const":"data_collection","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"fields":{"items":{"$ref":"#/components/schemas/CollectionField"},"type":"array","title":"Fields"},"on_complete":{"type":"string","title":"On Complete"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines","default":[]},"boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Boundary Constraints","default":[]},"surface_fallback":{"type":"boolean","title":"Surface Fallback","default":false},"surface_fallback_after_turns":{"type":"integer","title":"Surface Fallback After Turns","default":6},"max_turns":{"type":"integer","title":"Max Turns","default":10},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]},"tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Tool Call Specs","default":[]}},"type":"object","required":["type","name","objective","fields","on_complete"],"title":"DataCollectionState","description":"Structured voice/text data collection with field tracking.\n\nThe engine presents fields conversationally, tracks completion, and\noptionally falls back to a Surface form after N turns. Each collected\nfield produces a world event with confidence 0.5."},"CollectionField":{"properties":{"key":{"type":"string","title":"Key"},"type":{"type":"string","title":"Type"},"label":{"type":"string","title":"Label"},"required":{"type":"boolean","title":"Required","default":true},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"validation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validation"},"ask_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ask Prompt"},"fhir_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Path"}},"type":"object","required":["key","type","label"],"title":"CollectionField","description":"A single field to collect during a data collection state."},"TurnDoneEvent":{"properties":{"event":{"const":"done","default":"done","title":"Event","type":"string"},"conversation_id":{"format":"uuid","title":"Conversation Id","type":"string"},"status":{"title":"Status","type":"string"},"turn_count":{"title":"Turn Count","type":"integer"},"background_pending":{"default":false,"description":"True when the streamed response is only an acknowledgement and the final assistant answer must be collected with the durable background-delivery protocol.","title":"Background Pending","type":"boolean"},"delivery_protocol_version":{"anyOf":[{"const":2,"type":"integer"},{"type":"null"}],"default":null,"description":"Version of the durable background-delivery protocol supported by the serving agent. Clients may retry receipt-backed polls only after observing version 2.","title":"Delivery Protocol Version"},"turn_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"description":"Identifier of the user exchange this turn belongs to — identical to the ``turn_id`` on the non-streaming ``POST /turns`` response and on this conversation's history turns, so a streaming client can anchor durable per-turn artifacts (e.g. feedback) without a follow-up read. Stamped by platform-api at the proxy boundary (agent-engine frames do not carry it). Null when the conversation has no user exchange yet (a greeting kickoff stream on a fresh conversation).","title":"Turn Id"},"turn_index":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Zero-based ordinal of the user exchange (0 = first user turn). Derived server-side; null exactly when ``turn_id`` is null.","title":"Turn Index"}},"required":["conversation_id","status","turn_count"],"title":"TurnDoneEvent","type":"object"},"TurnErrorEvent":{"description":"Terminal error frame on the turn stream.\n\nCarries a stable ``code`` so SDK consumers can branch deterministically\nwithout parsing free-form ``message`` text. ``retryable`` tells the\nconsumer whether issuing the same turn again is likely to succeed.\n``status_code`` is the upstream HTTP status when the error originated\nfrom a downstream service (agent-engine), and is otherwise omitted.","properties":{"event":{"const":"error","default":"error","title":"Event","type":"string"},"message":{"title":"Message","type":"string"},"code":{"default":"unknown","enum":["upstream_error","stream_interrupted","client_error","unknown"],"title":"Code","type":"string"},"retryable":{"default":false,"title":"Retryable","type":"boolean"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Status Code"}},"required":["message"],"title":"TurnErrorEvent","type":"object"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/conversations/{conversation_id}/turns/stream":{"post":{"tags":["conversations"],"summary":"Send a message and receive a streamed agent response","description":"Streaming variant of `POST /turns`. Always returns `text/event-stream` regardless of the `Accept` header — no JSON fallback. Each frame is a `TurnStreamEvent` discriminated by the `event` field (token, tool_call_started, tool_call_completed, thinking, artifact, message, state_transition, state, done, error). Right before `done`, a turn sends a `state_transition` frame per context-graph hop it took, then a `state` frame with the state it ended in. A turn refused before its first frame, such as a retry whose `Idempotency-Key` was used for a different turn, gets the same JSON error as `POST /turns` instead of a stream. While an operator holds the conversation, a turn is taken as `POST /turns` takes it: the message is recorded and the agent does not answer it, so the stream ends in `done` with status `paused` and no `message` frame, unless the platform sends an automatic reply. The operator's own replies are not streamed: read them with `GET /conversations/{conversation_id}/turns`. Use this endpoint for new integrations; the `Accept`-sniffing variant remains for backward compatibility.","operationId":"create_turn_stream_v1__workspace_id__conversations__conversation_id__turns_stream_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"include_tool_calls","in":"query","required":false,"schema":{"type":"boolean","description":"Include tool_call_started / tool_call_completed frames in the stream","default":false,"title":"Include Tool Calls"},"description":"Include tool_call_started / tool_call_completed frames in the stream"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Stable UUID for replaying the same logical streamed user-input turn.","title":"Idempotency-Key"},"description":"Stable UUID for replaying the same logical streamed user-input turn."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnRequest"}}}},"responses":{"200":{"description":"SSE stream of TurnStreamEvent frames","content":{"application/json":{"schema":{}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/TurnStreamEvent"}}}},"403":{"description":"The caller may not take this turn, such as an external user without the `conversations:turn` scope, asking for tool calls, or whose session is no longer active, or a Playground or test-credential session on a real conversation"},"404":{"description":"Conversation or service not found"},"409":{"description":"Conversation isn't active (it is closed, completed or failed, or an operator took it over under an older release and has not handed it back) or is busy, or the Idempotency-Key was used for a different turn"},"422":{"description":"The request is invalid, an empty kickoff turn comes after the conversation started, or the conversation's service binding is missing or corrupt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"429":{"description":"Rate limited"},"502":{"description":"Agent service failed the turn, its reply was lost or couldn't be read, or the conversation couldn't be read back after the turn"},"503":{"description":"Agent service couldn't be reached, so the turn didn't start, or the turn can't be taken right now. Retry with the same Idempotency-Key"},"504":{"description":"Agent service did not respond in time. The turn may still finish: retry with the same Idempotency-Key"}}}}}}
```

## Set and remove a conversation's tags

> Merges \`\`updates\`\` (a key not yet on the conversation is added, one that is has its value replaced) and removes \`\`deletes\`\`, then returns every tag the conversation now carries. A key cannot be in both lists. A conversation carries at most 20 tags: a request that would leave more changes nothing and is refused with 422.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"ConversationTagsPatch":{"properties":{"updates":{"items":{"$ref":"#/components/schemas/ConversationTag"},"type":"array","maxItems":20,"title":"Updates","description":"Tags to set: a key not yet on the conversation is added, and one that is has its value replaced."},"deletes":{"items":{"type":"string","maxLength":64,"minLength":1},"type":"array","maxItems":20,"title":"Deletes","description":"Keys to remove. A key the conversation does not carry is ignored."}},"type":"object","title":"ConversationTagsPatch"},"ConversationTag":{"properties":{"key":{"type":"string","maxLength":64,"minLength":1,"title":"Key"},"value":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Value","description":"Null for a bare label."}},"type":"object","required":["key"],"title":"ConversationTag"},"ConversationTagsResponse":{"properties":{"tags":{"items":{"$ref":"#/components/schemas/ConversationTag"},"type":"array","title":"Tags"}},"type":"object","required":["tags"],"title":"ConversationTagsResponse"}}},"paths":{"/v1/{workspace_id}/conversations/{conversation_id}/tags":{"patch":{"tags":["conversations"],"summary":"Set and remove a conversation's tags","description":"Merges ``updates`` (a key not yet on the conversation is added, one that is has its value replaced) and removes ``deletes``, then returns every tag the conversation now carries. A key cannot be in both lists. A conversation carries at most 20 tags: a request that would leave more changes nothing and is refused with 422.","operationId":"update_conversation_tags_v1__workspace_id__conversations__conversation_id__tags_patch","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"const":"playground","type":"string"},{"type":"null"}],"description":"Set to ``playground`` when the developer console Playground changes the tags. Refused with 403 on a real conversation, one no Playground session or test credential started.","title":"Source"},"description":"Set to ``playground`` when the developer console Playground changes the tags. Refused with 403 on a real conversation, one no Playground session or test credential started."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationTagsPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationTagsResponse"}}}},"403":{"description":"An external user may not change a conversation's tags, and a Playground or test-credential session may not change a real conversation's"},"404":{"description":"Conversation not found"},"422":{"description":"The request would leave the conversation with more than 20 tags"}}}}}}
```

## Approve or reject a parked write in your own conversation (external-user self-approval)

> Lets the external user who owns a conversation approve or reject a write that the agent paused for their confirmation. Only the conversation's own external user may call this; it requires the \`conversations:approve\_own\` scope.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"tags":[{"name":"conversations"}],"servers":[{"url":"https://platform.api-us.concurrence.com"},{"url":"https://platform.api-eu.concurrence.com","description":"Production, European Union"},{"url":"https://platform.api-au.concurrence.com","description":"Production, Australia"},{"url":"https://platform.api-ca.concurrence.com","description":"Production, Canada"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"ConversationApprovalRequest":{"properties":{"decision":{"type":"string","enum":["approve","reject"],"title":"Decision"},"reason":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Reason"}},"additionalProperties":false,"type":"object","required":["decision"],"title":"ConversationApprovalRequest","description":"An external user's decision on a parked, approval-gated write in their own conversation."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/conversations/{conversation_id}/approval":{"post":{"tags":["conversations"],"summary":"Approve or reject a parked write in your own conversation (external-user self-approval)","description":"Lets the external user who owns a conversation approve or reject a write that the agent paused for their confirmation. Only the conversation's own external user may call this; it requires the `conversations:approve_own` scope.","operationId":"decide_conversation_approval_v1__workspace_id__conversations__conversation_id__approval_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationApprovalRequest"}}}},"responses":{"204":{"description":"Successful Response"},"403":{"description":"Not an external_user token, or missing conversations:approve_own scope"},"404":{"description":"Conversation not found or not owned by the caller"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Decision store temporarily unavailable — safe to retry"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.concurrence.com/api-reference/readme/platform/conversations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
