Documentation Index
Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt
Use this file to discover all available pages before exploring further.
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
| Parameter | Required | Type | Description |
|---|---|---|---|
limit | No | integer | Max results per page. Default 50, max 200. |
offset | No | integer | Records to skip. Default 0. |
Response 200
Create campaign
Request body
| Field | Required | Type | Description |
|---|---|---|---|
decisionFlowId | Yes | string | Decision flow to execute |
segmentId | Yes | string | Customer segment to target |
name | No | string | Campaign name (auto-generated if omitted) |
description | No | string | Campaign purpose and notes |
status | No | enum | draft, active, paused, archived. Default: draft |
scheduleType | No | enum | manual, daily, weekly, monthly. Default: manual |
scheduleDayOfWeek | No | integer | 0=Sun..6=Sat (for weekly) |
scheduleDayOfMonth | No | string | 1-28 or last_working_day (for monthly) |
scheduleTime | No | string | HH:mm format. Default: 09:00 |
scheduleTimezone | No | string | IANA timezone identifier (for example America/New_York). Default: UTC. |
scheduleCron | No | string | Cron expression for custom schedules (e.g., 0 9 * * 1). Used when scheduleType does not cover the desired frequency. |
frequencyCaps | No | object | { maxTotalPerRun?, maxPerOffer?, maxPerChannel? } |
fileConfig | No | object | { format, columns[], includePersonalization, destination, s3Path? } |
channelIds | No | string[] | Batch channel IDs to target (empty = all batch channels) |
Example request
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
Response 201
List campaign runs
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
Identifier of the run record that the executor will update with
status, startedAt, and completedAt.Decision flow to execute against.
Customer-segment view name. The executor reads from this Postgres view to enumerate target customers.
Response
Status200.
GET /api/v1/runs/:id.
Status codes
| Code | When |
|---|---|
| 200 | Executor dispatched (returned immediately, before completion) |
| 400 | Missing runId, decisionFlowId, or segmentViewName |
| 401 / 403 | Caller is not authenticated, or not admin / editor |
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.Campaign statuses
| Status | Description |
|---|---|
draft | Created but not yet active |
active | Live — scheduled runs execute automatically |
paused | Temporarily disabled |
archived | Retired, preserved for history |
Run statuses
| Status | Description |
|---|---|
pending | Waiting for worker to pick up |
running | Processing customers |
completed | All customers processed |
completed_with_errors | Finished but some deliveries failed |
failed | Unrecoverable error |
Role requirements
| Method | Minimum role |
|---|---|
| GET (list/detail) | viewer |
| POST (create/trigger) | editor |
| PUT (update) | editor |
| DELETE | admin |