Preview an automation

POST/api/v1/automations/{automation}/dry-run
Requires anorganization API keywith the scopeautomations:write

Walks the current draft for up to three real contacts with the checks made for real and the waits skipped, and — where the start can be counted in advance — how many people would enter today. Sends nothing and writes nothing.

Pass deliver_to_sandbox: true to also put each email those contacts would receive into your Sandbox, built exactly as a real run builds it, so you can open the actual message. Nothing is delivered, no run is recorded and no credits are used; sandbox_messages in the response lists what landed. Refused with 422 when the Sandbox is not available.

Parameters

NameInTypeDescription
automationrequiredpathstringThe automation identifier.

Request body

  • deliver_to_sandboxboolean

    Also submit the sample contacts' emails to your Sandbox.

Request

POST/api/v1/automations/{automation}/dry-run
curl -X POST 'https://app.mailyte.com/api/v1/automations/01JBT8XQ2M9WYC3K4F6R7S8T9V/dry-run' \
  -H 'Authorization: Bearer mk_live_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "deliver_to_sandbox": true
  }'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Success.

  • dataobject
    • triggerobject
    • matching_todayinteger

      Contacts who match the trigger today. Null when the trigger has no audience to count (an event nobody has sent yet).

    • unsubscribedinteger
    • not_mailableinteger

      Unsubscribed, bounced, complained or unconfirmed.

    • would_be_cappedinteger
    • samplesarray<object>
      • contactobject
        • idstring
        • emailstring
        • namestring
      • timelinearray<object>
        • node_idstring
        • typestring
        • summarystring
        • branchstring
    • sandbox_messagesarray<object>

      Present only when the request asked for `deliver_to_sandbox`: one entry per email a sample contact reached, in walk order.

      • contactobject
        • idstring
        • emailstring
        • namestring
      • node_idstring
      • sandbox_message_idstring

        Open it with GET /sandbox/messages/{id}. Null when this email could not be built; see `error`.

      • errorstring

Returned inside the standard envelope.

Errors

StatusWhen
401The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist.
403The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys.
404No such resource in this organization.
422The request was understood but the values were not acceptable.
429Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait.

Every status, with what causes it and what to do, is on the error reference.