# Validate scenario POST /v1/a/scenario/{id}/validate Select code sample ``` const url = 'https://example.com/v1/a/scenario/example/validate'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', '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 ' \ --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" } } }' ``` - /v1/a/scenario/{id}/validate 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`](https://docs.aiva.apifonica.com/concepts/roles-and-permissions/#scenario-write). ## Authorizations - **[bearerAuth](https://docs.aiva.apifonica.com/api/account/#bearerauth)** ## Parameters ### Path Parameters **id** required string Names the stored scenario whose next version is checked, or `-` for a new scenario. ### Header Parameters **X-Account-Sid** string 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 Media typeapplication/json object **type** required string Allowed values: constructor **name** required string **constructor** object **bricks** 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.}}`; 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_tree` and `end`: no property takes a variable. - `condition_group` and `assignment`: only `value` takes 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 the `path` and `set_if_not_found` of a response mapping take a variable. - A property that names a variable to write, such as `variable` of a response mapping or of `increment`, is written to and not read. - The guide with examples: object **audio** object **v1** Array\ object **id** required string **description** string **properties** object **play\_mode** Picks which of the brick’s `audios` it plays. Refused when: - A publish carries no value. - A publish carries an undeclared value. string Allowed values: all one\_next one\_random **audios** Array\ object **mode** string **tts\_properties** object **text** string **file\_properties** object **url** string **tts\_general** object **language** string **voice** string **engine** string **speed** number format: float **model** string **outputs** Array\ object **type** string **description** string **audio\_file** object **v1** Array\ object **id** required string **description** string **properties** object **url** string **outputs** Array\ object **type** string **description** string **audio\_tts** object **v1** Array\ object **id** required string **description** string **properties** object **text** string **language** string **voice** string **engine** string **model** string **outputs** Array\ object **type** string **description** string **sms** object **v1** Array\ object **id** required string **description** string **properties** Message content only. Provider, credentials, and sender identity resolve from the agent’s SMS settings at send time. object **to** Overrides the recipient; empty means the communication recipient. string **text** string **outputs** Array\ object **type** string **description** string **goal** object **v1** Array\ object **id** required string **description** string **properties** object **goal** string **outputs** Array\ object **type** string **description** string **end\_call** object **v1** Array\ object **id** required string **description** string **properties** object **signal** string **outputs** Array\ object **type** string **description** string **assignment** object **v1** Array\ object **id** required string **description** string **properties** object **variables** Array\ object **name** string **value** string **outputs** Array\ object **type** string **description** string **increment** object **v1** Array\ object **id** required string **description** string **properties** object **variables** Array\ object **variable** string **outputs** Array\ object **type** string **description** string **condition\_group** object **v1** Array\ object **id** required string **description** string **properties** object **condition** object **conditions** Array\ object **condition\_id** string **description** string **condition\_operator** How a condition joins its elements. string Allowed values: and or **elements** Array\ object **variable** string **element\_operator** How one condition element compares its variable against its value. string Allowed values: equal not\_equal greater\_than less\_than greater\_than\_equal less\_than\_equal in not\_in contains not\_contains starts\_with **value** string **outputs** Array\ object **type** string **description** string **start\_tree** object **v1** Array\ object **id** required string **description** string **properties** object **outputs** Array\ object **type** string **description** string **start\_call** object **v1** Array\ Starts the call and hands it to the `outbound_call` or the `inbound_call` brick. Replaced by `v2`. object **id** required string **description** string **properties** object **stt\_general** object **language** string **engine** string Allowed values: gsr gsr\@v2 azuresr experimental mohir soniox elevenlabs **model** string **primary\_language** string **fallback\_languages** Array\ **endpoint\_detection** 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 **enabled** Switches endpoint detection on. Values: - `true`: is allowed only where the `engine` of the same settings is `soniox`. - `false`: the other values are stored and not checked. boolean **latency\_adjustment\_level** Sets the engine’s endpoint latency adjustment level, from 0 to 3. Omitting it is the same as sending 0. integer **sensitivity** Sets the engine’s endpoint sensitivity, from -1.0 to 1.0. Omitting it is the same as sending 0. number format: float **max\_delay\_ms** Sets the engine’s maximum endpoint delay in milliseconds, from 500 to 3000. Required while `enabled` is true. integer **tts\_general** object **language** string **voice** string **engine** string **speed** number format: float **model** string **outputs** Array\ object **type** string **description** string **v2** Array\ 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 while `voicemail_enabled` is true. - `busy`: the line of an outbound call is busy. Required. - `unanswered`: nobody answers an outbound call. Required. Rules: - After `busy` and `unanswered` there 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 `busy` or `unanswered` through a link to an `end` brick. - An output with no link ends the scenario. object **id** required string **description** string **properties** object **stt\_general** object **language** string **engine** string Allowed values: gsr gsr\@v2 azuresr experimental mohir soniox elevenlabs **model** string **primary\_language** string **fallback\_languages** Array\ **endpoint\_detection** 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 **enabled** Switches endpoint detection on. Values: - `true`: is allowed only where the `engine` of the same settings is `soniox`. - `false`: the other values are stored and not checked. boolean **latency\_adjustment\_level** Sets the engine’s endpoint latency adjustment level, from 0 to 3. Omitting it is the same as sending 0. integer **sensitivity** Sets the engine’s endpoint sensitivity, from -1.0 to 1.0. Omitting it is the same as sending 0. number format: float **max\_delay\_ms** Sets the engine’s maximum endpoint delay in milliseconds, from 500 to 3000. Required while `enabled` is true. integer **tts\_general** object **language** string **voice** string **engine** string **speed** number format: float **model** string **voicemail\_enabled** 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. boolean **outputs** Array\ object **type** string **description** string **outbound\_call** object **v1** Array\ object **id** required string **description** string **properties** object **is\_voicemail** boolean **outputs** Array\ object **type** string **description** string **inbound\_call** object **v1** Array\ object **id** required string **description** string **properties** object **outputs** Array\ object **type** string **description** string **end** object **v1** Array\ object **id** required string **description** string **properties** object **outputs** Array\ object **type** string **description** string **call\_transfer** object **v1** Array\ object **id** required string **description** string **properties** object **from** string **number** string **message\_to\_manager** object **mode** string **tts** object **text** string **file** object **url** string **message\_to\_client** object **mode** string **tts** object **text** string **file** object **url** string **timeout** integer **tts\_properties** object **language** string **voice** string **engine** string **model** string **sip\_header** object **sip\_headers** Array\ object **name** string **value** string **transfer\_mode** 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. string **outputs** Array\ object **type** string **description** string **question** object **v1** Array\ object **id** required string **description** string **properties** object **tts\_properties** object **language** string **voice** string **engine** string **speed** number format: float **model** string **dtmf\_properties** object **dtmf\_timeout** number format: float **no\_input\_timeout** number format: float **min\_symbols** integer **max\_symbols** integer **finish\_on\_key** string **stt\_properties** object **speech\_timeout** number format: float **no\_input\_timeout** number format: float **language** string **recognition\_shift** object **direction** The direction the recognition window moves, by `duration`. string Allowed values: backward forward **duration** number format: float **engine** string Allowed values: gsr gsr\@v2 azuresr experimental mohir soniox elevenlabs **grammar\_parameter** object **parameters** Array\ object **key** string **value** string **class\_token** object **tokens** Array\ **filter** object **filters** Array\ **tokens** Array\ **intent\_properties** object **classifier** The classifier a question brick classifies against. object **id** string **version** Pins the classifier version this brick classifies against. Rules: - `0` is 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`. integer **model\_id** 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. string **llm\_properties** object **engine** string **model** string **messages** Array\ object **role** The party the chat message is attributed to. string Allowed values: system assistant user function **content** string **temperature** number format: float **provider** string **gdpr\_required** boolean **threshold** number format: float **timezone** string **recognition\_mode** string **enable\_voice\_activity\_detection** boolean **interruptible\_dialog** boolean **interruption\_shift** object **direction** The direction the recognition window moves, by `duration`. string Allowed values: backward forward **duration** number format: float **model** string **primary\_language** string **fallback\_languages** Array\ **endpoint\_detection** 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 **enabled** Switches endpoint detection on. Values: - `true`: is allowed only where the `engine` of the same settings is `soniox`. - `false`: the other values are stored and not checked. boolean **latency\_adjustment\_level** Sets the engine’s endpoint latency adjustment level, from 0 to 3. Omitting it is the same as sending 0. integer **sensitivity** Sets the engine’s endpoint sensitivity, from -1.0 to 1.0. Omitting it is the same as sending 0. number format: float **max\_delay\_ms** Sets the engine’s maximum endpoint delay in milliseconds, from 500 to 3000. Required while `enabled` is true. integer **statement** object **audio** object **mode** string **tts** object **text** string **file** object **url** string **is\_interruptible** boolean **type** Picks the question shape. Values: - `closed`: branches on a match in `answer.answers`, which must then be non-empty. - `open`: branches on `valid`. Any other value is refused on publish. string **input\_mode** Picks how the reply is captured. Values: - `dtmf`: needs `dtmf_properties`. - `speech`: needs `stt_properties`. Anything else fails a publish. string **answer** object **answers** Array\ object **answer\_id** string **description** string **speech\_input** object **tokens** Array\ **mode** How the answer is matched against what the person said. string Allowed values: token-based intent-based intent-llm-based token-llm-based token-intent-llm-based **intent** object **id** string **entity** object **entities** Array\ object **type** string **variable** object **name** string **dtmf\_input** object **value** string **tag** string **fallback\_invalid** object **fallbacks** Array\ 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 **is\_repeat\_statement** boolean **audio** object **mode** string **tts** object **text** string **file** object **url** string **is\_interruptible** boolean **type** Picks what the fallback plays. Values: - `initial`: repeats the question’s own statement. - `custom`: plays the fallback’s own audio. - `llm`: generates a reply. string Allowed values: initial custom llm **llm\_properties** object **engine** string **model** string **messages** Array\ object **role** The party the chat message is attributed to. string Allowed values: system assistant user function **content** string **temperature** number format: float **provider** string **gdpr\_required** boolean **entity** object **entities** Array\ object **type** string **variable** object **name** string **fallback\_empty** object **fallbacks** Array\ 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 **is\_repeat\_statement** boolean **audio** object **mode** string **tts** object **text** string **file** object **url** string **is\_interruptible** boolean **type** Picks what the fallback plays. Values: - `initial`: repeats the question’s own statement. - `custom`: plays the fallback’s own audio. - `llm`: generates a reply. string Allowed values: initial custom llm **llm\_properties** object **engine** string **model** string **messages** Array\ object **role** The party the chat message is attributed to. string Allowed values: system assistant user function **content** string **temperature** number format: float **provider** string **gdpr\_required** boolean **entity** object **entities** Array\ object **type** string **variable** object **name** string **outputs** Array\ object **type** string **description** string **webhook** object **v1** Array\ object **id** required string **description** string **properties** object **request** required object **method** required string **url** required string **body** object **data** string **type** string **form\_values** Array\ object **name** string **value** string **authentication** object **type** string **basic** object **username** string **password** string **bearer** object **token** string **header** object **headers** Array\ object **name** string **value** string **insecure\_skip\_verify** boolean **proxy** object **url** string **attach\_call\_metadata** boolean **timeout** number format: float **options** object **async** boolean **timeout** number format: float **response\_mapping** object **variables** Array\ object **name** Names the target variable, written as a placeholder. Returned unwrapped in `variables`. string /^\\{\\{\[A-Za-z0-9\\-\_.]+\\}\\}$/ **source** Picks where the value is read from. Values: - `body`: `path` holds a JSONPath. - `header`: `path` holds the header name. string **path** string **set\_if\_not\_found** string **outputs** Array\ object **type** string **description** string **data\_mapping** object **v1** Array\ object **id** required string **description** string **properties** object **input** string **variables** Array\ object **name** string **path** string **set\_if\_not\_found** string **outputs** Array\ object **type** string **description** string **tree** object **v1** Array\ object **id** required string **description** string **properties** object **tree** object **id** string **outputs** Array\ object **type** string **description** string **end\_tree** object **v1** Array\ object **id** required string **description** string **properties** object **output** object **type** string **description** string **outputs** Array\ object **type** string **description** string **background\_audio** object **v1** Array\ object **id** required string **description** string **properties** object **audio** object **audios** Array\ object **mode** string **file\_properties** object **url** string **volume** integer **outputs** Array\ object **type** string **description** string **javascript** object **v1** Array\ object **id** required string **description** string **properties** object **id** required 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. string **input\_variables** Array\ **outputs** Array\ object **type** string **description** string **warm\_up\_tts** object **v1** Array\ object **id** required string **description** string **properties** object **brick** object **bricks** Array\ object **id** string **type** string **outputs** Array\ object **type** string **description** string **business\_metric** object **v1** Array\ object **id** required string **description** string **properties** object **key** string **value** string **outputs** Array\ object **type** string **description** string **ai\_agent** object **v1** Array\ object **id** required string **description** required string **properties** object **prompts** object **restrictions** object **content** string **role** object **content** string **initial\_phrase** object **content** string **is\_interruptible** boolean **skill** object **skills** Array\ object **id** required string **name** string **function\_name** string **description** required string **parameters** object **type** string **properties** object ***key*** additional properties object **type** string **description** string **variable\_name** string **enum** Array\ **default** string **required** Array\ **additional\_properties** boolean **knowledge\_base** object **type** string **prompt** object **content** string **rag** object **document** object **ids** Array\ **number** integer **threshold** number format: float **fallbacks** object **error** object **counter** integer **empty** object **counter** integer **configuration** object **llm** object **engine** string **model** string **temperature** Sets the sampling temperature of the model, from 0 to 1. `0` or no value uses the default of the model. number format: float **max\_tokens** integer **provider** string **gdpr\_required** boolean **tts** object **language** string **voice** string **engine** string **speed** number format: float **model** string **stt** object **speech\_timeout** number format: float **no\_input\_timeout** number format: float **language** string **recognition\_shift** object **direction** The direction the recognition window moves, by `duration`. string Allowed values: backward forward **duration** number format: float **engine** string Allowed values: gsr gsr\@v2 azuresr experimental mohir soniox elevenlabs **grammar\_parameter** object **parameters** Array\ object **key** string **value** string **class\_token** object **tokens** Array\ **filter** object **filters** Array\ **tokens** Array\ **intent\_properties** object **classifier** The classifier a question brick classifies against. object **id** string **version** Pins the classifier version this brick classifies against. Rules: - `0` is 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`. integer **model\_id** 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. string **llm\_properties** object **engine** string **model** string **messages** Array\ object **role** The party the chat message is attributed to. string Allowed values: system assistant user function **content** string **temperature** number format: float **provider** string **gdpr\_required** boolean **threshold** number format: float **timezone** string **recognition\_mode** string **enable\_voice\_activity\_detection** boolean **interruptible\_dialog** boolean **interruption\_shift** object **direction** The direction the recognition window moves, by `duration`. string Allowed values: backward forward **duration** number format: float **model** string **primary\_language** string **fallback\_languages** Array\ **endpoint\_detection** 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 **enabled** Switches endpoint detection on. Values: - `true`: is allowed only where the `engine` of the same settings is `soniox`. - `false`: the other values are stored and not checked. boolean **latency\_adjustment\_level** Sets the engine’s endpoint latency adjustment level, from 0 to 3. Omitting it is the same as sending 0. integer **sensitivity** Sets the engine’s endpoint sensitivity, from -1.0 to 1.0. Omitting it is the same as sending 0. number format: float **max\_delay\_ms** Sets the engine’s maximum endpoint delay in milliseconds, from 500 to 3000. Required while `enabled` is true. integer **dialog** object **context\_mode** string **max\_turns** integer **outputs** Array\ object **type** string **description** string **send\_dtmf** object **v1** Array\ object **id** required string **description** required string **properties** object **digits** string **interval** integer **duration** integer **outputs** Array\ object **type** string **description** string **recording\_setup** object **v1** Array\ object **id** required string **description** required string **properties** object **outputs** Array\ object **type** string **description** string **transcription** object **v1** Array\ object **id** required string **description** required string **properties** object **request** object **requests** Array\ object **source** object **type** Picks what is transcribed. Values: - `last_recording`: the call’s last recording is transcribed. - `url`: audio fetched from `url` is transcribed. string Allowed values: last\_recording url **url** string **engine** The engine that transcribes the source. string Allowed values: whisper **prompt** string **model** string **outputs** Array\ object **type** string **description** string **forest** object **trees** Array\ object **description** string **tree\_id** string **nodes** Array\ object **id** string **brick** object **id** string **type** string Allowed values: ai\_agent assignment audio audio\_file audio\_tts background\_audio call\_transfer condition\_group data\_mapping end end\_call end\_tree goal inbound\_call increment javascript outbound\_call question sms start\_call start\_tree transcription tree warm\_up\_tts webhook **version** string **links** Array\ object **output\_type** string **reference** object **tree\_id** string **node\_id** string **return** object **tree\_id** string **node\_id** string **position** Any of: object **x** required number format: double **y** required number format: double null **properties** object **engine\_version** Any value sent is stored as v3. string Allowed values: v3 ## Responses ### 200 OK Media typeapplication/json object **valid** required Reports that the body passes every check of a publish; always true, because a body that fails a check is refused. boolean ##### Examplegenerated ``` { "valid": true } ``` ### 400 Bad request Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required 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. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** 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 stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was 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. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** 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. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** 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. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** 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. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** 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 **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: 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. string Allowed values: bad\_request 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`). string Allowed values: missing\_scope\_header 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. string Allowed values: scope\_conflict ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "bad_request" } ``` ### 401 Unauthorized Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required 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. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** 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 stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was 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. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** 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. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** 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. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** 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. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** 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 **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: 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. string Allowed values: unauthenticated ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "unauthenticated" } ``` ### 403 Forbidden Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required 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. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** 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 stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was 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. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** 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. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** 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. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** 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. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** 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 **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: The credential is valid and in scope, but the caller’s roles do not grant the permission the operation needs. string Allowed values: permission\_denied ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "permission_denied" } ``` ### 404 Not found Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required 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. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** 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 stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was 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. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** 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. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** 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. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** 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. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** 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 **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: 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. string Allowed values: 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. string Allowed values: scenario\_not\_found ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "not_found" } ``` ### 422 Unprocessable Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required 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. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** 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 stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was 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. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** 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. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** 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. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** 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. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** 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 **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string **error** required One of: 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. string Allowed values: connected\_agent\_sms\_settings\_not\_set The constructor is missing, or the constructor or a brick checked alone does not pass validation; `data.errors.scenario` lists each failure. string Allowed values: scenario\_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. string Allowed values: validation\_failed ##### Example ``` { "data": { "reason": "number_missing", "trigger": "too_many_fields" }, "error": "connected_agent_sms_settings_not_set" } ``` ### 500 Internal server error Media typeapplication/json object **error** required Carries the stable lower\_snake\_case usecase code, such as `scenario_not_found`. string **code** required 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. - `SCN1xx` and other entity-prefixed codes: appear only inside validation details. string **message** required string **data** Carries structured detail, present only where there is structure to carry it. By failure: - A validation failure carries the topic `validation` and per-entity `errors`. - A delete conflict carries the topic `conflict`; its referencing dependents are in `agents`, `automations`, `routings`, `users` or `roles`, depending on what holds the resource. - A scenario publish refused because of its agents carries the topic `conflict`, with `agents`. - An agent change refused because of its automations carries the topic `conflict`, with `automations`. - A file none of whose rows is usable carries the topic `rows_rejected`, with `rows` and `reasons`. - Contact data past a limit of its account carries `trigger`, `field` and `params`. - A data field rename that cannot be applied carries `field` and, when a contact stops it, `contact`. - A contact number that is refused carries `reason`. object **topic** string **reason** 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 stated `country_code`. - `country_code_required`: the number is not international, and no `country_code` was 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. string Allowed values: number\_missing number\_no\_digits identifier\_invalid number\_not\_international number\_not\_for\_country country\_code\_required value\_too\_long type\_mismatch **errors** Groups the validation errors by entity. object **scenario** Array\ object **code** Carries the SCN1xx constructor validation code. string **message** string **summary** string **tree\_id** string **node\_id** string **output\_type** string **duplicate\_tree\_index** string **duplicate\_node\_index** string **property** string **invalid\_value** string **agents** Lists the agents a delete or a scenario publish was rejected for, capped at the first 20; `message` carries the total count. Array\ An agent a delete or a scenario publish was rejected for. object **id** required string **name** required string **automations** Lists the live automations referencing the resource a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live automation that holds the resource a delete was rejected for. object **id** required string **name** required string **routings** 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. Array\ A live routing of an agent that is not archived, which holds the resource a delete was rejected for. object **id** required string **name** required string **agent\_sid** required string **users** Lists the live users holding the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live user that holds the role a delete was rejected for. object **id** required string **email** required string **roles** Lists the live roles inheriting the role a delete was rejected for, capped at the first 20; `message` carries the total count. Array\ A live role that inherits the role a delete was rejected for. object **id** required string **name** required string **rows** Lists the rows of the refused file, a row repeating an earlier row’s number as written counted once. integer format: int64 **reasons** How many rows of a refused file were rejected for each reason; a reason no row had is absent. object **number\_missing** The number cell is blank. integer format: int64 **number\_no\_digits** The number holds no digits. integer format: int64 **identifier\_invalid** An alphanumeric identifier does not start with a letter or a digit. integer format: int64 **number\_not\_international** The number is written as international and is not a valid one. integer format: int64 **number\_not\_for\_country** The number is not valid for the stated `country_code`. integer format: int64 **country\_code\_required** The number is not international, and no `country_code` was stated to read it by. integer format: int64 **value\_too\_long** A data cell holds a value longer than the account’s value limit in bytes. integer format: int64 **type\_mismatch** A data cell does not read as the type its field holds across the account’s contacts. integer format: int64 **trigger** 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. string Allowed values: too\_many\_fields value\_too\_long too\_many\_array\_items array\_item\_not\_scalar type\_mismatch **field** 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. string **contact** Names the first contact whose data stops a rename; absent when the two paths alone conflict. string **params** 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 **limit** Reports the account’s limit. integer **current** Reports the value the data would have: the fields, the bytes or the items. integer **type** Names the type the field holds across the account’s contacts. string **got** Names the type of the new value. string ##### 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. |