CumulusDocs
Open Studio
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 use path).
  • MCP tool: sdk_client_call with operationId: "runs.cancel" (path arguments use input.path). Legacy alias: runs_cancel. Connect to your authenticated /mcp endpoint 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
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

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

FieldType or valuesRequiredDescription and limits
reasonstringOptionalDefault: "customer_cancelled". pattern: ^[a-z][a-z0-9_.:-]{0,127}$.
Complete OpenAPI schema
OpenAPI JSON
{
  "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

FieldType or valuesRequiredDescription and limits
owner_idstringRequiredminLength: 1.
environmentstringRequiredminLength: 1.
tenant_idstring (uuid)Requiredpattern: ^([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_idstring (uuid)RequiredRun 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_idstringRequiredAgent identifier in the environment selected by your API key. minLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$.
publicationobjectRequired—
publication.agent_idstringRequiredAgent identifier in the environment selected by your API key. minLength: 1. maxLength: 256. pattern: ^[A-Za-z0-9][A-Za-z0-9_.:-]*$.
publication.versionintegerRequiredAt least 0. At most 2147483647.
publication.digeststringRequiredpattern: ^sha256:[a-f0-9]{64}$.
plan_schema_versionintegerRequiredGreater 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 nullRequired—
outcomeobject or nullRequired—
outcome · combined section 1object—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.businessobjectRequired in a non-null parent—
outcome.business · variant 1object—Fields for this schema branch.
outcome.business.status"known"Required in a non-null parent—
outcome.business.valuestringRequired in a non-null parentminLength: 1. maxLength: 256.
outcome.business · variant 2object—Fields for this schema branch.
outcome.business.status"unknown"Required in a non-null parent—
outcome.reasonstringRequired in a non-null parentminLength: 1. maxLength: 128.
outcome.resultobject or nullRequired in a non-null parent—
outcome.result · combined section 1object—Fields for this schema branch.
outcome.result.artifact_idstring (uuid)Required in a non-null parentpattern: ^([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.sha256stringRequired in a non-null parentpattern: ^[a-f0-9]{64}$.
outcome.result.byte_sizeintegerRequired in a non-null parentAt least 0. At most 9007199254740991.
outcome.result.media_typestringRequired in a non-null parentminLength: 1. maxLength: 128.
outcome.result.expires_atstring (date-time) or nullRequired in a non-null parentpattern: ^(?:(?:\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))$.
dispositionstring or nullRequired—
triggerobjectRequired—
trigger · variant 1object—Fields for this schema branch.
trigger.kind"sip"Required—
trigger.number_idstring (uuid)Requiredpattern: ^([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_sha256stringRequiredpattern: ^[a-f0-9]{64}$.
trigger · variant 2object—Fields for this schema branch.
trigger.kind"api"Required—
trigger.idempotency_key_sha256stringRequiredpattern: ^[a-f0-9]{64}$.
trigger · variant 3object—Fields for this schema branch.
trigger.kind"schedule"Required—
trigger.trigger_idstringRequiredminLength: 1. maxLength: 128.
trigger.scheduled_forstring (date-time)Requiredpattern: ^(?:(?:\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 4object—Fields for this schema branch.
trigger.kind"event"Required—
trigger.trigger_idstringRequiredminLength: 1. maxLength: 128.
trigger.source_event_idstring (uuid)Requiredpattern: ^([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 5object—Fields for this schema branch.
trigger.kind"callback"Required—
trigger.source_run_idstring (uuid)Requiredpattern: ^([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_idstring (uuid)Requiredpattern: ^([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 6object—Fields for this schema branch.
trigger.kind"evaluation"Required—
trigger.comparison_idstring (uuid)Requiredpattern: ^([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 7object—Fields for this schema branch.
trigger.kind"test"Required—
trigger.test_run_idstring (uuid)RequiredIdentifier 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_idstring (uuid)RequiredIdentifier 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_idstringRequiredminLength: 1. maxLength: 64. pattern: ^[a-z0-9][a-z0-9_-]*$.
trigger.trialintegerRequiredGreater than 0. At most 9007199254740991.
principalobjectRequired—
principal · variant 1object—Fields for this schema branch.
principal.owner_idstringRequiredminLength: 1.
principal.environmentstringRequiredminLength: 1.
principal.kind"user"Required—
principal.idstring (uuid)Requiredpattern: ^([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 2object—Fields for this schema branch.
principal.owner_idstringRequiredminLength: 1.
principal.environmentstringRequiredminLength: 1.
principal.kind"api_key"Required—
principal.idstring (uuid)Requiredpattern: ^([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 3object—Fields for this schema branch.
principal.owner_idstringRequiredminLength: 1.
principal.environmentstringRequiredminLength: 1.
principal.kind"system"Required—
principal.idstringRequiredminLength: 1. maxLength: 256.
attempt_countintegerRequiredAt least 0. At most 9007199254740991.
created_atstring (date-time)Requiredpattern: ^(?:(?:\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_atstring (date-time) or nullRequiredpattern: ^(?:(?:\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_atstring (date-time) or nullRequiredpattern: ^(?:(?:\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))$.
versionintegerRequiredAt least 0. At most 2147483647.
tostring or nullRequiredminLength: 1. maxLength: 64.
fromstring or nullRequiredminLength: 1. maxLength: 64.
duration_msinteger or nullRequiredAt least 0. At most 9007199254740991.
metadataobjectRequired—
metadata.*stringOptionalAdditional keys are allowed.
testbooleanRequired—
provider_keysobjectOptional—
provider_keys.*objectOptionalAdditional keys are allowed.

Error responses

HTTPDescription
4XXTyped error (ApiError)
5XXTyped error (ApiError)

Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.

Complete OpenAPI schema
OpenAPI JSON
{
  "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
OpenAPI JSON
{
  "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.

Content version 17b47e6dCustomer SDKMarkdown source
Cancel a run · Cumulus developer docs