Validate scenario
const url = 'https://example.com/v1/a/scenario/example/validate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"constructor","name":"example","constructor":{"bricks":{"audio":{"v1":[{"id":"example","description":"example","properties":{"play_mode":"all","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":"and","elements":[{"variable":"example","element_operator":"equal","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":"gsr","model":"example","primary_language":"example","fallback_languages":["example"],"endpoint_detection":{"enabled":true,"latency_adjustment_level":1,"sensitivity":1,"max_delay_ms":1}},"tts_general":{"language":"example","voice":"example","engine":"example","speed":1,"model":"example"}},"outputs":[{"type":"example","description":"example"}]}],"v2":[{"id":"example","description":"example","properties":{"stt_general":{"language":"example","engine":"gsr","model":"example","primary_language":"example","fallback_languages":["example"],"endpoint_detection":{"enabled":true,"latency_adjustment_level":1,"sensitivity":1,"max_delay_ms":1}},"tts_general":{"language":"example","voice":"example","engine":"example","speed":1,"model":"example"},"voicemail_enabled":true},"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":"backward","duration":1},"engine":"gsr","grammar_parameter":{"parameters":[{"key":"example","value":"example"}]},"class_token":{"tokens":["example"]},"filter":{"filters":["example"]},"tokens":["example"],"intent_properties":{"classifier":{"id":"example","version":1},"model_id":"example","llm_properties":{"engine":"example","model":"example","messages":[{"role":"system","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":"backward","duration":1},"model":"example","primary_language":"example","fallback_languages":["example"],"endpoint_detection":{"enabled":true,"latency_adjustment_level":1,"sensitivity":1,"max_delay_ms":1}},"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":"token-based","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":"initial","llm_properties":{"engine":"example","model":"example","messages":[{"role":"system","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":"initial","llm_properties":{"engine":"example","model":"example","messages":[{"role":"system","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":{"id":"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":"backward","duration":1},"engine":"gsr","grammar_parameter":{"parameters":[{"key":"example","value":"example"}]},"class_token":{"tokens":["example"]},"filter":{"filters":["example"]},"tokens":["example"],"intent_properties":{"classifier":{"id":"example","version":1},"model_id":"example","llm_properties":{"engine":"example","model":"example","messages":[{"role":"system","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":"backward","duration":1},"model":"example","primary_language":"example","fallback_languages":["example"],"endpoint_detection":{"enabled":true,"latency_adjustment_level":1,"sensitivity":1,"max_delay_ms":1}},"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":"last_recording","url":"example"},"engine":"whisper","prompt":"example","model":"example"}]}},"outputs":[{"type":"example","description":"example"}]}]}},"forest":{"trees":[{"description":"example","tree_id":"example","nodes":[{"id":"example","brick":{"id":"example","type":"ai_agent","version":"example"},"links":[{"output_type":"example","reference":{"tree_id":"example","node_id":"example"},"return":{"tree_id":"example","node_id":"example"}}],"position":{"x":1,"y":1}}]}]},"properties":{"engine_version":"v3"}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/a/scenario/example/validate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "constructor", "name": "example", "constructor": { "bricks": { "audio": { "v1": [ { "id": "example", "description": "example", "properties": { "play_mode": "all", "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": "and", "elements": [ { "variable": "example", "element_operator": "equal", "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": "gsr", "model": "example", "primary_language": "example", "fallback_languages": [ "example" ], "endpoint_detection": { "enabled": true, "latency_adjustment_level": 1, "sensitivity": 1, "max_delay_ms": 1 } }, "tts_general": { "language": "example", "voice": "example", "engine": "example", "speed": 1, "model": "example" } }, "outputs": [ { "type": "example", "description": "example" } ] } ], "v2": [ { "id": "example", "description": "example", "properties": { "stt_general": { "language": "example", "engine": "gsr", "model": "example", "primary_language": "example", "fallback_languages": [ "example" ], "endpoint_detection": { "enabled": true, "latency_adjustment_level": 1, "sensitivity": 1, "max_delay_ms": 1 } }, "tts_general": { "language": "example", "voice": "example", "engine": "example", "speed": 1, "model": "example" }, "voicemail_enabled": true }, "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": "backward", "duration": 1 }, "engine": "gsr", "grammar_parameter": { "parameters": [ { "key": "example", "value": "example" } ] }, "class_token": { "tokens": [ "example" ] }, "filter": { "filters": [ "example" ] }, "tokens": [ "example" ], "intent_properties": { "classifier": { "id": "example", "version": 1 }, "model_id": "example", "llm_properties": { "engine": "example", "model": "example", "messages": [ { "role": "system", "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": "backward", "duration": 1 }, "model": "example", "primary_language": "example", "fallback_languages": [ "example" ], "endpoint_detection": { "enabled": true, "latency_adjustment_level": 1, "sensitivity": 1, "max_delay_ms": 1 } }, "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": "token-based", "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": "initial", "llm_properties": { "engine": "example", "model": "example", "messages": [ { "role": "system", "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": "initial", "llm_properties": { "engine": "example", "model": "example", "messages": [ { "role": "system", "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": { "id": "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": "backward", "duration": 1 }, "engine": "gsr", "grammar_parameter": { "parameters": [ { "key": "example", "value": "example" } ] }, "class_token": { "tokens": [ "example" ] }, "filter": { "filters": [ "example" ] }, "tokens": [ "example" ], "intent_properties": { "classifier": { "id": "example", "version": 1 }, "model_id": "example", "llm_properties": { "engine": "example", "model": "example", "messages": [ { "role": "system", "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": "backward", "duration": 1 }, "model": "example", "primary_language": "example", "fallback_languages": [ "example" ], "endpoint_detection": { "enabled": true, "latency_adjustment_level": 1, "sensitivity": 1, "max_delay_ms": 1 } }, "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": "last_recording", "url": "example" }, "engine": "whisper", "prompt": "example", "model": "example" } ] } }, "outputs": [ { "type": "example", "description": "example" } ] } ] } }, "forest": { "trees": [ { "description": "example", "tree_id": "example", "nodes": [ { "id": "example", "brick": { "id": "example", "type": "ai_agent", "version": "example" }, "links": [ { "output_type": "example", "reference": { "tree_id": "example", "node_id": "example" }, "return": { "tree_id": "example", "node_id": "example" } } ], "position": { "x": 1, "y": 1 } } ] } ] }, "properties": { "engine_version": "v3" } } }'Runs the checks of a publish on a body and stores nothing: the constructor, the classifier versions its bricks pin, and the edge functions its JavaScript bricks name.
By id:
-: runs the checks of publishing a new scenario.- The id of a stored scenario: runs the checks of publishing its next version, the SMS settings of the agents that run it included.
Permission
This operation needs the permission scenario:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Names the stored scenario whose next version is checked, or - for a new scenario.
Header Parameters
Section titled “Header Parameters”Names the target account for account-scoped resources.
By principal:
- A tenant API key carries no account scope of its own and names the account here.
- An account-scoped principal may omit it.
Refused when:
- A tenant API key omits it.
- An account-scoped principal sends a value naming any other account.
- The named account belongs to another tenant.
- The named account does not exist; it is answered as not found.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Holds the properties of a brick, one key per brick type.
Rules:
- A text property reads a variable when it holds
{{name}}, and a contact field when it holds{{contact.<path>}}; the call puts the value in place when the brick runs. - A number, a boolean and an enum property take no variable.
start_call,inbound_call,outbound_call,recording_setup,tree,start_tree,end_treeandend: no property takes a variable.condition_groupandassignment: onlyvaluetakes a variable.webhook: only the method, the URL, the body, the names and values of the headers and of the form fields, the basic-auth username and password, the bearer token, the proxy URL, and thepathandset_if_not_foundof a response mapping take a variable.- A property that names a variable to write, such as
variableof a response mapping or ofincrement, is written to and not read. - The guide with examples: https://docs.aiva.apifonica.com/guides/build/variables/
object
object
object
object
Picks which of the brick’s audios it plays.
Refused when:
- A publish carries no value.
- A publish carries an undeclared value.
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
Overrides the recipient; 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
How a condition joins its elements.
object
How one condition element compares its variable against its value.
object
object
object
object
object
object
Starts the call and hands it to the outbound_call or the inbound_call brick. Replaced by v2.
object
object
object
Ends the caller’s turn when the recognition engine reports the end of the phrase, before the speech timeout.
Rules:
- A call reads it from the settings of a question.
- A call reads it from the settings of an AI agent.
- A call does not read it from
stt_general.
object
Switches endpoint detection on.
Values:
true: is allowed only where theengineof the same settings issoniox.false: the other values are stored and not checked.
Sets the engine’s endpoint latency adjustment level, from 0 to 3. Omitting it is the same as sending 0.
Sets the engine’s endpoint sensitivity, from -1.0 to 1.0. Omitting it is the same as sending 0.
Sets the engine’s maximum endpoint delay in milliseconds, from 500 to 3000. Required while enabled is true.
object
object
Starts the call and routes it by the call outcome.
The outputs:
outbound: an outbound call is answered. Required.inbound: an inbound call is answered. Required.voicemail: an answering machine answers an outbound call. Required whilevoicemail_enabledis true.busy: the line of an outbound call is busy. Required.unanswered: nobody answers an outbound call. Required.
Rules:
- After
busyandunansweredthere is no call: a brick that needs the call takes its fallback output, and a brick that needs no call runs. - A scenario ends on
busyorunansweredthrough a link to anendbrick. - An output with no link ends the scenario.
object
object
object
Ends the caller’s turn when the recognition engine reports the end of the phrase, before the speech timeout.
Rules:
- A call reads it from the settings of a question.
- A call reads it from the settings of an AI agent.
- A call does not read it from
stt_general.
object
Switches endpoint detection on.
Values:
true: is allowed only where theengineof the same settings issoniox.false: the other values are stored and not checked.
Sets the engine’s endpoint latency adjustment level, from 0 to 3. Omitting it is the same as sending 0.
Sets the engine’s endpoint sensitivity, from -1.0 to 1.0. Omitting it is the same as sending 0.
Sets the engine’s maximum endpoint delay in milliseconds, from 500 to 3000. Required while enabled is true.
object
Turns on answering machine detection for an outbound call, which then follows the voicemail output. Replaces the agent’s voicemail_enabled for this scenario. false when absent.
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
Picks how the call is handed over.
Values:
bridge: keeps both legs on the platform. It is the default when omitted or empty.refer: transfers the call with a SIP REFER.
Another value is refused on publish.
object
object
object
object
object
object
object
object
The direction the recognition window moves, by duration.
object
object
object
object
object
The classifier a question brick classifies against.
object
Pins the classifier version this brick classifies against.
Rules:
0is an ordinary version, the one a classifier is created at.- A read always states it.
- On a write, omitting it is the same as sending
0.
Identifies the intent model the caller chose for this brick.
Rules:
- It is stored as sent.
- It is returned when set.
- The platform does not read it.
object
object
The party the chat message is attributed to.
object
The direction the recognition window moves, by duration.
Ends the caller’s turn when the recognition engine reports the end of the phrase, before the speech timeout.
Rules:
- A call reads it from the settings of a question.
- A call reads it from the settings of an AI agent.
- A call does not read it from
stt_general.
object
Switches endpoint detection on.
Values:
true: is allowed only where theengineof the same settings issoniox.false: the other values are stored and not checked.
Sets the engine’s endpoint latency adjustment level, from 0 to 3. Omitting it is the same as sending 0.
Sets the engine’s endpoint sensitivity, from -1.0 to 1.0. Omitting it is the same as sending 0.
Sets the engine’s maximum endpoint delay in milliseconds, from 500 to 3000. Required while enabled is true.
object
object
object
object
Picks the question shape.
Values:
closed: branches on a match inanswer.answers, which must then be non-empty.open: branches onvalid.
Any other value is refused on publish.
Picks how the reply is captured.
Values:
dtmf: needsdtmf_properties.speech: needsstt_properties.
Anything else fails a publish.
object
object
object
How the answer is matched against what the person said.
object
object
object
object
object
object
Sets one fallback of a question brick. llm_properties is stored only when type is llm; on any other fallback, and on one with no type, it is dropped on save.
object
object
object
object
Picks what the fallback plays.
Values:
initial: repeats the question’s own statement.custom: plays the fallback’s own audio.llm: generates a reply.
object
object
The party the chat message is attributed to.
object
object
object
object
Sets one fallback of a question brick. llm_properties is stored only when type is llm; on any other fallback, and on one with no type, it is dropped on save.
object
object
object
object
Picks what the fallback plays.
Values:
initial: repeats the question’s own statement.custom: plays the fallback’s own audio.llm: generates a reply.
object
object
The party the chat message is attributed to.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Names the target variable, written as a placeholder. Returned unwrapped in variables.
Picks where the value is read from.
Values:
body:pathholds a JSONPath.header:pathholds the header name.
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
Names the deployed edge function version the brick runs, as its uuid.
Refused when:
- A publish carries an empty value.
- A publish carries a value that is not a uuid.
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
Sets the sampling temperature of the model, from 0 to 1. 0 or no value uses the default of the model.
object
object
object
The direction the recognition window moves, by duration.
object
object
object
object
object
The classifier a question brick classifies against.
object
Pins the classifier version this brick classifies against.
Rules:
0is an ordinary version, the one a classifier is created at.- A read always states it.
- On a write, omitting it is the same as sending
0.
Identifies the intent model the caller chose for this brick.
Rules:
- It is stored as sent.
- It is returned when set.
- The platform does not read it.
object
object
The party the chat message is attributed to.
object
The direction the recognition window moves, by duration.
Ends the caller’s turn when the recognition engine reports the end of the phrase, before the speech timeout.
Rules:
- A call reads it from the settings of a question.
- A call reads it from the settings of an AI agent.
- A call does not read it from
stt_general.
object
Switches endpoint detection on.
Values:
true: is allowed only where theengineof the same settings issoniox.false: the other values are stored and not checked.
Sets the engine’s endpoint latency adjustment level, from 0 to 3. Omitting it is the same as sending 0.
Sets the engine’s endpoint sensitivity, from -1.0 to 1.0. Omitting it is the same as sending 0.
Sets the engine’s maximum endpoint delay in milliseconds, from 500 to 3000. Required while enabled is true.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Picks what is transcribed.
Values:
last_recording: the call’s last recording is transcribed.url: audio fetched fromurlis transcribed.
The engine that transcribes the source.
object
object
object
object
Any value sent is stored as v3.
Responses
Section titled “Responses”OK
object
Reports that the body passes every check of a publish; always true, because a body that fails a check is refused.
Examplegenerated
{ "valid": true}Bad request
object
Carries the stable lower_snake_case usecase code, such as scenario_not_found.
Carries the registered machine code, stable once assigned.
The codes:
ERRxxx: is a generic code that follows from the status class.ERR001–ERR020: are reserved for generic codes.SCN1xxand other entity-prefixed codes: appear only inside validation details.
Carries structured detail, present only where there is structure to carry it.
By failure:
- A validation failure carries the topic
validationand per-entityerrors. - A delete conflict carries the topic
conflict; its referencing dependents are inagents,automations,routings,usersorroles, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic
conflict, withagents. - An agent change refused because of its automations carries the topic
conflict, withautomations. - A file none of whose rows is usable carries the topic
rows_rejected, withrowsandreasons. - Contact data past a limit of its account carries
trigger,fieldandparams. - A data field rename that cannot be applied carries
fieldand, when a contact stops it,contact. - A contact number that is refused carries
reason.
object
Names why a number or a row is refused.
Values:
number_missing: the number is missing or blank.number_no_digits: the number holds no digits.identifier_invalid: an alphanumeric identifier does not start with a letter or a digit.number_not_international: the number is written as international and is not a valid one.number_not_for_country: the number is not valid for the statedcountry_code.country_code_required: the number is not international, and nocountry_codewas stated to read it by.value_too_long: a data value is longer than the account’s value limit in bytes. Given for a row only.type_mismatch: a data value does not read as the type its field holds across the account’s contacts. Given for a row only.
Groups the validation errors by entity.
object
object
Carries the SCN1xx constructor validation code.
Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; message carries the total count.
An agent a delete or a scenario publish was rejected for.
object
Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live automation that holds the resource a delete was rejected for.
object
Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live routing of an agent that is not archived, which holds the resource a delete was rejected for.
object
Lists the live users holding the role a delete was rejected for, capped at the first 20; message carries the total count.
A live user that holds the role a delete was rejected for.
object
Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; message carries the total count.
A live role that inherits the role a delete was rejected for.
object
Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once.
How many rows of a refused file were rejected for each reason; a reason no row had is absent.
object
The number cell is blank.
The number holds no digits.
An alphanumeric identifier does not start with a letter or a digit.
The number is written as international and is not a valid one.
The number is not valid for the stated country_code.
The number is not international, and no country_code was stated to read it by.
A data cell holds a value longer than the account’s value limit in bytes.
A data cell does not read as the type its field holds across the account’s contacts.
Names the rule the contact data breaks.
Values:
array_item_not_scalar: an array item is an object, an array or null.type_mismatch: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object.
Names the field by its path.
By failure:
- For a broken limit, it is the field that breaks the limit.
- For too many fields, it is the first new field past the limit.
- For a rename, it is the field that stops the rename.
Names the first contact whose data stops a rename; absent when the two paths alone conflict.
Carries the details of the breach.
By breach:
- For a broken limit, it carries the numbers of the limit.
- For a type mismatch, it carries the two types.
- For an array item that is not a scalar, it is empty.
object
Reports the account’s limit.
Reports the value the data would have: the fields, the bytes or the items.
Names the type the field holds across the account’s contacts.
Names the type of the new value.
Refuses a request whose form is wrong.
Returned when:
- The body, a path parameter or a query parameter does not parse.
Content-Encodingnames a compression the API does not accept, or the body cannot be decompressed as named.- A brick to validate names a type or a version the API does not know.
- A data field path or a column name in the body is not well formed, or a key of a row’s
datais empty or holds a dot. - A node
positionin the constructor of a scenario save carries one ofxandywithout the other. - The operation needs a WebSocket upgrade, and the request is not one.
message names what failed.
The credential acts for a tenant or for the platform, and the request names no account in X-Account-Sid (or no tenant in X-Tenant-Sid).
Refuses the value of the scope header.
Returned when:
- The scope header names an account or tenant the credential does not cover.
- The scope header carries a value that is not an id of that kind.
Example
{ "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "bad_request"}Unauthorized
object
Carries the stable lower_snake_case usecase code, such as scenario_not_found.
Carries the registered machine code, stable once assigned.
The codes:
ERRxxx: is a generic code that follows from the status class.ERR001–ERR020: are reserved for generic codes.SCN1xxand other entity-prefixed codes: appear only inside validation details.
Carries structured detail, present only where there is structure to carry it.
By failure:
- A validation failure carries the topic
validationand per-entityerrors. - A delete conflict carries the topic
conflict; its referencing dependents are inagents,automations,routings,usersorroles, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic
conflict, withagents. - An agent change refused because of its automations carries the topic
conflict, withautomations. - A file none of whose rows is usable carries the topic
rows_rejected, withrowsandreasons. - Contact data past a limit of its account carries
trigger,fieldandparams. - A data field rename that cannot be applied carries
fieldand, when a contact stops it,contact. - A contact number that is refused carries
reason.
object
Names why a number or a row is refused.
Values:
number_missing: the number is missing or blank.number_no_digits: the number holds no digits.identifier_invalid: an alphanumeric identifier does not start with a letter or a digit.number_not_international: the number is written as international and is not a valid one.number_not_for_country: the number is not valid for the statedcountry_code.country_code_required: the number is not international, and nocountry_codewas stated to read it by.value_too_long: a data value is longer than the account’s value limit in bytes. Given for a row only.type_mismatch: a data value does not read as the type its field holds across the account’s contacts. Given for a row only.
Groups the validation errors by entity.
object
object
Carries the SCN1xx constructor validation code.
Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; message carries the total count.
An agent a delete or a scenario publish was rejected for.
object
Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live automation that holds the resource a delete was rejected for.
object
Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live routing of an agent that is not archived, which holds the resource a delete was rejected for.
object
Lists the live users holding the role a delete was rejected for, capped at the first 20; message carries the total count.
A live user that holds the role a delete was rejected for.
object
Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; message carries the total count.
A live role that inherits the role a delete was rejected for.
object
Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once.
How many rows of a refused file were rejected for each reason; a reason no row had is absent.
object
The number cell is blank.
The number holds no digits.
An alphanumeric identifier does not start with a letter or a digit.
The number is written as international and is not a valid one.
The number is not valid for the stated country_code.
The number is not international, and no country_code was stated to read it by.
A data cell holds a value longer than the account’s value limit in bytes.
A data cell does not read as the type its field holds across the account’s contacts.
Names the rule the contact data breaks.
Values:
array_item_not_scalar: an array item is an object, an array or null.type_mismatch: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object.
Names the field by its path.
By failure:
- For a broken limit, it is the field that breaks the limit.
- For too many fields, it is the first new field past the limit.
- For a rename, it is the field that stops the rename.
Names the first contact whose data stops a rename; absent when the two paths alone conflict.
Carries the details of the breach.
By breach:
- For a broken limit, it carries the numbers of the limit.
- For a type mismatch, it carries the two types.
- For an array item that is not a scalar, it is empty.
object
Reports the account’s limit.
Reports the value the data would have: the fields, the bytes or the items.
Names the type the field holds across the account’s contacts.
Names the type of the new value.
Refuses a request that cannot be authenticated.
Returned when:
- The request carries no usable credential.
- The user, account or tenant behind the credential is not active.
Example
{ "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "unauthenticated"}Forbidden
object
Carries the stable lower_snake_case usecase code, such as scenario_not_found.
Carries the registered machine code, stable once assigned.
The codes:
ERRxxx: is a generic code that follows from the status class.ERR001–ERR020: are reserved for generic codes.SCN1xxand other entity-prefixed codes: appear only inside validation details.
Carries structured detail, present only where there is structure to carry it.
By failure:
- A validation failure carries the topic
validationand per-entityerrors. - A delete conflict carries the topic
conflict; its referencing dependents are inagents,automations,routings,usersorroles, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic
conflict, withagents. - An agent change refused because of its automations carries the topic
conflict, withautomations. - A file none of whose rows is usable carries the topic
rows_rejected, withrowsandreasons. - Contact data past a limit of its account carries
trigger,fieldandparams. - A data field rename that cannot be applied carries
fieldand, when a contact stops it,contact. - A contact number that is refused carries
reason.
object
Names why a number or a row is refused.
Values:
number_missing: the number is missing or blank.number_no_digits: the number holds no digits.identifier_invalid: an alphanumeric identifier does not start with a letter or a digit.number_not_international: the number is written as international and is not a valid one.number_not_for_country: the number is not valid for the statedcountry_code.country_code_required: the number is not international, and nocountry_codewas stated to read it by.value_too_long: a data value is longer than the account’s value limit in bytes. Given for a row only.type_mismatch: a data value does not read as the type its field holds across the account’s contacts. Given for a row only.
Groups the validation errors by entity.
object
object
Carries the SCN1xx constructor validation code.
Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; message carries the total count.
An agent a delete or a scenario publish was rejected for.
object
Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live automation that holds the resource a delete was rejected for.
object
Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live routing of an agent that is not archived, which holds the resource a delete was rejected for.
object
Lists the live users holding the role a delete was rejected for, capped at the first 20; message carries the total count.
A live user that holds the role a delete was rejected for.
object
Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; message carries the total count.
A live role that inherits the role a delete was rejected for.
object
Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once.
How many rows of a refused file were rejected for each reason; a reason no row had is absent.
object
The number cell is blank.
The number holds no digits.
An alphanumeric identifier does not start with a letter or a digit.
The number is written as international and is not a valid one.
The number is not valid for the stated country_code.
The number is not international, and no country_code was stated to read it by.
A data cell holds a value longer than the account’s value limit in bytes.
A data cell does not read as the type its field holds across the account’s contacts.
Names the rule the contact data breaks.
Values:
array_item_not_scalar: an array item is an object, an array or null.type_mismatch: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object.
Names the field by its path.
By failure:
- For a broken limit, it is the field that breaks the limit.
- For too many fields, it is the first new field past the limit.
- For a rename, it is the field that stops the rename.
Names the first contact whose data stops a rename; absent when the two paths alone conflict.
Carries the details of the breach.
By breach:
- For a broken limit, it carries the numbers of the limit.
- For a type mismatch, it carries the two types.
- For an array item that is not a scalar, it is empty.
object
Reports the account’s limit.
Reports the value the data would have: the fields, the bytes or the items.
Names the type the field holds across the account’s contacts.
Names the type of the new value.
The credential is valid and in scope, but the caller’s roles do not grant the permission the operation needs.
Example
{ "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "permission_denied"}Not found
object
Carries the stable lower_snake_case usecase code, such as scenario_not_found.
Carries the registered machine code, stable once assigned.
The codes:
ERRxxx: is a generic code that follows from the status class.ERR001–ERR020: are reserved for generic codes.SCN1xxand other entity-prefixed codes: appear only inside validation details.
Carries structured detail, present only where there is structure to carry it.
By failure:
- A validation failure carries the topic
validationand per-entityerrors. - A delete conflict carries the topic
conflict; its referencing dependents are inagents,automations,routings,usersorroles, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic
conflict, withagents. - An agent change refused because of its automations carries the topic
conflict, withautomations. - A file none of whose rows is usable carries the topic
rows_rejected, withrowsandreasons. - Contact data past a limit of its account carries
trigger,fieldandparams. - A data field rename that cannot be applied carries
fieldand, when a contact stops it,contact. - A contact number that is refused carries
reason.
object
Names why a number or a row is refused.
Values:
number_missing: the number is missing or blank.number_no_digits: the number holds no digits.identifier_invalid: an alphanumeric identifier does not start with a letter or a digit.number_not_international: the number is written as international and is not a valid one.number_not_for_country: the number is not valid for the statedcountry_code.country_code_required: the number is not international, and nocountry_codewas stated to read it by.value_too_long: a data value is longer than the account’s value limit in bytes. Given for a row only.type_mismatch: a data value does not read as the type its field holds across the account’s contacts. Given for a row only.
Groups the validation errors by entity.
object
object
Carries the SCN1xx constructor validation code.
Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; message carries the total count.
An agent a delete or a scenario publish was rejected for.
object
Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live automation that holds the resource a delete was rejected for.
object
Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live routing of an agent that is not archived, which holds the resource a delete was rejected for.
object
Lists the live users holding the role a delete was rejected for, capped at the first 20; message carries the total count.
A live user that holds the role a delete was rejected for.
object
Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; message carries the total count.
A live role that inherits the role a delete was rejected for.
object
Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once.
How many rows of a refused file were rejected for each reason; a reason no row had is absent.
object
The number cell is blank.
The number holds no digits.
An alphanumeric identifier does not start with a letter or a digit.
The number is written as international and is not a valid one.
The number is not valid for the stated country_code.
The number is not international, and no country_code was stated to read it by.
A data cell holds a value longer than the account’s value limit in bytes.
A data cell does not read as the type its field holds across the account’s contacts.
Names the rule the contact data breaks.
Values:
array_item_not_scalar: an array item is an object, an array or null.type_mismatch: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object.
Names the field by its path.
By failure:
- For a broken limit, it is the field that breaks the limit.
- For too many fields, it is the first new field past the limit.
- For a rename, it is the field that stops the rename.
Names the first contact whose data stops a rename; absent when the two paths alone conflict.
Carries the details of the breach.
By breach:
- For a broken limit, it carries the numbers of the limit.
- For a type mismatch, it carries the two types.
- For an array item that is not a scalar, it is empty.
object
Reports the account’s limit.
Reports the value the data would have: the fields, the bytes or the items.
Names the type the field holds across the account’s contacts.
Names the type of the new value.
Refuses an identifier that names no resource the caller can use.
Returned when:
- No live resource with this identifier is visible to the caller.
- The resource the identifier names belongs to another account.
Refuses a scenario id the caller cannot see.
Returned when:
- No scenario with this id exists.
- The scenario belongs to an account outside the caller’s tenant.
- The scenario belongs to another account of the tenant and is not shared for copy.
Example
{ "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "not_found"}Unprocessable
object
Carries the stable lower_snake_case usecase code, such as scenario_not_found.
Carries the registered machine code, stable once assigned.
The codes:
ERRxxx: is a generic code that follows from the status class.ERR001–ERR020: are reserved for generic codes.SCN1xxand other entity-prefixed codes: appear only inside validation details.
Carries structured detail, present only where there is structure to carry it.
By failure:
- A validation failure carries the topic
validationand per-entityerrors. - A delete conflict carries the topic
conflict; its referencing dependents are inagents,automations,routings,usersorroles, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic
conflict, withagents. - An agent change refused because of its automations carries the topic
conflict, withautomations. - A file none of whose rows is usable carries the topic
rows_rejected, withrowsandreasons. - Contact data past a limit of its account carries
trigger,fieldandparams. - A data field rename that cannot be applied carries
fieldand, when a contact stops it,contact. - A contact number that is refused carries
reason.
object
Names why a number or a row is refused.
Values:
number_missing: the number is missing or blank.number_no_digits: the number holds no digits.identifier_invalid: an alphanumeric identifier does not start with a letter or a digit.number_not_international: the number is written as international and is not a valid one.number_not_for_country: the number is not valid for the statedcountry_code.country_code_required: the number is not international, and nocountry_codewas stated to read it by.value_too_long: a data value is longer than the account’s value limit in bytes. Given for a row only.type_mismatch: a data value does not read as the type its field holds across the account’s contacts. Given for a row only.
Groups the validation errors by entity.
object
object
Carries the SCN1xx constructor validation code.
Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; message carries the total count.
An agent a delete or a scenario publish was rejected for.
object
Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live automation that holds the resource a delete was rejected for.
object
Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live routing of an agent that is not archived, which holds the resource a delete was rejected for.
object
Lists the live users holding the role a delete was rejected for, capped at the first 20; message carries the total count.
A live user that holds the role a delete was rejected for.
object
Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; message carries the total count.
A live role that inherits the role a delete was rejected for.
object
Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once.
How many rows of a refused file were rejected for each reason; a reason no row had is absent.
object
The number cell is blank.
The number holds no digits.
An alphanumeric identifier does not start with a letter or a digit.
The number is written as international and is not a valid one.
The number is not valid for the stated country_code.
The number is not international, and no country_code was stated to read it by.
A data cell holds a value longer than the account’s value limit in bytes.
A data cell does not read as the type its field holds across the account’s contacts.
Names the rule the contact data breaks.
Values:
array_item_not_scalar: an array item is an object, an array or null.type_mismatch: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object.
Names the field by its path.
By failure:
- For a broken limit, it is the field that breaks the limit.
- For too many fields, it is the first new field past the limit.
- For a rename, it is the field that stops the rename.
Names the first contact whose data stops a rename; absent when the two paths alone conflict.
Carries the details of the breach.
By breach:
- For a broken limit, it carries the numbers of the limit.
- For a type mismatch, it carries the two types.
- For an array item that is not a scalar, it is empty.
object
Reports the account’s limit.
Reports the value the data would have: the fields, the bytes or the items.
Names the type the field holds across the account’s contacts.
Names the type of the new value.
The version being published has an SMS brick, and agents that are not archived and have no SMS settings reference the scenario; data.agents names them, the first twenty of them.
The constructor is missing, or the constructor or a brick checked alone does not pass validation; data.errors.scenario lists each failure.
Refuses a body that does not pass validation.
Returned when:
- The body does not parse.
- The body lacks a required field.
- The body carries a value that is not accepted.
message names the field.
Example
{ "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "connected_agent_sms_settings_not_set"}Internal server error
object
Carries the stable lower_snake_case usecase code, such as scenario_not_found.
Carries the registered machine code, stable once assigned.
The codes:
ERRxxx: is a generic code that follows from the status class.ERR001–ERR020: are reserved for generic codes.SCN1xxand other entity-prefixed codes: appear only inside validation details.
Carries structured detail, present only where there is structure to carry it.
By failure:
- A validation failure carries the topic
validationand per-entityerrors. - A delete conflict carries the topic
conflict; its referencing dependents are inagents,automations,routings,usersorroles, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic
conflict, withagents. - An agent change refused because of its automations carries the topic
conflict, withautomations. - A file none of whose rows is usable carries the topic
rows_rejected, withrowsandreasons. - Contact data past a limit of its account carries
trigger,fieldandparams. - A data field rename that cannot be applied carries
fieldand, when a contact stops it,contact. - A contact number that is refused carries
reason.
object
Names why a number or a row is refused.
Values:
number_missing: the number is missing or blank.number_no_digits: the number holds no digits.identifier_invalid: an alphanumeric identifier does not start with a letter or a digit.number_not_international: the number is written as international and is not a valid one.number_not_for_country: the number is not valid for the statedcountry_code.country_code_required: the number is not international, and nocountry_codewas stated to read it by.value_too_long: a data value is longer than the account’s value limit in bytes. Given for a row only.type_mismatch: a data value does not read as the type its field holds across the account’s contacts. Given for a row only.
Groups the validation errors by entity.
object
object
Carries the SCN1xx constructor validation code.
Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; message carries the total count.
An agent a delete or a scenario publish was rejected for.
object
Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live automation that holds the resource a delete was rejected for.
object
Lists the live routings of agents that are not archived whose condition or scenario holds the resource a delete was rejected for, capped at the first 20; message carries the total count.
A live routing of an agent that is not archived, which holds the resource a delete was rejected for.
object
Lists the live users holding the role a delete was rejected for, capped at the first 20; message carries the total count.
A live user that holds the role a delete was rejected for.
object
Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; message carries the total count.
A live role that inherits the role a delete was rejected for.
object
Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once.
How many rows of a refused file were rejected for each reason; a reason no row had is absent.
object
The number cell is blank.
The number holds no digits.
An alphanumeric identifier does not start with a letter or a digit.
The number is written as international and is not a valid one.
The number is not valid for the stated country_code.
The number is not international, and no country_code was stated to read it by.
A data cell holds a value longer than the account’s value limit in bytes.
A data cell does not read as the type its field holds across the account’s contacts.
Names the rule the contact data breaks.
Values:
array_item_not_scalar: an array item is an object, an array or null.type_mismatch: a value has another type than its field holds across the account’s contacts, or is an object where the field holds a value, or a value where it holds an object.
Names the field by its path.
By failure:
- For a broken limit, it is the field that breaks the limit.
- For too many fields, it is the first new field past the limit.
- For a rename, it is the field that stops the rename.
Names the first contact whose data stops a rename; absent when the two paths alone conflict.
Carries the details of the breach.
By breach:
- For a broken limit, it carries the numbers of the limit.
- For a type mismatch, it carries the two types.
- For an array item that is not a scalar, it is empty.
object
Reports the account’s limit.
Reports the value the data would have: the fields, the bytes or the items.
Names the type the field holds across the account’s contacts.
Names the type of the new value.
Example
{ "data": { "reason": "number_missing", "trigger": "too_many_fields" }}Error codes
| Status | Error | Meaning |
|---|---|---|
| 400 | bad_request | Refuses a request whose form is wrong.
Returned when:
- The body, a path parameter or a query parameter does not parse.
- Content-Encoding names a compression the API does not accept, or the body cannot be decompressed as named.
- A brick to validate names a type or a version the API does not know.
- A data field path or a column name in the body is not well formed, or a key of a row's data is empty or holds a dot.
- A node position in the constructor of a scenario save carries one of x and y without the other.
- The operation needs a WebSocket upgrade, and the request is not one.
message names what failed. |
| 400 | missing_scope_header | The credential acts for a tenant or for the platform, and the request names no account in X-Account-Sid (or no tenant in X-Tenant-Sid). |
| 400 | scope_conflict | Refuses the value of the scope header. Returned when: - The scope header names an account or tenant the credential does not cover. - The scope header carries a value that is not an id of that kind. |
| 401 | unauthenticated | Refuses a request that cannot be authenticated. Returned when: - The request carries no usable credential. - The user, account or tenant behind the credential is not active. |
| 403 | permission_denied | The credential is valid and in scope, but the caller's roles do not grant the permission the operation needs. |
| 404 | not_found | Refuses an identifier that names no resource the caller can use. Returned when: - No live resource with this identifier is visible to the caller. - The resource the identifier names belongs to another account. |
| 404 | scenario_not_found | Refuses a scenario id the caller cannot see. Returned when: - No scenario with this id exists. - The scenario belongs to an account outside the caller's tenant. - The scenario belongs to another account of the tenant and is not shared for copy. |
| 422 | connected_agent_sms_settings_not_set | The version being published has an SMS brick, and agents that are not archived and have no SMS settings reference the scenario; data.agents names them, the first twenty of them. |
| 422 | scenario_validation_failed | The constructor is missing, or the constructor or a brick checked alone does not pass validation; data.errors.scenario lists each failure. |
| 422 | validation_failed | Refuses a body that does not pass validation.
Returned when:
- The body does not parse.
- The body lacks a required field.
- The body carries a value that is not accepted.
message names the field. |