Skip to main content
Runs represent batch executions of a decision flow against a customer segment. When a run is created, it is enqueued for processing by worker pods via BullMQ. Each run tracks its status, progress, and results.
See the Runs feature page for UI guidance on monitoring and managing batch runs.

Base path

/api/v1/runs

List runs

GET /api/v1/runs
Returns a paginated list of runs for the current tenant, ordered by creation date (newest first). Each run includes the associated decision flow name and segment details.

Query parameters

ParameterRequiredTypeDescription
limitNointegerMaximum results per page. Default 50, max 200.
offsetNointegerNumber of records to skip. Default 0.
This endpoint uses offset-based pagination instead of cursor-based pagination.

Response 200

{
  "runs": [
    {
      "id": "run_001",
      "tenantId": "t_001",
      "name": "Credit Card NBA x High Value Customers",
      "decisionFlowId": "df_001",
      "segmentId": "seg_001",
      "status": "completed",
      "decisionFlowName": "Credit Card NBA",
      "decisionFlowKey": "credit-card-nba",
      "segmentName": "High Value Customers",
      "segmentCustomerCount": 4521,
      "createdAt": "2026-03-15T14:00:00.000Z",
      "updatedAt": "2026-03-15T14:05:00.000Z"
    }
  ],
  "total": 12
}

Run statuses

StatusDescription
pendingRun created, waiting to be picked up by a worker.
runningWorker is actively processing the segment.
completedAll customers in the segment have been processed.
failedRun encountered an error and stopped.

Create a run

POST /api/v1/runs
Creates a new batch run and enqueues it for processing. The run name defaults to "{flow name} x {segment name}" if not provided.

Request body

FieldRequiredTypeDescription
decisionFlowIdYesstringDecision flow to execute.
segmentIdYesstringCustomer segment to process.
nameNostringCustom run name.

Validation checks

Before creating the run, the API validates:
  1. The decision flow exists and belongs to the tenant.
  2. The segment exists and has a materialized view (i.e., it has been saved with filters).
  3. At least one batch-compatible channel exists (delivery mode: file, integration, or manual).

Example request

{
  "decisionFlowId": "df_001",
  "segmentId": "seg_001",
  "name": "Q1 Campaign Run"
}

Response 201

{
  "id": "run_001",
  "tenantId": "t_001",
  "name": "Q1 Campaign Run",
  "decisionFlowId": "df_001",
  "segmentId": "seg_001",
  "status": "pending",
  "createdAt": "2026-03-15T14:00:00.000Z",
  "updatedAt": "2026-03-15T14:00:00.000Z"
}

Error codes

CodeReason
400Missing decisionFlowId or segmentId.
400Segment has no materialized view.
400No batch-compatible channels found.
404Decision flow or segment not found.

Role requirements

MethodMinimum role
GETviewer
POSTeditor