Simulate a journeyMenu

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

idstringrequired

The journey's id.

uuid

Header parameters

Kirora-Workspacestringoptional

Partner 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

contactIdstringrequired

The contact to simulate.

uuid

eventPropertiesmap<string, any>optional

Properties 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).
contactIdstringrequired

uuid

entryobjectrequired

Whether the contact would enter the journey now.

2 child attributes
eligiblebooleanrequired

Whether the contact would enter now.

reasonstring | nullrequired

Why not; null when eligible. waiting_to_reenter: their last entry is within waitAfterEntry; loop_capped: they hit the hourly re-entry cap; missing_reentry_property: the event lacks the property a once_per_value journey 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[]required

The steps the contact would pass through, in order.

6 child attributes
stepIdstringrequired

The step.

pattern ^[a-z0-9][a-z0-9_-]{0,63}$

typestringrequired

The step type.

one of wait, wait_until, digest, send, branch, filter, split, random_split, action

outcomestringrequired

What the step would do: a send step would_send, would_skip, unreachable (takes its fallback) or failed (a plan limit refuses it and it has onFailureStep); a wait would_wait, a wait-until would_wait_for_event; an action would_act; a branch, filter or split matched, not_matched or otherwise; a random split random_path or holdout; and would_exit where 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_exit

reasonstringoptional

Why a send step would not send: the send guard's error code, or PLAN_LIMIT_REACHED with planLimit saying which.

planLimitstringoptional

With reason PLAN_LIMIT_REACHED: marketing_contacts when the workspace's marketing contacts are past the plan's limit and its tolerance (stops every channel), emails when the email allowance is used up.

one of marketing_contacts, emails

issuesJourneyActivationIssue[]optional

With reason DRAFT_INCOMPLETE: what the step still needs, as activation would list it.

4 child attributes
fieldstringrequired

Where to fix it, as a path into the journey (steps.2.content.from, trigger.segmentId, exitConditions.0), or postalAddress for the workspace setting.

codestringrequired

The error activateJourney answers with for it: DRAFT_INCOMPLETE for a missing or broken part, or the send check's own code (SENDING_DOMAIN_UNVERIFIED, SENDING_DOMAIN_DMARC_MISSING, POSTAL_ADDRESS_MISSING and 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_CLOSED

messagestringrequired

What is wrong, in words a person can act on.

stepIdstringoptional

The step a steps.N path 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}$