Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

A staff session token, uk_st_…. Minted by sign-up, sign-in or the two-factor exchange. Only a 401 means it is spent; not_a_member (403) is about the organization named in X-Organization-Id and leaves the token good for the others.

Headers

X-Organization-Id
string

The organization the caller is acting on — the org_… code that appears in the panel URL. It identifies; the membership JOIN is what authorizes, so a forged code reads nothing: the answer is not_a_member (403), which does not mean the session is over. Absent, the session's default organization answers, or — if that membership was revoked while the session was open — any other one the caller still holds.

Query Parameters

environment
enum<string>
default:live

Which environment to act in. A view parameter, valid only on the staff surface — a machine credential never chooses its environment, it is resolved from the key.

Available options:
live,
test

Body

application/json
name
string
required

Unique per environment. The delivery log records a send by campaign name.

Maximum string length: 200
trigger_kind
enum<string>
required
Available options:
one_shot,
event,
segment_entered,
date_offset
segment_id
string<uuid>
required

The audience, always. Must belong to the same environment.

steps
object[]
required

The sequence, in order. Replaced as a set on every write.

Required array length: 1 - 10 elements
event_type
string

Required on event, refused on the others. One of the published event types — see the Webhooks tag's catalogue.

date_attribute
enum<string>

Required on date_offset. Every one of them is in the past, which is why the offset may not be negative.

Available options:
created_at,
first_seen_at,
identified_at,
email_verified_at,
last_seen_at
date_offset_days
integer

Required on date_offset.

Required range: 0 <= x <= 365
frequency_cap_days
integer
default:30

How long this campaign waits before it may reach the same person again. 0 is no cap of its own; the 24-hour cooldown across all campaigns still applies, and the two are different promises.

Required range: 0 <= x <= 365

Response

The campaign, as a draft.

campaign
object

An audience, a trigger, a sequence and a cap. Per environment, like everything on the customer plane.