Campaigns
Check who a campaign would reach before saving it
POST/v1/campaigns/eligibility
Requires an API key with the campaigns:read scope. About keys and scopes
Takes the body POST /campaigns takes and answers as GET /campaigns/{id}/eligibility would for that draft, with campaignId: null, so the composer can show the audience while it is edited. Nothing is saved.
Request body
namestringrequired1–255 characters
channelsstring[]optionalThe channels to send on; each needs its own content. Defaults to
email.at least 1 item
groupIdstringoptionalSend to this group. Choose at most one audience.
uuid
segmentIdstringoptionalSend to this segment. Choose at most one audience.
uuid
audienceRulesobjectoptionalSend to contacts matching these rules. Choose at most one audience.
One of 2 shapes
- Match all
1 child attribute
allobject[]requiredEvery rule or nested group must match.
at least 1 item · at most 20 items
- Match any
1 child attribute
anyobject[]requiredAt least one rule or nested group must match.
at least 1 item · at most 20 items
topicIdstring | nulloptionalSend only to contacts the topic reaches. Omit to reach everyone with consent.
uuid
messageLimitsMessageLimitUseInputoptional2 child attributes
applybooleanrequiredretryHoursintegeroptionalmin 0 · max 48
utmobject | nulloptionalUTM parameters added to the links in the email.
6 child attributes
enabledbooleanrequiredsourcestringoptional1–100 characters
mediumstringoptional1–100 characters
campaignstringoptional1–100 characters
contentstringoptional1–100 characters
termstringoptional1–100 characters
contentobjectoptionalThe content for each selected channel. A draft may leave parts out.
default
{}4 child attributes
emailobjectoptionalSubject, preview text and sender. Needed to send once
channelshasemail.4 child attributes
subjectstringoptionalThe subject line. Merge tags are allowed.
1–998 characters
previewTextstringoptionalShown by inboxes after the subject. Merge tags are allowed; keep it near 100 characters.
1–255 characters
fromstringoptionalThe sender address, on a verified sending domain.
1–320 characters
replyTostringoptionalWhere replies go.
email
templateSnapshotTemplateSnapshotInputoptionalThe email design. Needed to send once
channelshasemail.4 child attributes
schemaVersionintegerrequiredThe block format version; use the current one, 1.
min > 0 · max 1000
blocksEmailBlockInput[]requiredAt most 200 blocks across the entire tree and five levels including the root. Footer blocks must remain at root. Known child fields are validated recursively.
at least 1 item · at most 200 items
7 child attributes
idstringrequiredIdentifies the block within the template; unique among its blocks.
1–128 characters
typestringrequiredThe block type:
header,heading,text,image,button,divider,spacer,columns,columns3,imagetext,imagegroup,boxed,quote,list,product,video,social,menu,html,section,footer,repeat,shared. Each type reads its own fields next totype; an unknown type is kept but not validated.1–64 characters
styleEmailBlockStyleInputoptionalVisual overrides for this block, such as colours, font and spacing.
17 child attributes
backgroundColorstringoptionalFill behind the block.
fontFamilystringoptionalA font every client has (Arial, Verdana, Georgia, Tahoma, Times New Roman, Courier New), or a web font, which shows where the client loads it and falls back to a safe font elsewhere.
one of
Arial,Verdana,Georgia,Tahoma,Times New Roman,Courier New,Inter,Roboto,Open Sans,Lato,Montserrat,Poppins,DM Sans,Nunito,Work Sans,Oswald,Playfair Display,Merriweather,Lora,Libre Baskerville,EB GaramondfontSizeintegeroptionalText size in px, 12 to 72.
min 12 · max 72
mobileFontSizeintegeroptionalText size in px on phones (screens up to 620px), 12 to 72.
min 12 · max 72
paddingobjectoptionalSpace inside the block in px, 0 to 100 per side; omitted sides keep their default.
borderWidthintegeroptionalBorder thickness in px; 0 for none.
min 0 · max 10
borderStylestringoptionalBorder line style.
one of
solid,dashed,dottedborderColorstringoptionalBorder colour.
borderRadiusintegeroptionalCorner rounding in px, 0 to 100.
min 0 · max 100
textColorstringoptionalText colour.
linkColorstringoptionalColour of links in the text.
letterSpacingnumberoptionalSpace between letters in px, such as 3 for a spaced-out eyebrow line.
min -2 · max 20
textTransformstringoptionalSet to
uppercaseto capitalise all text.one of
none,uppercaselineHeightnumberoptionalA multiple of the font size.
min 1 · max 3
fontWeightstringoptionalText weight.
one of
regular,boldfontStylestringoptionalText style.
one of
normal,italicinsetbooleanoptionalDraw the background and border as a box within the content width, not across the whole row.
visibleIfobjectoptionalShow the block only to contacts these segment rules match, checked as each message is rendered. Omit to show it to everyone. Not allowed on the footer.
One of 2 shapes
- Match all
- Match any
showOnstringoptionalShow the block only on phones (screens up to 620px) or only on wider screens. Clients that ignore screen size show the desktop version, and so does plain text. Omit to show it everywhere. Not allowed on the footer.
one of
mobile,desktopcolumnsobject[][]optionalNested child block arrays: exactly two for columns, three for columns3. Each child follows this block contract. Omit to retain legacy text columns.
at most 3 items
blocksobject[]optionalA section's child blocks, drawn inside its box; or a repeat block's, written out once per item of its
list, where{{ item.<field> }}reads that item. Repeats do not nest.at most 200 items
themeEmailThemeInputrequiredTheme values this email overrides.
11 child attributes
fontstringoptionalBody font stack, such as
Inter, sans-serif.up to 200 characters
hfontstringoptionalHeading font stack.
up to 200 characters
bgstringoptionalBackground of the email card, as hex.
canvasstringoptionalBackground behind the card, as hex.
textstringoptionalDefault text colour, as hex.
accentstringoptionalBrand colour for buttons and highlights, as hex.
linkstringoptionalLink colour, as hex.
widthstringoptionalWidth of the email card on wide screens.
one of
560px,600px,680pxradiusstringoptionalCorner rounding of the email's card.
one of
0px,6px,12px,16px,24px,999pxbtnRadiusstringoptionalButton corners;
radiusrounds the email's card and, when this is unset, buttons.one of
0px,6px,12px,16px,24px,999pxbtnstringoptionalButton style.
one of
solid,outline
plainTextOverridestring | nulloptionalPlain text sent instead of the version generated from the blocks.
up to 100000 characters
pushProjectIdstringoptionalThe push app to send through. Needed to send once
channelshaspush.uuid
pushobjectoptionalThe notification content. Needed to send once
channelshaspush.13 child attributes
titlestringoptionalThe notification title (up to 100 characters).
1–100 characters
bodystringoptionalThe notification text (up to 500 characters).
1–500 characters
actionUrlstringoptionalThe HTTPS page opened when the notification is tapped.
uri · up to 2048 characters
imageUrlstringoptionalA large picture: web and Android show it; iOS needs the app's service extension.
uri · up to 2048 characters
iconUrlstringoptionalWeb only; iOS and Android show the app's own notification icon.
uri · up to 2048 characters
dataobjectoptionalUp to 10 string key-value pairs passed to the app untouched, for deep links and in-app routing.
buttonsobject[]optionalUp to 2 action buttons.
at least 1 item · at most 2 items
2 child attributes
titlestringrequiredThe button label.
1–30 characters
urlstringrequiredThe HTTPS page the button opens.
uri · up to 2048 characters
collapseKeystringoptionalA newer notification with the same key replaces the older one on the device.
soundstringoptionalThe name of a sound the app ships; the device's default if unset.
1–64 characters
badgeintegeroptionalThe number shown on the iOS app icon.
min 0 · max 99999
ttlSecondsintegeroptionalSeconds a provider keeps trying an offline device (up to 28 days); defaults to 86400 (one day).
min 0 · max 2419200
urgencystringoptionalhighwakes the device now;normallets it wait for a good moment to save battery. Unset, a transactional push ishighand any othernormal.one of
high,normaloverridesobjectoptionalFields that differ on one platform, each replacing the shared one there (a whole
datamap, not merged key by key). On iOS and AndroidactionUrlmay be an app link such asmyapp://orders; the shared one and the web one must be HTTPS.3 child attributes
iosobjectoptionalReplaces shared fields on iOS.
14 child attributes
titlestringoptionalThe notification title (up to 100 characters).
1–100 characters
bodystringoptionalThe notification text (up to 500 characters).
1–500 characters
actionUrlstringoptionalup to 2048 characters
imageUrlstringoptionalA large picture: web and Android show it; iOS needs the app's service extension.
uri · up to 2048 characters
iconUrlstringoptionalWeb only; iOS and Android show the app's own notification icon.
uri · up to 2048 characters
dataobjectoptionalUp to 10 string key-value pairs passed to the app untouched, for deep links and in-app routing.
buttonsobject[]optionalUp to 2 action buttons.
at least 1 item · at most 2 items
collapseKeystringoptionalA newer notification with the same key replaces the older one on the device.
soundstringoptionalThe name of a sound the app ships; the device's default if unset.
1–64 characters
badgeintegeroptionalThe number shown on the iOS app icon.
min 0 · max 99999
ttlSecondsintegeroptionalSeconds a provider keeps trying an offline device (up to 28 days); defaults to 86400 (one day).
min 0 · max 2419200
urgencystringoptionalhighwakes the device now;normallets it wait for a good moment to save battery. Unset, a transactional push ishighand any othernormal.one of
high,normalinterruptionLevelstringoptionalHow iOS presents it:
passivearrives silently,time-sensitivebreaks through Focus and needs the app's Time Sensitive Notifications capability.one of
passive,active,time-sensitivethreadIdstringoptionalNotifications with the same thread are grouped together in Notification Center.
androidobjectoptionalReplaces shared fields on Android.
13 child attributes
titlestringoptionalThe notification title (up to 100 characters).
1–100 characters
bodystringoptionalThe notification text (up to 500 characters).
1–500 characters
actionUrlstringoptionalup to 2048 characters
imageUrlstringoptionalA large picture: web and Android show it; iOS needs the app's service extension.
uri · up to 2048 characters
iconUrlstringoptionalWeb only; iOS and Android show the app's own notification icon.
uri · up to 2048 characters
dataobjectoptionalUp to 10 string key-value pairs passed to the app untouched, for deep links and in-app routing.
buttonsobject[]optionalUp to 2 action buttons.
at least 1 item · at most 2 items
collapseKeystringoptionalA newer notification with the same key replaces the older one on the device.
soundstringoptionalThe name of a sound the app ships; the device's default if unset.
1–64 characters
badgeintegeroptionalThe number shown on the iOS app icon.
min 0 · max 99999
ttlSecondsintegeroptionalSeconds a provider keeps trying an offline device (up to 28 days); defaults to 86400 (one day).
min 0 · max 2419200
urgencystringoptionalhighwakes the device now;normallets it wait for a good moment to save battery. Unset, a transactional push ishighand any othernormal.one of
high,normalchannelIdstringoptionalThe Android notification channel to post in, which the app creates; it sets the sound and importance a person can tune, e.g. one for offers and one for orders.
webobjectoptionalReplaces shared fields on web.
12 child attributes
titlestringoptionalThe notification title (up to 100 characters).
1–100 characters
bodystringoptionalThe notification text (up to 500 characters).
1–500 characters
actionUrlstringoptionalThe HTTPS page opened when the notification is tapped.
uri · up to 2048 characters
imageUrlstringoptionalA large picture: web and Android show it; iOS needs the app's service extension.
uri · up to 2048 characters
iconUrlstringoptionalWeb only; iOS and Android show the app's own notification icon.
uri · up to 2048 characters
dataobjectoptionalUp to 10 string key-value pairs passed to the app untouched, for deep links and in-app routing.
buttonsobject[]optionalUp to 2 action buttons.
at least 1 item · at most 2 items
collapseKeystringoptionalA newer notification with the same key replaces the older one on the device.
soundstringoptionalThe name of a sound the app ships; the device's default if unset.
1–64 characters
badgeintegeroptionalThe number shown on the iOS app icon.
min 0 · max 99999
ttlSecondsintegeroptionalSeconds a provider keeps trying an offline device (up to 28 days); defaults to 86400 (one day).
min 0 · max 2419200
urgencystringoptionalhighwakes the device now;normallets it wait for a good moment to save battery. Unset, a transactional push ishighand any othernormal.one of
high,normal
Returns
Returns 200 OK with a CampaignEligibility in data. Otherwise returns an error; Errors lists every code and which to retry.
campaignIdstring | nullrequirednullwhen checked before saving (POST /campaigns/eligibility).uuid
checkedAtstringrequiredWhen the check ran.
date-time
audienceCountintegerrequiredContacts in the audience, before any channel's exclusions.
min 0 · max 9007199254740991
blockersstring[]requiredBlockers for the campaign as a whole.
issuesobject[]requiredWhat the draft still lacks, exactly as sending would refuse it (
DRAFT_INCOMPLETE).2 child attributes
pathstringrequiredThe field that is incomplete, such as
content.email.messagestringrequiredWhat is missing, in plain words.
channelsobject[]requiredOne entry per selected channel.
One of 2 shapes
- Email channel
6 child attributes
channel"email"requiredeligibleRecipientCountintegerrequiredContacts reachable on this channel after the exclusions.
min 0 · max 9007199254740991
sendableRecipientCountintegerrequiredeligibleRecipientCountwhen nothing blocks the campaign anywhere, else 0.min 0 · max 9007199254740991
blockersstring[]requiredWhat stops the email channel sending.
excludedobjectrequiredContacts left out of the audience, by reason.
4 child attributes
consentMissingintegerrequiredContacts without email consent.
min 0 · max 9007199254740991
topicUnsubscribedintegerrequiredConsented, but the campaign's topic does not reach them.
min 0 · max 9007199254740991
suppressedintegerrequiredContacts whose address is blocked, for example after a bounce.
min 0 · max 9007199254740991
missingEmailintegerrequiredContacts with no email address.
min 0 · max 9007199254740991
senderVerifiedbooleanrequiredWhether the sender domain is verified.
- Push channel
6 child attributes
channel"push"requiredeligibleRecipientCountintegerrequiredContacts reachable on this channel after the exclusions.
min 0 · max 9007199254740991
sendableRecipientCountintegerrequiredeligibleRecipientCountwhen nothing blocks the campaign anywhere, else 0.min 0 · max 9007199254740991
blockersstring[]requiredWhat stops the push channel sending.
excludedobjectrequiredContacts left out of the audience, by reason.
4 child attributes
consentMissingintegerrequiredContacts without push consent.
min 0 · max 9007199254740991
topicUnsubscribedintegerrequiredConsented, but the campaign's topic does not reach them.
min 0 · max 9007199254740991
suppressedintegerrequiredContacts blocked from push.
min 0 · max 9007199254740991
missingInstallationintegerrequiredContacts with no registered device.
min 0 · max 9007199254740991
applicationReadybooleanrequiredWhether the push app is set up to send.