Simulate a delivery event on a sandbox message

POST/api/v1/sandbox/messages/{id}/events
Requires anorganization API keywith the scopesandbox:write

Records an open, click, bounce, soft bounce (deferred) or complaint on a caught message and fires your sandbox webhooks for it, as email.opened, email.clicked, email.bounced, email.deferred or delivery.complaint with environment: "sandbox". Use it to exercise your webhook handler without a real recipient. recipient defaults to the first envelope recipient and must be one of them; url is the link reported on a click. Nothing reaches your suppression list or live events.

Parameters

NameInTypeDescription
idrequiredpathstringThe id identifier.

Request body

  • eventstringrequiredopened | clicked | bounced | deferred | complained
  • recipientstring

    One of the message's envelope recipients.

  • urlstring

    For `clicked`: the link that was clicked.

Request

POST/api/v1/sandbox/messages/{id}/events
curl -X POST 'https://app.mailyte.com/api/v1/sandbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/events' \
  -H 'Authorization: Bearer mk_live_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "event": "clicked",
    "url": "https://app.example.com/confirm/abc123"
  }'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Success.

  • dataobject
    • event_typestring

      e.g. `email.accepted`, `email.delivered`, `email.bounced`.

    • recipientstring
    • detailobject
    • created_atstring

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.