Journeys
Create a journey
POST/v1/journeys
Requires an API key with the journeys:write scope. About keys and scopes
Creates a multi-step automation in a draft state. A draft saves unfinished: it needs a name and a trigger, but may have no steps yet and send steps without their content; what is given is checked. A journey does not run until it is activated, which needs it whole (409 DRAFT_INCOMPLETE lists each missing field in details.issues); edit it with PATCH /v1/journeys/{id}.
Request body
namestringrequired1–255 characters
triggerEventstringoptionalThe event that starts a run. Required unless
dateTriggeris set.1–128 characters
dateTriggerobject | nulloptionalStarts runs from a date on the contact instead of an event.
5 child attributes
fieldstringrequiredThe contact date field the journey runs from.
recurrencestringrequiredonceruns on the date a single time;annualrepeats every year.one of
once,annualoffsetDaysintegeroptionalDays from the date to start: negative before it, positive after. Defaults to 0.
min -365 · max 365 · default
0timestringrequiredTime of day to start, as
HH:MMin the contact's timezone, else the workspace's.leapDaystringoptionalFor an annual 29 February date in a common year: run on 28 Feb, on 1 Mar, or skip.
one of
feb28,mar1,skip· default"feb28"
entryConditionsobjectoptionalProperty values the trigger event must carry to start a run; all must match exactly.
default
{}reentryobjectoptionalWhether a contact may enter again. Defaults to once.
default
{"mode":"once"}One of 2 shapes
- Once
1 child attribute
mode"once"required
- Repeatable
2 child attributes
mode"repeatable"requiredcooldownDaysintegeroptionalDays after a run starts before the same contact may enter again.
min 0 · max 3650 · default
0
exitConditionsobject[]optionalEvents that end a contact's run early.
at most 10 items · default
[]3 child attributes
type"event"requiredeventNamestringrequiredThe event that ends a contact's run when they do it.
1–128 characters
propertiesobjectoptionalProperty values the event must carry to count; all must match exactly.
default
{}
stepsobject[]requiredThe steps, in order. Empty while a draft; going live needs a first step.
at most 50 items
One of 9 shapes
- Wait step
4 child attributes
type"wait"requireddurationSecondsintegerrequiredHow long to wait, in seconds; at most 365 days.
min 1 · max 31536000
windowobjectoptionalHours the wait may end in, in the contact's local time.
3 child attributes
startHourintegerrequiredHour of day (0-23) the window opens, inclusive.
min 0 · max 23
endHourintegerrequiredHour of day (1-24) the window closes; it must be after
startHour.min 1 · max 24
daysinteger[]optionalDays of the week the window is open, 0 = Sunday to 6 = Saturday; every day when left out.
at least 1 item · at most 7 items
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
- Wait-until step
6 child attributes
type"wait_until"requiredeventNamestringrequiredThe event to wait for.
1–128 characters
whereobject[]optionalConditions on the event's properties; all must hold.
at least 1 item · at most 5 items
3 child attributes
propertystringrequiredThe event property key.
1–64 characters
operatorstringrequiredone of
equals,notEquals,gt,gte,lt,ltevaluestring | number | booleanrequired
timeoutSecondsintegerrequiredHow long to wait for the event, in seconds: 60 to 90 days.
min 60 · max 7776000
onMatchStepintegerrequiredIndex of the step to take when the event happens.
min 0 · max 9007199254740991
onTimeoutStepinteger | nullrequiredIndex of the step to take on timeout;
nullends the journey.min 0 · max 9007199254740991
- Digest step
3 child attributes
type"digest"requiredwindowSecondsintegerrequiredHow long to gather events, in seconds: 60 to 7 days.
min 60 · max 604800
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
- Email send step
7 child attributes
idstringoptionalAssigned by the server; send it back unchanged so a message keeps its identity when steps move.
uuid
type"send"requiredchannel"email"requiredcontentobjectrequiredThe email. Any part may be missing on a draft; going live needs subject, sender and design.
5 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
templateSnapshotTemplateSnapshotInputoptional4 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
themeEmailThemeInputrequiredTheme values this email overrides.
plainTextOverridestring | nulloptionalPlain text sent instead of the version generated from the blocks.
up to 100000 characters
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
onUnreachableStepintegeroptionalIndex of the step to go to when the contact cannot receive this channel; unset skips the send.
min 0 · max 9007199254740991
topicIdstringoptionalSends only to contacts the topic reaches; unset sends to everyone with consent.
uuid
- Push send step
7 child attributes
idstringoptionalAssigned by the server; send it back unchanged so a message keeps its identity when steps move.
uuid
type"send"requiredchannel"push"requiredcontentobjectrequiredThe notification. Any part may be missing on a draft.
2 child attributes
pushProjectIdstringoptionalThe push app to send through.
uuid
pushobjectoptionalThe notification content.
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
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.
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
onUnreachableStepintegeroptionalIndex of the step to go to when the contact cannot receive this channel; unset skips the send.
min 0 · max 9007199254740991
topicIdstringoptionalSends only to contacts the topic reaches; unset sends to everyone with consent.
uuid
- Branch step
4 child attributes
type"branch"requiredconditionobjectrequiredEvent property values to compare with the trigger event; all must match exactly.
onMatchStepintegerrequiredIndex of the step to take when the condition matches.
min 0 · max 9007199254740991
onNoMatchStepintegerrequiredIndex of the step to take when it does not.
min 0 · max 9007199254740991
- Filter step
5 child attributes
type"filter"requiredmodestringrequiredoncechecks the rules here only;continuousre-checks them before every later step.one of
once,continuousrulesobjectrequiredThe contact must match these rules.
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
onMatchStepintegerrequiredIndex of the step to take when the contact matches.
min 0 · max 9007199254740991
onNoMatchStepinteger | nulloptionalIndex of the step to take when they do not;
nullends the journey.min 0 · max 9007199254740991
- Split step
3 child attributes
type"split"requiredpathsobject[]requiredPaths checked in order; the first whose rules match is taken.
at least 1 item · at most 5 items
2 child attributes
rulesobjectrequiredThe contact takes this path when they match.
One of 2 shapes
- Match all
- Match any
nextStepintegerrequiredIndex of the step this path leads to.
min 0 · max 9007199254740991
otherwiseStepinteger | nullrequiredIndex of the step to take when no path matches;
nullends the journey.min 0 · max 9007199254740991
- Action step
3 child attributes
type"action"requiredactionobjectrequiredWhat this step does to the contact.
One of 5 shapes
- Set attribute
3 child attributes
kind"set_attribute"requiredkeystringrequiredThe contact attribute's key.
valuestring | number | boolean | nullrequiredThe value to set;
nullclears it.
- Add to or remove from list attribute
3 child attributes
kindstringrequiredone of
add_to_attribute,remove_from_attributekeystringrequiredThe contact attribute's key.
valuestring | number | booleanrequiredThe one item to add to, or remove from, the list; other items are kept.
- Add to group
2 child attributes
kind"add_to_group"requiredgroupIdstringrequiredThe group to add the contact to.
uuid
- Remove from group
2 child attributes
kind"remove_from_group"requiredgroupIdstringrequiredThe group to remove the contact from.
uuid
- Send webhook
3 child attributes
kind"webhook"requiredwebhookIdstringrequiredThe webhook endpoint to notify.
uuid
dataobjectoptionalExtra data sent in the
journey.actionpayload.default
{}
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
messageLimitsMessageLimitUseInputoptionalFor the whole journey: a person over a limit skips that send and moves on.
2 child attributes
applybooleanrequiredretryHoursintegeroptionalmin 0 · max 48
utmobject | nulloptionalLink tags for the journey's email, as on campaigns; unset follows the workspace.
6 child attributes
enabledbooleanrequiredsourcestringoptional1–100 characters
mediumstringoptional1–100 characters
campaignstringoptional1–100 characters
contentstringoptional1–100 characters
termstringoptional1–100 characters
maxEntriesinteger | nulloptionalThe most runs the journey starts over its life;
nullor unset has no cap.min > 0 · max 100000000
Returns
Returns 201 Created with a Journey in data. Otherwise returns an error; Errors lists every code and which to retry.
idstringrequireduuid
namestringrequiredtriggerEventstringrequiredThe event that starts a run.
dateTriggerobject | nullrequiredThe contact date that starts runs, for a date journey; otherwise
null.5 child attributes
fieldstringrequiredThe contact date field the journey runs from.
recurrencestringrequiredonceruns on the date a single time;annualrepeats every year.one of
once,annualoffsetDaysintegerrequiredDays from the date to start: negative before it, positive after. Defaults to 0.
min -365 · max 365 · default
0timestringrequiredTime of day to start, as
HH:MMin the contact's timezone, else the workspace's.leapDaystringrequiredFor an annual 29 February date in a common year: run on 28 Feb, on 1 Mar, or skip.
one of
feb28,mar1,skip· default"feb28"
entryConditionsobjectrequiredProperty values the trigger event must carry to start a run.
reentryobjectrequiredWhether a contact may enter again.
One of 2 shapes
- Once
1 child attribute
mode"once"required
- Repeatable
2 child attributes
mode"repeatable"requiredcooldownDaysintegerrequiredDays after a run starts before the same contact may enter again.
min 0 · max 3650 · default
0
exitConditionsobject[]requiredEvents that end a contact's run early.
3 child attributes
type"event"requiredeventNamestringrequiredThe event that ends a contact's run when they do it.
1–128 characters
propertiesobjectrequiredProperty values the event must carry to count; all must match exactly.
default
{}
stepsobject[]requiredThe steps, in order.
One of 9 shapes
- Wait step
4 child attributes
type"wait"requireddurationSecondsintegerrequiredHow long to wait, in seconds; at most 365 days.
min 1 · max 31536000
windowobjectoptionalHours the wait may end in, in the contact's local time.
3 child attributes
startHourintegerrequiredHour of day (0-23) the window opens, inclusive.
min 0 · max 23
endHourintegerrequiredHour of day (1-24) the window closes; it must be after
startHour.min 1 · max 24
daysinteger[]optionalDays of the week the window is open, 0 = Sunday to 6 = Saturday; every day when left out.
at least 1 item · at most 7 items
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
- Wait-until step
6 child attributes
type"wait_until"requiredeventNamestringrequiredThe event to wait for.
1–128 characters
whereobject[]optionalConditions on the event's properties; all must hold.
at least 1 item · at most 5 items
3 child attributes
propertystringrequiredThe event property key.
1–64 characters
operatorstringrequiredone of
equals,notEquals,gt,gte,lt,ltevaluestring | number | booleanrequired
timeoutSecondsintegerrequiredHow long to wait for the event, in seconds: 60 to 90 days.
min 60 · max 7776000
onMatchStepintegerrequiredIndex of the step to take when the event happens.
min 0 · max 9007199254740991
onTimeoutStepinteger | nullrequiredIndex of the step to take on timeout;
nullends the journey.min 0 · max 9007199254740991
- Digest step
3 child attributes
type"digest"requiredwindowSecondsintegerrequiredHow long to gather events, in seconds: 60 to 7 days.
min 60 · max 604800
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
- Email send step
7 child attributes
idstringoptionalAssigned by the server; send it back unchanged so a message keeps its identity when steps move.
uuid
type"send"requiredchannel"email"requiredcontentobjectrequiredThe email, as saved.
7 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
htmlstringoptionalThe HTML body. Rendered from the design when one is set.
1–512000 characters
textstringoptionalThe plain-text alternative.
1–512000 characters
fromstringoptionalThe sender address, on a verified sending domain.
1–320 characters
replyTostringoptionalWhere replies go.
email
templateSnapshotTemplateSnapshotoptional4 child attributes
schemaVersionintegerrequiredThe block format version; use the current one, 1.
min > 0 · max 1000
blocksEmailBlock[]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
themeEmailThemerequiredTheme values this email overrides.
plainTextOverridestring | nulloptionalPlain text sent instead of the version generated from the blocks.
up to 100000 characters
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
onUnreachableStepintegeroptionalIndex of the step to go to when the contact cannot receive this channel; unset skips the send.
min 0 · max 9007199254740991
topicIdstringoptionalSends only to contacts the topic reaches; unset sends to everyone with consent.
uuid
- Push send step
7 child attributes
idstringoptionalAssigned by the server; send it back unchanged so a message keeps its identity when steps move.
uuid
type"send"requiredchannel"push"requiredcontentobjectrequiredThe notification. Any part may be missing on a draft.
2 child attributes
pushProjectIdstringoptionalThe push app to send through.
uuid
pushobjectoptionalThe notification content.
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
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.
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
onUnreachableStepintegeroptionalIndex of the step to go to when the contact cannot receive this channel; unset skips the send.
min 0 · max 9007199254740991
topicIdstringoptionalSends only to contacts the topic reaches; unset sends to everyone with consent.
uuid
- Branch step
4 child attributes
type"branch"requiredconditionobjectrequiredEvent property values to compare with the trigger event; all must match exactly.
onMatchStepintegerrequiredIndex of the step to take when the condition matches.
min 0 · max 9007199254740991
onNoMatchStepintegerrequiredIndex of the step to take when it does not.
min 0 · max 9007199254740991
- Filter step
5 child attributes
type"filter"requiredmodestringrequiredoncechecks the rules here only;continuousre-checks them before every later step.one of
once,continuousrulesobjectrequiredThe contact must match these rules.
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
onMatchStepintegerrequiredIndex of the step to take when the contact matches.
min 0 · max 9007199254740991
onNoMatchStepinteger | nullrequiredIndex of the step to take when they do not;
nullends the journey.min 0 · max 9007199254740991
- Split step
3 child attributes
type"split"requiredpathsobject[]requiredPaths checked in order; the first whose rules match is taken.
at least 1 item · at most 5 items
2 child attributes
rulesobjectrequiredThe contact takes this path when they match.
One of 2 shapes
- Match all
- Match any
nextStepintegerrequiredIndex of the step this path leads to.
min 0 · max 9007199254740991
otherwiseStepinteger | nullrequiredIndex of the step to take when no path matches;
nullends the journey.min 0 · max 9007199254740991
- Action step
3 child attributes
type"action"requiredactionobjectrequiredWhat this step does to the contact.
One of 5 shapes
- Set attribute
3 child attributes
kind"set_attribute"requiredkeystringrequiredThe contact attribute's key.
valuestring | number | boolean | nullrequiredThe value to set;
nullclears it.
- Add to or remove from list attribute
3 child attributes
kindstringrequiredone of
add_to_attribute,remove_from_attributekeystringrequiredThe contact attribute's key.
valuestring | number | booleanrequiredThe one item to add to, or remove from, the list; other items are kept.
- Add to group
2 child attributes
kind"add_to_group"requiredgroupIdstringrequiredThe group to add the contact to.
uuid
- Remove from group
2 child attributes
kind"remove_from_group"requiredgroupIdstringrequiredThe group to remove the contact from.
uuid
- Send webhook
3 child attributes
kind"webhook"requiredwebhookIdstringrequiredThe webhook endpoint to notify.
uuid
dataobjectrequiredExtra data sent in the
journey.actionpayload.default
{}
nextStepinteger | nulloptionalIndex in
stepsof the step to run next. It must come after this step;nullor omitted ends the journey here.min 0 · max 9007199254740991
messageLimitsMessageLimitUserequired2 child attributes
applybooleanrequiredretryHoursintegeroptionalmin 0 · max 48
utmobject | nullrequiredLink tags for the journey's email;
nullfollows the workspace.6 child attributes
enabledbooleanrequiredsourcestringoptional1–100 characters
mediumstringoptional1–100 characters
campaignstringoptional1–100 characters
contentstringoptional1–100 characters
termstringoptional1–100 characters
maxEntriesinteger | nullrequiredThe most runs the journey starts over its life;
nullhas no cap.min > 0 · max 9007199254740991
enrolledCountintegerrequiredRuns ever started.
min 0 · max 9007199254740991
statusstringrequiredended: nobody enters and runs in progress were exited; it cannot restart.one of
draft,active,paused,endedrevisionintegerrequiredRaised by every edit. Send it back as
expectedRevisionon the update so a change made since you read it is refused instead of overwritten.min > 0 · max 2147483647
createdAtstringrequireddate-time
updatedAtstringrequireddate-time