Create communication (agent-dialed, or a scenario test call)
const url = 'https://example.com/v1/communication/-/dispatch';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"recipient":"example","agent_sid":"example","strategy_sid":"example","scheduled_at":"2026-04-15T12:00:00Z","data":{},"schedule":{},"scenario_sid":"example","draft":true}'};
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/communication/-/dispatch \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "recipient": "example", "agent_sid": "example", "strategy_sid": "example", "scheduled_at": "2026-04-15T12:00:00Z", "data": {}, "schedule": {}, "scenario_sid": "example", "draft": true }'Agent_sid dials through a configured agent (today’s behavior). scenario_sid is a test call: dispatched immediately, no strategy/number/campaign pre-creation needed. Exactly one of the two is required.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Target account for account-scoped resources. Principals without an account scope (superuser, tenant API key) MUST send it to declare which account to operate in. Account-scoped principals may omit it; if sent it must match their own account or the request is rejected with scope_conflict. For tenant API keys the account must belong to the key’s tenant.
Request Bodyrequired
Section titled “Request Bodyrequired”Exactly one of agent_sid / scenario_sid is required; the other is a 422. agent_sid dials through a configured agent (dispatch timing is the server’s decision, not the caller’s). scenario_sid is a test call: draft selects the axis (omit for the current published version). Either variant may set scheduled_at to defer the dispatch; strategy_sid / schedule / data are agent-path only and ignored with scenario_sid. The from-number is the scenario’s agent number for a published run through an agent, otherwise a free account number. timezone is never accepted here — it is always derived server-side (the bound agent’s, or the account’s).
object
Flat map of scalar values (string/number/boolean); nested objects and arrays are rejected with 422.
object
object
Test call: the scenario to dial directly.
Test call only: true runs the current draft (frozen on first use); omit for the current published version.
Examplegenerated
{ "recipient": "example", "agent_sid": "example", "strategy_sid": "example", "scheduled_at": "2026-04-15T12:00:00Z", "data": {}, "schedule": {}, "scenario_sid": "example", "draft": true}Responses
Section titled “Responses”Created
object
Scenario the communication runs; empty on legacy rows created before the scenario binding was recorded.
Published scenario version; null when the run used a draft.
Draft scenario version; null when the run used a published version. Exactly one of version / draft_version is set.
object
object
object
object
Call duration in seconds, measured by the execution layer; 0 until the call completes.
Whether this is a test communication.
Whether personal-data recording consent was granted for the call.
Whether a stored call recording exists for this communication.
Whether a saved call execution history exists for this communication.
Example
{ "direction": "inbound", "communication_status": "new", "call_status": "busy"}Invalid request body or parameters
object
Stable lower_snake_case usecase code (e.g. scenario_not_found)
Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered
Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)
object
Validation errors keyed by entity
object
object
SCN1xx constructor validation code
Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "data": { "topic": "example", "errors": { "scenario": [ { "code": "example", "message": "example", "summary": "example", "tree_id": "example", "node_id": "example", "output_type": "example", "duplicate_tree_index": "example", "duplicate_node_index": "example", "property": "example", "invalid_value": "example" } ] }, "agents": [ "example" ] }}Missing or invalid credentials
object
Stable lower_snake_case usecase code (e.g. scenario_not_found)
Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered
Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)
object
Validation errors keyed by entity
object
object
SCN1xx constructor validation code
Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "data": { "topic": "example", "errors": { "scenario": [ { "code": "example", "message": "example", "summary": "example", "tree_id": "example", "node_id": "example", "output_type": "example", "duplicate_tree_index": "example", "duplicate_node_index": "example", "property": "example", "invalid_value": "example" } ] }, "agents": [ "example" ] }}Semantic validation failure
object
Stable lower_snake_case usecase code (e.g. scenario_not_found)
Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered
Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)
object
Validation errors keyed by entity
object
object
SCN1xx constructor validation code
Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "data": { "topic": "example", "errors": { "scenario": [ { "code": "example", "message": "example", "summary": "example", "tree_id": "example", "node_id": "example", "output_type": "example", "duplicate_tree_index": "example", "duplicate_node_index": "example", "property": "example", "invalid_value": "example" } ] }, "agents": [ "example" ] }}Internal server error
object
Stable lower_snake_case usecase code (e.g. scenario_not_found)
Registered machine code — generic ERRxxx by status class (ERR001–ERR020 reserved); entity-prefixed codes (SCN1xx) appear only inside validation details; registry in docs/specifications/error-envelope-design.md, append-only, never renumbered
Structured details, present only where there is structure to carry: validation failures (topic validation, per-entity errors) and delete conflicts (topic conflict, referencing agents)
object
Validation errors keyed by entity
object
object
SCN1xx constructor validation code
Ids of the agents referencing the resource a delete was rejected for; first 20 — message carries the total count
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "data": { "topic": "example", "errors": { "scenario": [ { "code": "example", "message": "example", "summary": "example", "tree_id": "example", "node_id": "example", "output_type": "example", "duplicate_tree_index": "example", "duplicate_node_index": "example", "property": "example", "invalid_value": "example" } ] }, "agents": [ "example" ] }}