/programs- Program management/program-executions- Execution management
Types
Type Definitions
Type Definitions
Program Endpoints
Create a new program
Example (batch mode — default):| Code | Error | Description |
|---|---|---|
| 400 | ValidationError | Invalid request (missing fields, invalid format) |
| 404 | DidNotFoundError | DID not found |
| 400 | DidNotActiveError | DID is not active |
| 400 | DidNotAccessibleError | DID is not available to this organization |
mode: 'batch'(default) —audienceIdrequired,triggerConditionmust not be setmode: 'live'—triggerConditionrequired,audienceIdoptional (auto-created if not provided)triggerCondition.attributeNamemust reference an existing date-type custom attribute in the org
List all programs
Get program details
Error Responses:| Code | Error | Description |
|---|---|---|
| 404 | DidNotFoundError | DID not found |
| 400 | DidNotActiveError | DID is not active |
| 400 | DidNotAccessibleError | DID is not available to this organization |
| 404 | ProgramNotFoundError | Program not found |
Update a program
| Code | Error | Description |
|---|---|---|
| 404 | ProgramNotFoundError | Program not found |
Delete a program
Error Responses:| Code | Error | Description |
|---|---|---|
| 404 | ProgramNotFoundError | Program not found |
Launch a new execution of the program
Batch mode: Snapshots the audience and starts calling contacts immediately. Live mode: The output audience was auto-created when the program was created. Launch pre-computes triggers for all org contacts with the matching attribute and starts the trigger evaluation cron. Contacts are called as their triggers become due.| Code | Error | Description |
|---|---|---|
| 404 | ProgramNotFoundError | Program not found |
| 400 | ExecutionAlreadyRunningError | Program already has a running execution |
| 400 | AudienceEmptyError | Audience has no contacts (batch only) |
| 400 | EmptyDidPoolError | All DIDs have been deleted since program creation |
| 409 | ProgramStatusConflictError | Program status changed (concurrent operation) |
List all executions for a program
| Code | Error | Description |
|---|---|---|
| 404 | ProgramNotFoundError | Program not found |
List contact triggers for a live program
| Code | Error | Description |
|---|---|---|
| 400 | BadRequestException | Program is not in live mode |
| 404 | ProgramNotFoundError | Program not found |
Program Execution Endpoints
List all active executions
Get execution details
Error Responses:| Code | Error | Description |
|---|---|---|
| 404 | ExecutionNotFoundError | Execution not found |
Pause a running execution
Notes:- Already-queued calls will continue to completion
- New contacts will not be pulled until resumed
- Only valid for executions in
runningstatus
| Code | Error | Description |
|---|---|---|
| 404 | ExecutionNotFoundError | Execution not found |
| 400 | InvalidExecutionStateError | Execution is not in running state |
Resume a paused execution
Optional Request Body:- Valid for executions in
paused,paused_no_credits, orpaused_thresholdstatus - When resuming from
paused_threshold, counters withresetOnResume: trueare reset to zero - If
autoPauseRulesis provided in the body, the execution’s rules are updated before resuming
| Code | Error | Description |
|---|---|---|
| 404 | ExecutionNotFoundError | Execution not found |
| 400 | InvalidExecutionStateError | Execution is not in paused, paused_no_credits, or paused_threshold state |
Cancel an execution
Notes:- Remaining pending contacts are marked as
skipped - Already-queued calls will continue to completion
- Sets execution status to
cancelled
| Code | Error | Description |
|---|---|---|
| 404 | ExecutionNotFoundError | Execution not found |
Notes
Retry Strategy Examples
No retries:- Retries failed calls after 30 minutes
- Maximum 3 retries (4 total attempts)
- Retries at specific dates/times
- Number of entries = number of retry attempts
Pause Windows
Pause windows define time ranges when calls should NOT be made. The orchestrator respects these windows and skips pulling contacts during paused periods. Weekly pause (lunch break):Execution Lifecycle
Progress Counters
totalContacts: Snapshot of audience size at launch (batch), or incremented as triggers fire (live)contactsCompleted: Successfully answered callscontactsFailed: Exhausted all retriescontactsPending: Waiting to be called (includes pending_retry)contactsInProgress: Currently queued or in-call
totalContacts = contactsCompleted + contactsFailed + contactsPending + contactsInProgress
Live mode note: totalContacts starts at 0 and grows as triggers become due. The execution never auto-completes — it runs until manually stopped or stopAt is reached.
Auto-Pause Rules
Auto-pause rules allow automatic pausing of an execution when a node has been executed a certain number of times across all calls. Counters are execution-scoped, Redis-backed, and atomic. How it works:- Define
autoPauseRuleson the program (snapshotted to execution at launch) - Each rule specifies a
nodeIdand athreshold— every time that node executes in any call, the counter increments implicitly - When a counter reaches its threshold, the execution is automatically paused with status
paused_threshold - Resume via
PATCH /program-executions/:id/resume— counters withresetOnResume: trueare reset to zero. Optionally pass updatedautoPauseRulesin the request body.
- Multiple rules are supported; any single rule reaching its threshold triggers the pause
- Counting is implicit: no flow changes needed — just specify the node ID in the rules
- Counter state is cleaned up when executions reach terminal states (completed, stopped, cancelled)