Get a scenario version by its natural key
const url = 'https://example.com/v1/scenario-version/by-scenario?scenario_sid=example&version=1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/scenario-version/by-scenario?scenario_sid=example&version=1' \ --header 'Authorization: Bearer <token>'Address a single version record by its parent scenario plus axis number (the natural key consumers store), instead of the internal record sid.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Parent scenario whose version record is addressed.
Axis number to address: the published version when draft=false, the draft_version when draft=true (draft_version 0 = current WIP draft).
Selects the axis: false (default) → published record (version = number); true → draft record (draft_version = number).
Header Parameters
Section titled “Header Parameters”Target account for account-scoped resources. Principals without an account scope (superuser, tenant API key) MUST send it to declare which account to operate in. Account-scoped principals may omit it; if sent it must match their own account or the request is rejected with scope_conflict. For tenant API keys the account must belong to the key’s tenant.
Responses
Section titled “Responses”OK
Exactly one of version / draft_version is set: a record is either a published version or a draft record. draft_version 0 is the mutable work-in-progress draft; greater values are frozen draft records.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Message content only. Provider, credentials, and sender identity resolve from the agent’s SMS settings at send time.
object
Recipient override; empty means the communication recipient.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
The classifier a question brick classifies against.
object
Classifier version this brick classifies against. Always written explicitly; 0 means the classifier as the unversioned surface serves it.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Target variable, written as a placeholder. Returned unwrapped in variables.
Where the value is read from — body (JSONPath in path) or header (header name in path).
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
The classifier a question brick classifies against.
object
Classifier version this brick classifies against. Always written explicitly; 0 means the classifier as the unversioned surface serves it.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Examplegenerated
{ "id": "example", "scenario_sid": "example", "version": 1, "draft_version": 1, "content_hash": "example", "snapshot": { "name": "example", "constructor": { "bricks": { "audio": { "v1": [ { "id": "example", "description": "example", "properties": { "play_mode": "example", "audios": [ { "mode": "example", "tts_properties": { "text": "example" }, "file_properties": { "url": "example" } } ], "tts_general": { "language": "example", "voice": "example", "engine": "example", "speed": 1, "model": "example" } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "audio_file": { "v1": [ { "id": "example", "description": "example", "properties": { "url": "example" }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "audio_tts": { "v1": [ { "id": "example", "description": "example", "properties": { "text": "example", "language": "example", "voice": "example", "engine": "example", "model": "example" }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "sms": { "v1": [ { "id": "example", "description": "example", "properties": { "to": "example", "text": "example" }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "goal": { "v1": [ { "id": "example", "description": "example", "properties": { "goal": "example" }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "end_call": { "v1": [ { "id": "example", "description": "example", "properties": { "signal": "example" }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "assignment": { "v1": [ { "id": "example", "description": "example", "properties": { "variables": [ { "name": "example", "value": "example" } ] }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "increment": { "v1": [ { "id": "example", "description": "example", "properties": { "variables": [ { "variable": "example" } ] }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "condition_group": { "v1": [ { "id": "example", "description": "example", "properties": { "condition": { "conditions": [ { "condition_id": "example", "description": "example", "condition_operator": "example", "elements": [ { "variable": "example", "element_operator": "example", "value": "example" } ] } ] } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "start_tree": { "v1": [ { "id": "example", "description": "example", "properties": {}, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "start_call": { "v1": [ { "id": "example", "description": "example", "properties": { "stt_general": { "language": "example", "engine": "example", "model": "example", "primary_language": "example", "fallback_languages": [ "example" ] }, "tts_general": { "language": "example", "voice": "example", "engine": "example", "speed": 1, "model": "example" } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "outbound_call": { "v1": [ { "id": "example", "description": "example", "properties": { "is_voicemail": true }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "inbound_call": { "v1": [ { "id": "example", "description": "example", "properties": {}, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "end": { "v1": [ { "id": "example", "description": "example", "properties": {}, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "call_transfer": { "v1": [ { "id": "example", "description": "example", "properties": { "from": "example", "number": "example", "message_to_manager": { "mode": "example", "tts": { "text": "example" }, "file": { "url": "example" } }, "message_to_client": { "mode": "example", "tts": { "text": "example" }, "file": { "url": "example" } }, "timeout": 1, "tts_properties": { "language": "example", "voice": "example", "engine": "example", "model": "example" }, "sip_header": { "sip_headers": [ { "name": "example", "value": "example" } ] }, "transfer_mode": "example" }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "question": { "v1": [ { "id": "example", "description": "example", "properties": { "tts_properties": { "language": "example", "voice": "example", "engine": "example", "speed": 1, "model": "example" }, "dtmf_properties": { "dtmf_timeout": 1, "no_input_timeout": 1, "min_symbols": 1, "max_symbols": 1, "finish_on_key": "example" }, "stt_properties": { "speech_timeout": 1, "no_input_timeout": 1, "language": "example", "recognition_shift": { "direction": "example", "duration": 1 }, "engine": "example", "grammar_parameter": { "parameters": [ { "key": "example", "value": "example" } ] }, "class_token": { "tokens": [ "example" ] }, "filter": { "filters": [ "example" ] }, "tokens": [ "example" ], "intent_properties": { "classifier": { "id": "example", "version": 1 }, "llm_properties": { "engine": "example", "model": "example", "messages": [ { "role": "example", "content": "example" } ], "temperature": 1, "provider": "example", "gdpr_required": true }, "threshold": 1 }, "timezone": "example", "recognition_mode": "example", "enable_voice_activity_detection": true, "interruptible_dialog": true, "interruption_shift": { "direction": "example", "duration": 1 }, "model": "example", "primary_language": "example", "fallback_languages": [ "example" ] }, "statement": { "audio": { "mode": "example", "tts": { "text": "example" }, "file": { "url": "example" } }, "is_interruptible": true }, "type": "example", "input_mode": "example", "answer": { "answers": [ { "answer_id": "example", "description": "example", "speech_input": { "tokens": [ "example" ], "mode": "example", "intent": { "id": "example" }, "entity": { "entities": [ { "type": "example", "variable": { "name": "example" } } ] } }, "dtmf_input": { "value": "example" }, "tag": "example" } ] }, "fallback_invalid": { "fallbacks": [ { "is_repeat_statement": true, "audio": { "mode": "example", "tts": { "text": "example" }, "file": { "url": "example" } }, "is_interruptible": true, "type": "example", "llm_properties": { "engine": "example", "model": "example", "messages": [ { "role": "example", "content": "example" } ], "temperature": 1, "provider": "example", "gdpr_required": true } } ], "entity": { "entities": [ { "type": "example", "variable": { "name": "example" } } ] } }, "fallback_empty": { "fallbacks": [ { "is_repeat_statement": true, "audio": { "mode": "example", "tts": { "text": "example" }, "file": { "url": "example" } }, "is_interruptible": true, "type": "example", "llm_properties": { "engine": "example", "model": "example", "messages": [ { "role": "example", "content": "example" } ], "temperature": 1, "provider": "example", "gdpr_required": true } } ] }, "entity": { "entities": [ { "type": "example", "variable": { "name": "example" } } ] } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "webhook": { "v1": [ { "id": "example", "description": "example", "properties": { "request": { "method": "example", "url": "example", "body": { "data": "example", "type": "example", "form_values": [ { "name": "example", "value": "example" } ] }, "authentication": { "type": "example", "basic": { "username": "example", "password": "example" }, "bearer": { "token": "example" } }, "header": { "headers": [ { "name": "example", "value": "example" } ] }, "insecure_skip_verify": true, "proxy": { "url": "example" }, "attach_call_metadata": true, "timeout": 1 }, "options": { "async": true, "timeout": 1 }, "response_mapping": { "variables": [ { "name": "example", "source": "example", "path": "example", "set_if_not_found": "example" } ] } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "data_mapping": { "v1": [ { "id": "example", "description": "example", "properties": { "input": "example", "variables": [ { "name": "example", "path": "example", "set_if_not_found": "example" } ] }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "tree": { "v1": [ { "id": "example", "description": "example", "properties": { "tree": { "id": "example" } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "end_tree": { "v1": [ { "id": "example", "description": "example", "properties": { "output": { "type": "example", "description": "example" } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "background_audio": { "v1": [ { "id": "example", "description": "example", "properties": { "audio": { "audios": [ { "mode": "example", "file_properties": { "url": "example" }, "volume": 1 } ] } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "javascript": { "v1": [ { "id": "example", "description": "example", "properties": { "source": "example" }, "outputs": [ { "type": "example", "description": "example" } ] } ], "v2": [ { "id": "example", "description": "example", "properties": { "url": "example", "input_variables": [ "example" ] }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "warm_up_tts": { "v1": [ { "id": "example", "description": "example", "properties": { "brick": { "bricks": [ { "id": "example", "type": "example" } ] } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "business_metric": { "v1": [ { "id": "example", "description": "example", "properties": { "key": "example", "value": "example" }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "ai_agent": { "v1": [ { "id": "example", "description": "example", "properties": { "prompts": { "restrictions": { "content": "example" }, "role": { "content": "example" }, "initial_phrase": { "content": "example", "is_interruptible": true } }, "skill": { "skills": [ { "id": "example", "name": "example", "function_name": "example", "description": "example", "parameters": { "type": "example", "properties": { "additionalProperty": { "type": "example", "description": "example", "variable_name": "example", "enum": [ "example" ], "default": "example" } }, "required": [ "example" ], "additional_properties": true } } ] }, "knowledge_base": { "type": "example", "prompt": { "content": "example" }, "rag": { "document": { "ids": [ "example" ], "number": 1, "threshold": 1 } } }, "fallbacks": { "error": { "counter": 1 }, "empty": { "counter": 1 } }, "configuration": { "llm": { "engine": "example", "model": "example", "temperature": 1, "max_tokens": 1, "provider": "example", "gdpr_required": true }, "tts": { "language": "example", "voice": "example", "engine": "example", "speed": 1, "model": "example" }, "stt": { "speech_timeout": 1, "no_input_timeout": 1, "language": "example", "recognition_shift": { "direction": "example", "duration": 1 }, "engine": "example", "grammar_parameter": { "parameters": [ { "key": "example", "value": "example" } ] }, "class_token": { "tokens": [ "example" ] }, "filter": { "filters": [ "example" ] }, "tokens": [ "example" ], "intent_properties": { "classifier": { "id": "example", "version": 1 }, "llm_properties": { "engine": "example", "model": "example", "messages": [ { "role": "example", "content": "example" } ], "temperature": 1, "provider": "example", "gdpr_required": true }, "threshold": 1 }, "timezone": "example", "recognition_mode": "example", "enable_voice_activity_detection": true, "interruptible_dialog": true, "interruption_shift": { "direction": "example", "duration": 1 }, "model": "example", "primary_language": "example", "fallback_languages": [ "example" ] }, "dialog": { "context_mode": "example", "max_turns": 1 } } }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "send_dtmf": { "v1": [ { "id": "example", "description": "example", "properties": { "digits": "example", "interval": 1, "duration": 1 }, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "recording_setup": { "v1": [ { "id": "example", "description": "example", "properties": {}, "outputs": [ { "type": "example", "description": "example" } ] } ] }, "transcription": { "v1": [ { "id": "example", "description": "example", "properties": { "request": { "requests": [ { "source": { "type": "example", "url": "example" }, "engine": "example", "prompt": "example", "model": "example" } ] } }, "outputs": [ { "type": "example", "description": "example" } ] } ] } }, "forest": { "trees": [ { "description": "example", "tree_id": "example", "nodes": [ { "id": "example", "brick": { "id": "example", "type": "example", "version": "example" }, "links": [ { "output_type": "example", "reference": { "tree_id": "example", "node_id": "example" }, "return": { "tree_id": "example", "node_id": "example" } } ] } ] } ] }, "properties": { "engine_version": "example" } } }, "created_at": "2026-04-15T12:00:00Z"}Invalid request body or parameters
object
Stable lower_snake_case usecase code (e.g. scenario_not_found)
Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered
Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)
object
Validation errors keyed by entity
object
object
SCN1xx constructor validation code
Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "data": { "topic": "example", "errors": { "scenario": [ { "code": "example", "message": "example", "summary": "example", "tree_id": "example", "node_id": "example", "output_type": "example", "duplicate_tree_index": "example", "duplicate_node_index": "example", "property": "example", "invalid_value": "example" } ] }, "agents": [ "example" ] }}Missing or invalid credentials
object
Stable lower_snake_case usecase code (e.g. scenario_not_found)
Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered
Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)
object
Validation errors keyed by entity
object
object
SCN1xx constructor validation code
Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "data": { "topic": "example", "errors": { "scenario": [ { "code": "example", "message": "example", "summary": "example", "tree_id": "example", "node_id": "example", "output_type": "example", "duplicate_tree_index": "example", "duplicate_node_index": "example", "property": "example", "invalid_value": "example" } ] }, "agents": [ "example" ] }}Resource does not exist
object
Stable lower_snake_case usecase code (e.g. scenario_not_found)
Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered
Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)
object
Validation errors keyed by entity
object
object
SCN1xx constructor validation code
Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "data": { "topic": "example", "errors": { "scenario": [ { "code": "example", "message": "example", "summary": "example", "tree_id": "example", "node_id": "example", "output_type": "example", "duplicate_tree_index": "example", "duplicate_node_index": "example", "property": "example", "invalid_value": "example" } ] }, "agents": [ "example" ] }}Internal server error
object
Stable lower_snake_case usecase code (e.g. scenario_not_found)
Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered
Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)
object
Validation errors keyed by entity
object
object
SCN1xx constructor validation code
Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "data": { "topic": "example", "errors": { "scenario": [ { "code": "example", "message": "example", "summary": "example", "tree_id": "example", "node_id": "example", "output_type": "example", "duplicate_tree_index": "example", "duplicate_node_index": "example", "property": "example", "invalid_value": "example" } ] }, "agents": [ "example" ] }}