On this page
Start a run
Start a cloud task, chat or phone call from a published agent. The response confirms admission; follow the run to determine its outcome. test: true marks a run as a test; a phone run can still dial a real destination and invoke configured tools.
Operation ID: runs.create.
Request
POST /api/v1/runs
- TypeScript SDK:
client.runs.create(path arguments usepath). - MCP tool:
sdk_client_callwithoperationId: "runs.create"(path arguments useinput.path). Legacy alias:runs_create. Connect to your authenticated/mcpendpoint with an API key for the same environment. - Minimum API key role: member.
- Idempotency: Required. Send
Idempotency-Key(TypeScript SDK:idempotencyKey) and keep it for retries.
Read resource IDs from earlier responses and use a key for the same environment.
Request example
Use your published cloud agent ID. input must match that publication’s input schema. The response gives you a run_id for following this execution.
Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Set IDEMPOTENCY_KEY to a new UUID for this action and keep it for retries. Example values are synthetic.
cURL
curl --fail-with-body -sS -X POST "${CUMULUS_BASE_URL%/}/api/v1/runs" \
-H "Authorization: Bearer $CUMULUS_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
--data '{
"channel": "cloud",
"agent_id": "ticket-triage",
"mode": "task",
"input": {
"ticket": "I was charged twice this month."
}
}'
TypeScript
import { Cumulus } from "@cumulus/sdk";
const baseUrl = process.env.CUMULUS_BASE_URL;
const apiKey = process.env.CUMULUS_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Set CUMULUS_BASE_URL and CUMULUS_API_KEY");
const client = new Cumulus({ baseUrl, apiKey });
const idempotencyKey = process.env.IDEMPOTENCY_KEY;
if (!idempotencyKey) throw new Error("Set IDEMPOTENCY_KEY for this request");
const response = await client.runs.create({
"body": {
"channel": "cloud",
"agent_id": "ticket-triage",
"mode": "task",
"input": {
"ticket": "I was charged twice this month."
}
},
idempotencyKey,
});
Example response
Illustrative HTTP 201 response excerpt. HTTP 201 means the run was admitted. This excerpt shows the identity, publication version and current state; it is not the completed task result. Replaying the same request key returns HTTP 200 with the original run.
{
"run_id": "33333333-3333-4333-8333-333333333333",
"agent_id": "ticket-triage",
"version": 0,
"channel": "cloud",
"mode": "task",
"state": "admitted"
}
Use the response
Pass run_id to runs.get to read the current state. Once the task finishes, use runs.result to retrieve its structured output. The Runs guide shows waiting and event streaming.
import { waitUntilEnded } from "@cumulus/sdk/runtime";
const current = await client.runs.get({
path: { run_id: response.run_id },
});
console.log(current.run_id, current.state);
const ended = await waitUntilEnded(client, response.run_id, {
timeoutMs: 120_000,
});
if (ended.state === "completed") {
const result = await client.runs.result({
path: { run_id: response.run_id },
});
console.log(result);
}
Integration notes
For a phone call, send {channel: "phone", agent_id, to, from, dynamic_variables} and optionally version. The request dials a real number, including with test: true; confirm the destination before calling. Test runs are excluded from billing, customer webhooks and event triggers.
Use an imported number for from, or omit it to use the publication’s telephony.from. Supply the flow’s required variables in dynamic_variables; missing inputs return missing_dynamic_variables.
Check these refusal reasons:
tenant_not_configuredortenant_disabled: ask Cumulus to configure capacity and open admission.trunk_not_authorized: check that the caller ID and trunk are authorized.capacity_exhausted: wait for concurrent-run capacity.
For cloud execution, send {channel: "cloud", agent_id, mode: "task" | "chat", input}. To chat with a phone agent without dialing, use cloud chat with test: true.
Input schema
Path, query and header parameters
Idempotency-Key
header parameter · Required.
Type: string. minLength: 1. maxLength: 256.
JSON request body
| Field | Type or values | Required | Description and limits |
|---|---|---|---|
| Body · variant 1 | object | — | Fields for this schema branch. |
channel | "cloud" | Required | — |
agent_id | string | Required | Agent identifier in the environment selected by your API key. minLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$. |
version | integer | Optional | At least 0. At most 2147483647. |
mode | "task" · "chat" | Required | — |
input | object | Required | — |
input.* | any JSON value | Optional | Additional keys are allowed. |
metadata | object | Optional | Default: {}. |
metadata.* | string | Optional | Additional keys are allowed. |
test | boolean | Optional | Default: false. |
| Body · variant 2 | object | — | Fields for this schema branch. |
channel | "phone" | Required | — |
agent_id | string | Required | Agent identifier in the environment selected by your API key. minLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$. |
version | integer | Optional | At least 0. At most 2147483647. |
to | string | Required | pattern: ^+[1-9][0-9]{6,14}$. |
from | string | Optional | pattern: ^+[1-9][0-9]{6,14}$. |
dynamic_variables | object | Optional | Default: {}. |
dynamic_variables.* | string | Optional | Additional keys are allowed. |
metadata | object | Optional | Default: {}. |
metadata.* | string | Optional | Additional keys are allowed. |
test | boolean | Optional | Default: false. |
Complete OpenAPI schema
{
"parameters": [
{
"name": "Idempotency-Key",
"in": "header",
"required": true,
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RunsCreateRequest"
}
}
}
}
}
Responses
HTTP 200
Admit a cloud or phone run of a publication (201; an idempotent replay returns 200)
application/json
| Field | Type or values | Required | Description and limits |
|---|---|---|---|
owner_id | string | Required | minLength: 1. |
environment | string | Required | minLength: 1. |
tenant_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
run_id | string (uuid) | Required | Run identifier returned when the run was admitted. pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
agent_id | string | Required | Agent identifier in the environment selected by your API key. minLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$. |
publication | object | Required | — |
publication.agent_id | string | Required | Agent identifier in the environment selected by your API key. minLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$. |
publication.version | integer | Required | At least 0. At most 2147483647. |
publication.digest | string | Required | pattern: ^sha256:[a-f0-9]{64}$. |
plan_schema_version | integer | Required | Greater than 0. At most 9007199254740991. |
channel | "cloud" · "phone" · "web" | Required | — |
mode | "task" · "chat" · "background" · "outbound" · "inbound" | Required | — |
state | "admitted" · "running" · "ending" · "completed" · "failed" · "cancelled" · "rejected" · "expired" | Required | — |
phone_state | "admitted" · "preparing" · "awaiting_sip" · "dialing" · "ringing" · "active" · "terminating" · "ended" · "rejected" · "expired" · "setup_failed" or null | Required | — |
outcome | object or null | Required | — |
| outcome · combined section 1 | object | — | Fields for this schema branch. |
outcome.transport | "completed" · "busy" · "no_answer" · "rejected" · "cancelled" · "provider_failure" · "admission_expired" · "not_applicable" | Required in a non-null parent | — |
outcome.execution | "completed" · "failed" · "cancelled" · "not_started" · "unknown" | Required in a non-null parent | — |
outcome.contact | "human" · "voicemail" · "ivr" · "unknown" · "not_applicable" | Required in a non-null parent | — |
outcome.business | object | Required in a non-null parent | — |
| outcome.business · variant 1 | object | — | Fields for this schema branch. |
outcome.business.status | "known" | Required in a non-null parent | — |
outcome.business.value | string | Required in a non-null parent | minLength: 1. maxLength: 256. |
| outcome.business · variant 2 | object | — | Fields for this schema branch. |
outcome.business.status | "unknown" | Required in a non-null parent | — |
outcome.reason | string | Required in a non-null parent | minLength: 1. maxLength: 128. |
outcome.result | object or null | Required in a non-null parent | — |
| outcome.result · combined section 1 | object | — | Fields for this schema branch. |
outcome.result.artifact_id | string (uuid) | Required in a non-null parent | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
outcome.result.sha256 | string | Required in a non-null parent | pattern: ^[a-f0-9]{64}$. |
outcome.result.byte_size | integer | Required in a non-null parent | At least 0. At most 9007199254740991. |
outcome.result.media_type | string | Required in a non-null parent | minLength: 1. maxLength: 128. |
outcome.result.expires_at | string (date-time) or null | Required in a non-null parent | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
disposition | string or null | Required | — |
trigger | object | Required | — |
| trigger · variant 1 | object | — | Fields for this schema branch. |
trigger.kind | "sip" | Required | — |
trigger.number_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
trigger.call_id_sha256 | string | Required | pattern: ^[a-f0-9]{64}$. |
| trigger · variant 2 | object | — | Fields for this schema branch. |
trigger.kind | "api" | Required | — |
trigger.idempotency_key_sha256 | string | Required | pattern: ^[a-f0-9]{64}$. |
| trigger · variant 3 | object | — | Fields for this schema branch. |
trigger.kind | "schedule" | Required | — |
trigger.trigger_id | string | Required | minLength: 1. maxLength: 128. |
trigger.scheduled_for | string (date-time) | Required | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
| trigger · variant 4 | object | — | Fields for this schema branch. |
trigger.kind | "event" | Required | — |
trigger.trigger_id | string | Required | minLength: 1. maxLength: 128. |
trigger.source_event_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| trigger · variant 5 | object | — | Fields for this schema branch. |
trigger.kind | "callback" | Required | — |
trigger.source_run_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
trigger.effect_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| trigger · variant 6 | object | — | Fields for this schema branch. |
trigger.kind | "evaluation" | Required | — |
trigger.comparison_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| trigger · variant 7 | object | — | Fields for this schema branch. |
trigger.kind | "test" | Required | — |
trigger.test_run_id | string (uuid) | Required | Identifier of the test run whose progress or results you are reading. pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
trigger.suite_id | string (uuid) | Required | Identifier of the test suite. pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
trigger.case_id | string | Required | minLength: 1. maxLength: 64. pattern: ^[a-z0-9][a-z0-9_-]*$. |
trigger.trial | integer | Required | Greater than 0. At most 9007199254740991. |
principal | object | Required | — |
| principal · variant 1 | object | — | Fields for this schema branch. |
principal.owner_id | string | Required | minLength: 1. |
principal.environment | string | Required | minLength: 1. |
principal.kind | "user" | Required | — |
principal.id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| principal · variant 2 | object | — | Fields for this schema branch. |
principal.owner_id | string | Required | minLength: 1. |
principal.environment | string | Required | minLength: 1. |
principal.kind | "api_key" | Required | — |
principal.id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| principal · variant 3 | object | — | Fields for this schema branch. |
principal.owner_id | string | Required | minLength: 1. |
principal.environment | string | Required | minLength: 1. |
principal.kind | "system" | Required | — |
principal.id | string | Required | minLength: 1. maxLength: 256. |
attempt_count | integer | Required | At least 0. At most 9007199254740991. |
created_at | string (date-time) | Required | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
started_at | string (date-time) or null | Required | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
ended_at | string (date-time) or null | Required | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
version | integer | Required | At least 0. At most 2147483647. |
to | string or null | Required | minLength: 1. maxLength: 64. |
from | string or null | Required | minLength: 1. maxLength: 64. |
duration_ms | integer or null | Required | At least 0. At most 9007199254740991. |
metadata | object | Required | — |
metadata.* | string | Optional | Additional keys are allowed. |
test | boolean | Required | — |
provider_keys | object | Optional | — |
provider_keys.* | object | Optional | Additional keys are allowed. |
HTTP 201
Admit a cloud or phone run of a publication (201; an idempotent replay returns 200)
application/json
| Field | Type or values | Required | Description and limits |
|---|---|---|---|
owner_id | string | Required | minLength: 1. |
environment | string | Required | minLength: 1. |
tenant_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
run_id | string (uuid) | Required | Run identifier returned when the run was admitted. pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
agent_id | string | Required | Agent identifier in the environment selected by your API key. minLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$. |
publication | object | Required | — |
publication.agent_id | string | Required | Agent identifier in the environment selected by your API key. minLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$. |
publication.version | integer | Required | At least 0. At most 2147483647. |
publication.digest | string | Required | pattern: ^sha256:[a-f0-9]{64}$. |
plan_schema_version | integer | Required | Greater than 0. At most 9007199254740991. |
channel | "cloud" · "phone" · "web" | Required | — |
mode | "task" · "chat" · "background" · "outbound" · "inbound" | Required | — |
state | "admitted" · "running" · "ending" · "completed" · "failed" · "cancelled" · "rejected" · "expired" | Required | — |
phone_state | "admitted" · "preparing" · "awaiting_sip" · "dialing" · "ringing" · "active" · "terminating" · "ended" · "rejected" · "expired" · "setup_failed" or null | Required | — |
outcome | object or null | Required | — |
| outcome · combined section 1 | object | — | Fields for this schema branch. |
outcome.transport | "completed" · "busy" · "no_answer" · "rejected" · "cancelled" · "provider_failure" · "admission_expired" · "not_applicable" | Required in a non-null parent | — |
outcome.execution | "completed" · "failed" · "cancelled" · "not_started" · "unknown" | Required in a non-null parent | — |
outcome.contact | "human" · "voicemail" · "ivr" · "unknown" · "not_applicable" | Required in a non-null parent | — |
outcome.business | object | Required in a non-null parent | — |
| outcome.business · variant 1 | object | — | Fields for this schema branch. |
outcome.business.status | "known" | Required in a non-null parent | — |
outcome.business.value | string | Required in a non-null parent | minLength: 1. maxLength: 256. |
| outcome.business · variant 2 | object | — | Fields for this schema branch. |
outcome.business.status | "unknown" | Required in a non-null parent | — |
outcome.reason | string | Required in a non-null parent | minLength: 1. maxLength: 128. |
outcome.result | object or null | Required in a non-null parent | — |
| outcome.result · combined section 1 | object | — | Fields for this schema branch. |
outcome.result.artifact_id | string (uuid) | Required in a non-null parent | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
outcome.result.sha256 | string | Required in a non-null parent | pattern: ^[a-f0-9]{64}$. |
outcome.result.byte_size | integer | Required in a non-null parent | At least 0. At most 9007199254740991. |
outcome.result.media_type | string | Required in a non-null parent | minLength: 1. maxLength: 128. |
outcome.result.expires_at | string (date-time) or null | Required in a non-null parent | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
disposition | string or null | Required | — |
trigger | object | Required | — |
| trigger · variant 1 | object | — | Fields for this schema branch. |
trigger.kind | "sip" | Required | — |
trigger.number_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
trigger.call_id_sha256 | string | Required | pattern: ^[a-f0-9]{64}$. |
| trigger · variant 2 | object | — | Fields for this schema branch. |
trigger.kind | "api" | Required | — |
trigger.idempotency_key_sha256 | string | Required | pattern: ^[a-f0-9]{64}$. |
| trigger · variant 3 | object | — | Fields for this schema branch. |
trigger.kind | "schedule" | Required | — |
trigger.trigger_id | string | Required | minLength: 1. maxLength: 128. |
trigger.scheduled_for | string (date-time) | Required | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
| trigger · variant 4 | object | — | Fields for this schema branch. |
trigger.kind | "event" | Required | — |
trigger.trigger_id | string | Required | minLength: 1. maxLength: 128. |
trigger.source_event_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| trigger · variant 5 | object | — | Fields for this schema branch. |
trigger.kind | "callback" | Required | — |
trigger.source_run_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
trigger.effect_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| trigger · variant 6 | object | — | Fields for this schema branch. |
trigger.kind | "evaluation" | Required | — |
trigger.comparison_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| trigger · variant 7 | object | — | Fields for this schema branch. |
trigger.kind | "test" | Required | — |
trigger.test_run_id | string (uuid) | Required | Identifier of the test run whose progress or results you are reading. pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
trigger.suite_id | string (uuid) | Required | Identifier of the test suite. pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
trigger.case_id | string | Required | minLength: 1. maxLength: 64. pattern: ^[a-z0-9][a-z0-9_-]*$. |
trigger.trial | integer | Required | Greater than 0. At most 9007199254740991. |
principal | object | Required | — |
| principal · variant 1 | object | — | Fields for this schema branch. |
principal.owner_id | string | Required | minLength: 1. |
principal.environment | string | Required | minLength: 1. |
principal.kind | "user" | Required | — |
principal.id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| principal · variant 2 | object | — | Fields for this schema branch. |
principal.owner_id | string | Required | minLength: 1. |
principal.environment | string | Required | minLength: 1. |
principal.kind | "api_key" | Required | — |
principal.id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
| principal · variant 3 | object | — | Fields for this schema branch. |
principal.owner_id | string | Required | minLength: 1. |
principal.environment | string | Required | minLength: 1. |
principal.kind | "system" | Required | — |
principal.id | string | Required | minLength: 1. maxLength: 256. |
attempt_count | integer | Required | At least 0. At most 9007199254740991. |
created_at | string (date-time) | Required | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
started_at | string (date-time) or null | Required | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
ended_at | string (date-time) or null | Required | pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:.\d+)?(?:Z))$. |
version | integer | Required | At least 0. At most 2147483647. |
to | string or null | Required | minLength: 1. maxLength: 64. |
from | string or null | Required | minLength: 1. maxLength: 64. |
duration_ms | integer or null | Required | At least 0. At most 9007199254740991. |
metadata | object | Required | — |
metadata.* | string | Optional | Additional keys are allowed. |
test | boolean | Required | — |
provider_keys | object | Optional | — |
provider_keys.* | object | Optional | Additional keys are allowed. |
Error responses
| HTTP | Description |
|---|---|
| 4XX | Typed error (ApiError) |
| 5XX | Typed error (ApiError) |
Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.
Complete OpenAPI schema
{
"200": {
"description": "Admit a cloud or phone run of a publication (201; an idempotent replay returns 200)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Run"
}
}
}
},
"201": {
"description": "Admit a cloud or phone run of a publication (201; an idempotent replay returns 200)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Run"
}
}
}
},
"4XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"5XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
Referenced schemas
Expand the complete OpenAPI definitions for integrations that generate their own clients.
Complete OpenAPI schema
{
"components": {
"schemas": {
"RunsCreateRequest": {
"oneOf": [
{
"type": "object",
"properties": {
"channel": {
"type": "string",
"enum": [
"cloud"
]
},
"agent_id": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
},
"version": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647
},
"mode": {
"type": "string",
"enum": [
"task",
"chat"
]
},
"input": {
"type": "object",
"additionalProperties": {}
},
"metadata": {
"default": {},
"type": "object",
"additionalProperties": {
"type": "string",
"maxLength": 512
}
},
"test": {
"default": false,
"type": "boolean"
}
},
"required": [
"channel",
"agent_id",
"mode",
"input"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"channel": {
"type": "string",
"enum": [
"phone"
]
},
"agent_id": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
},
"version": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647
},
"to": {
"type": "string",
"pattern": "^\\+[1-9][0-9]{6,14}$"
},
"from": {
"type": "string",
"pattern": "^\\+[1-9][0-9]{6,14}$"
},
"dynamic_variables": {
"default": {},
"type": "object",
"additionalProperties": {
"type": "string",
"maxLength": 4096
}
},
"metadata": {
"default": {},
"type": "object",
"additionalProperties": {
"type": "string",
"maxLength": 512
}
},
"test": {
"default": false,
"type": "boolean"
}
},
"required": [
"channel",
"agent_id",
"to"
],
"additionalProperties": false
}
]
},
"Run": {
"type": "object",
"properties": {
"owner_id": {
"type": "string",
"minLength": 1
},
"environment": {
"type": "string",
"minLength": 1
},
"tenant_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
},
"run_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
},
"agent_id": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
},
"publication": {
"$ref": "#/components/schemas/PublicationRef"
},
"plan_schema_version": {
"type": "integer",
"minimum": 0,
"exclusiveMinimum": true,
"maximum": 9007199254740991
},
"channel": {
"type": "string",
"enum": [
"cloud",
"phone",
"web"
]
},
"mode": {
"type": "string",
"enum": [
"task",
"chat",
"background",
"outbound",
"inbound"
]
},
"state": {
"type": "string",
"enum": [
"admitted",
"running",
"ending",
"completed",
"failed",
"cancelled",
"rejected",
"expired"
]
},
"phone_state": {
"nullable": true,
"type": "string",
"enum": [
"admitted",
"preparing",
"awaiting_sip",
"dialing",
"ringing",
"active",
"terminating",
"ended",
"rejected",
"expired",
"setup_failed"
]
},
"outcome": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/RunOutcome"
}
]
},
"disposition": {
"nullable": true,
"type": "string"
},
"trigger": {
"oneOf": [
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"sip"
]
},
"number_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
},
"call_id_sha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
}
},
"required": [
"kind",
"number_id",
"call_id_sha256"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"api"
]
},
"idempotency_key_sha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
}
},
"required": [
"kind",
"idempotency_key_sha256"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"schedule"
]
},
"trigger_id": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"scheduled_for": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
}
},
"required": [
"kind",
"trigger_id",
"scheduled_for"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"event"
]
},
"trigger_id": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"source_event_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
}
},
"required": [
"kind",
"trigger_id",
"source_event_id"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"callback"
]
},
"source_run_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
},
"effect_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
}
},
"required": [
"kind",
"source_run_id",
"effect_id"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"evaluation"
]
},
"comparison_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
}
},
"required": [
"kind",
"comparison_id"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"test"
]
},
"test_run_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
},
"suite_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
},
"case_id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"pattern": "^[a-z0-9][a-z0-9_-]*$"
},
"trial": {
"type": "integer",
"minimum": 0,
"exclusiveMinimum": true,
"maximum": 9007199254740991
}
},
"required": [
"kind",
"test_run_id",
"suite_id",
"case_id",
"trial"
],
"additionalProperties": false
}
]
},
"principal": {
"$ref": "#/components/schemas/PrincipalRef"
},
"attempt_count": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"created_at": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"started_at": {
"nullable": true,
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"ended_at": {
"nullable": true,
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"version": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647
},
"to": {
"nullable": true,
"type": "string",
"minLength": 1,
"maxLength": 64
},
"from": {
"nullable": true,
"type": "string",
"minLength": 1,
"maxLength": 64
},
"duration_ms": {
"nullable": true,
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"metadata": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"test": {
"type": "boolean"
},
"provider_keys": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"type": "object",
"properties": {
"source": {
"type": "string",
"enum": [
"platform"
]
}
},
"required": [
"source"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"source": {
"type": "string",
"enum": [
"tenant"
]
},
"last4": {
"type": "string",
"minLength": 1,
"maxLength": 4
},
"fingerprint": {
"type": "string",
"pattern": "^sha256:[a-f0-9]{12}$"
}
},
"required": [
"source",
"last4",
"fingerprint"
],
"additionalProperties": false
}
]
}
}
},
"required": [
"owner_id",
"environment",
"tenant_id",
"run_id",
"agent_id",
"publication",
"plan_schema_version",
"channel",
"mode",
"state",
"phone_state",
"outcome",
"disposition",
"trigger",
"principal",
"attempt_count",
"created_at",
"started_at",
"ended_at",
"version",
"to",
"from",
"duration_ms",
"metadata",
"test"
],
"additionalProperties": false
},
"PublicationRef": {
"type": "object",
"properties": {
"agent_id": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$"
},
"version": {
"type": "integer",
"minimum": 0,
"maximum": 2147483647
},
"digest": {
"type": "string",
"pattern": "^sha256:[a-f0-9]{64}$"
}
},
"required": [
"agent_id",
"version",
"digest"
],
"additionalProperties": false
},
"RunOutcome": {
"type": "object",
"properties": {
"transport": {
"type": "string",
"enum": [
"completed",
"busy",
"no_answer",
"rejected",
"cancelled",
"provider_failure",
"admission_expired",
"not_applicable"
]
},
"execution": {
"type": "string",
"enum": [
"completed",
"failed",
"cancelled",
"not_started",
"unknown"
]
},
"contact": {
"type": "string",
"enum": [
"human",
"voicemail",
"ivr",
"unknown",
"not_applicable"
]
},
"business": {
"oneOf": [
{
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"known"
]
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
},
"required": [
"status",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"status": {
"type": "string",
"enum": [
"unknown"
]
}
},
"required": [
"status"
],
"additionalProperties": false
}
]
},
"reason": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"result": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/ContentRef"
}
]
}
},
"required": [
"transport",
"execution",
"contact",
"business",
"reason",
"result"
],
"additionalProperties": false
},
"ContentRef": {
"type": "object",
"properties": {
"artifact_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
},
"sha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"byte_size": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"media_type": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"expires_at": {
"nullable": true,
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
}
},
"required": [
"artifact_id",
"sha256",
"byte_size",
"media_type",
"expires_at"
],
"additionalProperties": false
},
"PrincipalRef": {
"oneOf": [
{
"type": "object",
"properties": {
"owner_id": {
"type": "string",
"minLength": 1
},
"environment": {
"type": "string",
"minLength": 1
},
"kind": {
"type": "string",
"enum": [
"user"
]
},
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
}
},
"required": [
"owner_id",
"environment",
"kind",
"id"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"owner_id": {
"type": "string",
"minLength": 1
},
"environment": {
"type": "string",
"minLength": 1
},
"kind": {
"type": "string",
"enum": [
"api_key"
]
},
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
}
},
"required": [
"owner_id",
"environment",
"kind",
"id"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"owner_id": {
"type": "string",
"minLength": 1
},
"environment": {
"type": "string",
"minLength": 1
},
"kind": {
"type": "string",
"enum": [
"system"
]
},
"id": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
},
"required": [
"owner_id",
"environment",
"kind",
"id"
],
"additionalProperties": false
}
]
},
"ApiError": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"unauthenticated",
"forbidden",
"not_found",
"conflict",
"invalid_request",
"idempotency_conflict",
"policy_denied",
"capability_unavailable",
"provider_unavailable",
"knowledge_unavailable",
"publication_invalid",
"run_not_active",
"rate_limited",
"outcome_unknown",
"internal"
]
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"outcome": {
"type": "string",
"enum": [
"none",
"unknown"
]
},
"details": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"code",
"message",
"retryable",
"outcome"
],
"additionalProperties": false
}
},
"required": [
"error"
],
"additionalProperties": false
}
}
}
}
Errors and recovery
See API error handling and Troubleshooting.