Simulate a journey
POST/v1/journeys/{id}/simulate
Requires an API key with the journeys:read scope. About keys and scopes
Works with integration, agent and partner keys.
Reads only: safe to retry. About idempotency
Previews an enrollment without sending. entry says whether the contact would enter now: a date journey needs a valid date in its field; an event journey checks the supplied eventProperties against the trigger's conditions, then re-entry. The path follows branches on eventProperties and filters and splits on the contact as they are now; a wait-until step takes its match path. Each send step is checked against suppression, consent, topics and devices: would_send, unreachable (takes the fallback path), failed (a plan limit refuses it and the step has onFailureStep) or would_skip, with the refusal code in reason (DRAFT_INCOMPLETE for a send step not yet finished: a draft simulates too; PLAN_LIMIT_REACHED with planLimit: emails when the email allowance is used up, marketing_contacts, on any channel, when the workspace's marketing contacts are past the plan's limit and its tolerance). An ended journey returns journey_ended; a draft or paused one is previewed as if live. A date journey enters only when its date is due now in the contact's timezone (date_not_due otherwise), once per occurrence; when due, its branches read the date occurrence instead of eventProperties. maxEntries and the hourly re-entry cap apply as they do live. Message limits, the push allowance and send-time scheduling are not previewed.
Path parameters
idstringrequiredThe journey's id.
uuid
Header parameters
Kirora-WorkspacestringoptionalPartner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.
pattern
^[A-Za-z0-9._:-]{1,128}$
Request body
contactIdstringrequiredThe contact to simulate.
uuid
eventPropertiesmap<string, any>optionalProperties of a trigger event to simulate, checked against the trigger's conditions.
default
{}
Returns
Returns 200 OK with a JourneySimulation in data. It can also return 409 Conflict, 413 Payload Too Large or 415 Unsupported Media Type; see the statuses below. Otherwise returns an error; Errors lists every code and which to retry.
200 OKWhether the contact would enter, and the path it would take.409 ConflictThe request conflicts with current state — a duplicate unique value, or a resource whose status does not allow this operation.413 Payload Too LargeThe body is larger than this operation accepts (PAYLOAD_TOO_LARGE).415 Unsupported Media TypeThe body is not JSON, or not the upload the operation takes (UNSUPPORTED_MEDIA_TYPE).
contactIdstringrequireduuid
entryobjectrequiredWhether the contact would enter the journey now.
2 child attributes
eligiblebooleanrequiredWhether the contact would enter now.
reasonstring | nullrequiredWhy not;
nullwhen eligible.waiting_to_reenter: their last entry is withinwaitAfterEntry;loop_capped: they hit the hourly re-entry cap;missing_reentry_property: the event lacks the property aonce_per_valuejourney keys its runs on;exit_condition_already_met: an exit that counts earlier events (includeEarlierEvents) already happened, such as the invoice being paid.one of
journey_ended,no_date,date_not_due,entry_conditions_not_met,missing_reentry_property,exit_condition_already_met,max_entries_reached,already_enrolled,waiting_to_reenter,loop_capped
pathobject[]requiredThe steps the contact would pass through, in order.
6 child attributes
stepIdstringrequiredThe step.
pattern
^[a-z0-9][a-z0-9_-]{0,63}$typestringrequiredThe step type.
one of
wait,wait_until,digest,send,branch,filter,split,random_split,actionoutcomestringrequiredWhat the step would do: a send step
would_send,would_skip,unreachable(takes its fallback) orfailed(a plan limit refuses it and it hasonFailureStep); a waitwould_wait, a wait-untilwould_wait_for_event; an actionwould_act; a branch, filter or splitmatched,not_matchedorotherwise; a random splitrandom_pathorholdout; andwould_exitwhere a continuous filter no longer matches.one of
would_send,would_skip,unreachable,failed,would_wait,would_wait_for_event,would_act,matched,not_matched,otherwise,random_path,holdout,would_exitreasonstringoptionalWhy a send step would not send: the send guard's error code, or
PLAN_LIMIT_REACHEDwithplanLimitsaying which.planLimitstringoptionalWith
reasonPLAN_LIMIT_REACHED:marketing_contactswhen the workspace's marketing contacts are past the plan's limit and its tolerance (stops every channel),emailswhen the email allowance is used up.one of
marketing_contacts,emailsissuesJourneyActivationIssue[]optionalWith
reasonDRAFT_INCOMPLETE: what the step still needs, as activation would list it.4 child attributes
fieldstringrequiredWhere to fix it, as a path into the journey (
steps.2.content.from,trigger.segmentId,exitConditions.0), orpostalAddressfor the workspace setting.codestringrequiredThe error
activateJourneyanswers with for it:DRAFT_INCOMPLETEfor a missing or broken part, or the send check's own code (SENDING_DOMAIN_UNVERIFIED,SENDING_DOMAIN_DMARC_MISSING,POSTAL_ADDRESS_MISSINGand so on).one of
BAD_REQUEST,ALREADY_EXISTS,CONFLICT,IN_USE,FORBIDDEN,SCOPE_MISSING,AGENT_KEY_REFUSED,INTERNAL_ERROR,NOT_FOUND,METHOD_NOT_ALLOWED,PAYLOAD_TOO_LARGE,UNSUPPORTED_MEDIA_TYPE,RATE_LIMITED,REVISION_CONFLICT,SERVICE_UNAVAILABLE,UNAUTHORIZED,VALIDATION_ERROR,API_KEY_IP_NOT_ALLOWED,INTEGRATION_PAUSED,AGENT_CONFIRMATION_REQUIRED,EMBED_BUILDER_UNAVAILABLE,EMBED_ORIGIN_NOT_ALLOWED,WORKSPACE_SUSPENDED,WORKSPACE_DELETION_PENDING,CONTACT_SEND_IN_PROGRESS,EXPORT_UNAVAILABLE,NOTHING_TO_EXPORT,EVENT_NAME_LIMIT_REACHED,PLAN_LIMIT_REACHED,SENDING_REVIEW_REQUIRED,PLAN_FEATURE_UNAVAILABLE,CAMPAIGN_AUDIENCE_CONFLICT,EMPTY_AUDIENCE,DRAFT_INCOMPLETE,INVALID_SCHEDULE,UNSUPPORTED_CHANNEL,POSTAL_ADDRESS_MISSING,CONSENT_MISSING,SUPPRESSED,TOPIC_UNSUBSCRIBED,SIGNUP_BLOCKED,INVALID_SENDER_ADDRESS,SENDING_DOMAIN_DMARC_MISSING,SENDING_DOMAIN_IDENTITY_CONFLICT,TEST_SEND_OUTCOME_UNKNOWN,TEST_SEND_ROUTE_NOT_READY,TEST_SEND_UNAVAILABLE,SENDING_DOMAIN_UNVERIFIED,IDEMPOTENCY_KEY_REUSED,IDEMPOTENCY_KEY_IN_USE,IDEMPOTENCY_KEY_OUTCOME_UNKNOWN,CONTENT_NOT_RETAINED,RECIPIENT_EMAIL_MISSING,RECIPIENT_EMAIL_UNSUPPORTED,TEMPLATE_NOT_PUBLISHED,TEMPLATE_ENVELOPE_INCOMPLETE,PUSH_APP_NOT_READY,PUSH_DESTINATION_MISSING,FORM_CLOSEDmessagestringrequiredWhat is wrong, in words a person can act on.
stepIdstringoptionalThe step a
steps.Npath names, by id: the path counts steps in saved order, which need not be the order they run in.pattern
^[a-z0-9][a-z0-9_-]{0,63}$