Skip to main content
POST
Create a campaign

Authorizations

Authorization
string
header
required

An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.

Body

application/json
name
string
required

Unique in the workspace

Required string length: 1 - 255
type
enum<string>
required

email sends an email template; survey sends a survey's email, with the recipient's link to the survey

Available options:
email,
survey
audience_id
string | null

A contact view, from GET /v1/campaigns/audiences

bcc_emails
string[] | null
Maximum array length: 50
Required string length: 3 - 320
Pattern: ^[^@\s,]+@[^@\s,]+$
bcc_roles
RoleRef · object[] | null

An account role, from GET /v1/campaigns/roles: for each recipient, the person in that role on the recipient's account

Maximum array length: 20
cc_emails
string[] | null
Maximum array length: 50
Required string length: 3 - 320
Pattern: ^[^@\s,]+@[^@\s,]+$
cc_roles
RoleRef · object[] | null

An account role, from GET /v1/campaigns/roles: for each recipient, the person in that role on the recipient's account

Maximum array length: 20
creator
string | null

The email of a current member of your workspace, credited as the campaign's creator; left out, a person's own key credits that person, and any other key (an org key, a digital worker, a Statisfy staff grant) is credited as itself

Required string length: 3 - 320
Pattern: ^[^@\s,]+@[^@\s,]+$
description
string | null
Maximum string length: 2000
end_date
string<date-time> | null

When it stops sending

reminder_days
integer | null

Survey campaigns: days before a contact who hasn't answered gets the survey again

Required range: 1 <= x <= 365
send_hour
integer | null

The hour (0-23) sends start each day, in send_timezone. Set both, or neither (any hour)

Required range: 0 <= x <= 23
send_timezone
string | null

An IANA time zone, such as Europe/London

sender_role
RoleRef · object | null

Send from the person in this role on each recipient's account, instead of the template's or survey's sender. A recipient whose account has no one in the role gets the template's or survey's sender

skip_weekends
boolean | null
start_date
string<date-time> | null

When it starts sending

survey_id
string | null

Survey campaigns: the survey, from GET /v1/surveys

template_id
string | null

Email campaigns: a published email template

Response

201 - application/json

Successful Response

audience_id
string | null
required

Who it's sent to: a contact view, from GET /v1/campaigns/audiences

bcc_emails
string[]
required
bcc_roles
Role · object[]
required
cc_emails
string[]
required
cc_roles
Role · object[]
required
created_at
string<date-time>
required
description
string | null
required
end_date
string<date-time> | null
required
id
string
required
name
string
required
reminder_days
integer | null
required

Survey campaigns: days before a contact who hasn't answered gets the survey again

send_hour
integer | null
required

The hour (0-23) sends start each day, in send_timezone. Set both, or neither (any hour)

send_timezone
string | null
required
sender_role
Role · object | null
required

Send from the person in this role on each recipient's account, instead of the template's or survey's sender. A recipient whose account has no one in the role gets the template's or survey's sender

skip_weekends
boolean
required
start_date
string<date-time> | null
required
state
enum<string>
required

draft or published. A published campaign sends each hour, between its start and end dates, to the contacts in its audience it has not reached

Available options:
draft,
published
survey_id
string | null
required

Survey campaigns: the survey, from GET /v1/surveys

template_id
string | null
required

Email campaigns: the email template, from GET /v1/templates

type
enum<string>
required

email sends an email template; survey sends a survey's email, with the recipient's link to the survey

Available options:
email,
survey
updated_at
string<date-time> | null
required