On this page
Cancel a run
Cancel an active run. A phone call settles as cancelled after its media session ends.
Operation ID: runs.cancel.
Request
POST /api/v1/runs/{run_id}/cancel
- TypeScript SDK:
client.runs.cancel(path arguments usepath). - MCP tool:
sdk_client_callwithoperationId: "runs.cancel"(path arguments useinput.path). Legacy alias:runs_cancel. Connect to your authenticated/mcpendpoint with an API key for the same environment. - Minimum API key role: member.
- Idempotency: No header required; the resource or revision identifies the change.
Read resource IDs from earlier responses and use a key for the same environment.
Request example
Use the run_id of the active execution you intend to stop. Cancellation is a request; read runs.get until it settles. Cancelling does not undo completed external effects.
Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Example values are synthetic.
cURL
curl --fail-with-body -sS -X POST "${CUMULUS_BASE_URL%/}/api/v1/runs/${RUN_ID}/cancel" \
-H "Authorization: Bearer $CUMULUS_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"reason": "operator_requested"
}'
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 response = await client.runs.cancel({
"path": {
"run_id": "<run_id>"
},
"body": {
"reason": "operator_requested"
}
});
Input schema
Path, query and header parameters
run_id
path parameter · Required.
Type: string (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})$.
JSON request body
| Field | Type or values | Required | Description and limits |
|---|---|---|---|
reason | string | Optional | Default: "customer_cancelled". pattern: ^[a-z][a-z0-9_.:-]{0,127}$. |
Complete OpenAPI schema
{
"parameters": [
{
"name": "run_id",
"in": "path",
"required": true,
"schema": {
"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})$"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RunsCancelRequest"
}
}
}
}
}
Responses
HTTP 202
Cancel an active run (accepted: a live call settles cancelled when its media session ends)
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
{
"202": {
"description": "Cancel an active run (accepted: a live call settles cancelled when its media session ends)",
"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": {
"RunsCancelRequest": {
"type": "object",
"properties": {
"reason": {
"default": "customer_cancelled",
"type": "string",
"pattern": "^[a-z][a-z0-9_.:-]{0,127}$"
}
},
"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.