See also: Runs concept and configuration for what this API powers, when to call it, and how it is configured.
See the Campaigns feature page for UI guidance on creating and managing campaigns.
Base path
List campaigns
Query parameters
Response 200
Create campaign
Request body
When
status is active and scheduleType is not manual, the campaign is picked up by the /api/v1/cron/campaign-scheduler route (5-minute cadence in the in-process maintenance scheduler) and a campaign run is triggered automatically once the schedule is due — see Schedule Configuration for the full firing semantics.Example request
fileConfig above is the campaign-owned file output (Run.fileConfig v2) — it drives the file every file-mode channel in the campaign writes. See File Output Configuration for the full field and column-source reference.
Response 201
Returns the created campaign object.
Update campaign
name, description, status, scheduleType, scheduleDayOfWeek, scheduleDayOfMonth, scheduleTime, scheduleTimezone, scheduleCron, frequencyCaps, fileConfig, channelIds, decisionFlowId, segmentId.
Unlike most update endpoints, PUT allows changing
decisionFlowId and segmentId to retarget a campaign to a different decision flow or customer segment.Delete campaign
admin role.
Get campaign detail
Trigger a campaign run
FOR UPDATE lock on the campaign, so the endpoint is idempotent under concurrency: two racing triggers (a double-click, a retry, or a manual trigger coinciding with a scheduled tick) can’t each mint a run and each execute the full segment. A trigger issued while a run for the campaign is already pending or running returns that in-flight run with 200 (below) rather than starting a second.
Response 201 (new run created)
Response 200 (a run is already in flight)
Returns the existing pending/running campaign run unchanged — no second execution is started.
List campaign runs
Each run’s
summary.fileOutputs[].filePath is a retrievable download — GET /api/v1/runs/artifacts/:id when it wasn’t uploaded to S3. See Retrieving Generated Files.Execute a run inline (background)
POST /api/v1/runs/:id/campaign-runs so the run gets a campaign-run record, retry semantics, and DLQ visibility.
Request Body
string
required
Identifier of the run record that the executor will update with
status, startedAt, and completedAt.string
required
Decision flow to execute against.
string
required
Customer-segment view name. The executor reads from this Postgres view to enumerate target customers.
Response
Status200.
GET /api/v1/runs/:id.
Status codes
Roles
admin, editor.Errors raised by the batch executor after the response is sent are logged but never surfaced to the caller. The run record’s
status and error fields are the source of truth for outcome — poll GET /api/v1/runs/:id to see the final state.