---
title: "Simulate a webhook event (test sink for CI)"
method: POST
path: "/emails/test"
tags: ["Emails"]
---

# Simulate a webhook event (test sink for CI)

`POST /emails/test`

## Request

- Base URL: `https://api.supersendtx.com`
- URL: `https://api.supersendtx.com/emails/test`
- Auth: HTTP bearer

Builds the payload for an outbound email event and, by default, delivers it to your
webhook endpoints. `email.received` is inbound-only and cannot be simulated here.

## Request body

- object
  - `event` 'email.sent' | 'email.delivered' | 'email.delivery_delayed' | 'email.bounced' | 'email.complained' | 'email.opened' | 'email.clicked' | 'email.failed' | 'email.suppressed' | 'email.scheduled', required: Outbound email events that `POST /emails/test` can simulate. `email.received` is inbound-only, so it is not accepted there.
  - `email_id` string: Optional existing email public id (`msg_…`). Without it, the payload describes a sample email.
  - `webhook_id` string, uuid: Optional webhook endpoint id (the `id` returned by `POST /webhooks`) for a single-endpoint test delivery
  - `sync` boolean: When true, deliver synchronously and return per-endpoint HTTP results (defaults to true when `webhook_id` is set)
  - `deliver` boolean: When true, deliver the payload to your webhook endpoints subscribed to the event (in the background unless `sync` is true)

## Response `200`

Payload built (and optionally delivered)

- object
  - `ok` boolean, required
  - `payload` EmailWebhookEventPayload, required
    - `type` 'email.received' | 'email.sent' | 'email.delivered' | 'email.delivery_delayed' | 'email.bounced' | 'email.complained' | 'email.opened' | 'email.clicked' | 'email.failed' | 'email.suppressed' | 'email.scheduled', required
    - `created_at` string, date-time, required
    - `data` object, required
      - `email_id` string, required
      - `to` string[], required
      - `from` string, required
      - `subject` string, required
      - `status` string, required
      - `bounce_reason` string, nullable
      - `rcpt_to` string, email
      - `cc` string[]
      - `message_id` string, nullable
      - `in_reply_to` string, nullable
      - `references` string[]
      - `spam_status` string, nullable
      - `attachment_count` integer
      - `attachments` ReceivedEmailAttachmentMeta[]
        - `filename` string, required
        - `content_type` string, required
        - `size` integer, required
        - `content_id` string, nullable
      - `received_at` string, date-time
  - `delivered` boolean, required
  - `deliveries` object[], required
    - `endpoint_id` string, required
    - `url` string, required
    - `success` boolean, required
    - `status` integer
    - `error` string

## Other responses

- `400`: `event` is missing or is not an outbound email event (`email.received` is not accepted)
- `401`: Missing or invalid API key
- `404`: `webhook_id` or `email_id` does not match a webhook endpoint or email on this account

---

[API](https://skmtc.dev/ranla/apis/supersend-tx-api.md) · [All operations](https://skmtc.dev/ranla/apis/supersend-tx-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ranla/apis/supersend-tx-api/revisions/e3e782652f50?raw)
