# Send a test event (/docs/api-reference/webhook-endpoints/create-test-webhook-event)

Sends a sample event of a type to the environment's enabled endpoints subscribed to it and its open listeners (`coss listen`), exactly as a real one is sent: same body, signature, retries and log lines. `coss trigger` calls it. Sandbox environments only. The ids in the sample are made up (pass real ones in `data` for a handler that looks them up), and nothing marks the event as a test: your handler takes it like the real thing. When nothing is subscribed, the event goes nowhere and isn't kept.

`POST https://api.coss.com/v1/webhook_events/test`

Authenticate with your API key as a bearer token (`Authorization: Bearer coss_test_…`). Responses are JSON with snake_case fields; errors are `{ error: { type, code, message, param?, issues?, request_id } }` (https://coss.com/docs/api-reference/errors.md).

## Request body

- `type` (string, required, one of "email.sent", "email.delivered", "email.delivery_delayed", "email.bounced", "email.complained", "email.failed", "email.suppressed", "email.scheduled", "email.canceled", "email.opened", "email.clicked", "email.rescheduled", "email.unsubscribed", "email.received", "domain.dmarc_report_received", "account.reputation_warning", "account.reputation_recovered", "account.suspended", "account.reinstated", "account.marketing_paused", "account.marketing_reinstated", "subaccount.reputation_warning", "subaccount.reputation_recovered", "subaccount.paused", "subaccount.reinstated", "hook_endpoint.disabled", "billing.invoice_finalized", "billing.invoice_paid", "billing.invoice_payment_failed", "billing.invoice_voided", "billing.plan_changed", "billing.usage_threshold_reached", "billing.hold_placed", "billing.hold_lifted", "billing.credit_granted", "billing.budget_threshold_reached", "billing.budget_hold_placed", "billing.budget_hold_lifted", "risk.assessment.review", "risk.assessment.reviewed", "contact.created", "contact.updated", "contact.deleted", "contact.unsubscribed", "contact.confirmed", "broadcast.sending", "broadcast.sent", "broadcast.paused", "broadcast.canceled", "broadcast.failed", "inbox.message.received", "sms.scheduled", "sms.sent", "sms.delivered", "sms.undelivered", "sms.failed", "sms.suppressed", "sms.canceled", "sms.received", "sms.opted_out", "sms.opted_in", "sign_request.sent", "sign_request.viewed", "sign_request.signer_signed", "sign_request.declined", "sign_request.completed", "sign_request.canceled", "sign_request.expired", "verification.approved", "verification.failed", "verification.blocked", "form.submission.received", "form.submission.flagged", "scheduling.booking.created", "scheduling.booking.pending_approval", "scheduling.booking.confirmed", "scheduling.booking.rescheduled", "scheduling.booking.cancelled", "scheduling.booking.declined", "scheduling.booking.no_show", "scheduling.booking.external_conflict", "scheduling.booking.calendar_write_failed", "scheduling.booking.location_ready", "scheduling.booking.reassigned", "scheduling.booking.started", "scheduling.booking.ended", "scheduling.booking.reminder", "scheduling.calendar.connected", "scheduling.calendar.needs_reauth", "scheduling.calendar.disconnected", "scheduling.calendar_delegation.failing", "scheduling.calendar_delegation.restored", "scheduling.out_of_office.created", "scheduling.out_of_office.updated", "scheduling.out_of_office.deleted", "scheduling.out_of_office.started", "scheduling.out_of_office.ended", "scheduling.reassignment.completed", "scheduling.oauth_app.failing", "scheduling.oauth_app.restored"): The event type. `domain.*`, `account.*`, `subaccount.*` and `billing.*` events only reach live environments, so they can't be tested in a sandbox one.
- `data` (map of any): Fields merged over the sample's `data` (objects field by field, anything else replaced), in the latest API version's shape: e.g. a real `email_id`, or the `recipient` your handler looks for. Unknown fields are refused.

## Example request

TypeScript (the `coss` package):

```ts
import { Coss } from "coss";

const coss = new Coss({
  apiKey: process.env.COSS_API_KEY,
  baseUrl: "https://api.coss.com",
});

const { data, error } = await coss.webhookEvents.test({
  type: "email.bounced",
  data: {
    recipient: "ada@example.com",
  },
});
```

HTTP:

```sh
curl -X POST "https://api.coss.com/v1/webhook_events/test" \
  -H "Authorization: Bearer $COSS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "email.bounced",
  "data": {
    "recipient": "ada@example.com"
  }
}'
```

Python:

```python
from coss import Coss

client = Coss()  # api_key= or COSS_API_KEY

client.webhook_events.test(
    type="email.bounced",
    data={
        "recipient": "ada@example.com"
    },
)
```

Go:

```go
import (
	"context"

	coss "github.com/cosscom/coss-go"
	cossclient "github.com/cosscom/coss-go/client"
)

client := cossclient.NewClient() // option.WithAPIKey(…) or COSS_API_KEY

request := &coss.CreateTestWebhookEventRequest{
    Type: coss.CreateTestWebhookEventRequestTypeEmailBounced,
    Data: map[string]any{
        "recipient": "ada@example.com",
    },
}
client.WebhookEvents.Test(
    context.TODO(),
    request,
)
```

Ruby:

```ruby
require "coss"

client = Coss::Client.new # api_key: or COSS_API_KEY

client.webhook_events.test(
  type: "email.bounced",
  data: {
    recipient: "ada@example.com"
  }
)
```

PHP:

```php
<?php

use Coss\Coss;
use Coss\WebhookEvents\Requests\CreateTestWebhookEventRequest;
use Coss\WebhookEvents\Types\CreateTestWebhookEventRequestType;

$client = new Coss(); // apiKey: or COSS_API_KEY

$client->webhookEvents->test(
    new CreateTestWebhookEventRequest([
        'type' => CreateTestWebhookEventRequestType::EmailBounced->value,
        'data' => [
            'recipient' => "ada@example.com",
        ],
    ]),
);
```

Java:

```java
import com.coss.Coss;
import com.coss.resources.webhookevents.requests.CreateTestWebhookEventRequest;
import com.coss.resources.webhookevents.types.CreateTestWebhookEventRequestType;
import java.util.HashMap;

Coss client = Coss.builder().build(); // .apiKey(…) or COSS_API_KEY

client.webhookEvents().test(
    CreateTestWebhookEventRequest
        .builder()
        .type(CreateTestWebhookEventRequestType.EMAIL_BOUNCED)
        .data(
            new HashMap<String, Object>() {{
                put("recipient", "ada@example.com");
            }}
        )
        .build()
);
```

.NET:

```csharp
using Coss;

var client = new CossClient(); // apiKey: or COSS_API_KEY

await client.WebhookEvents.TestAsync(
    new CreateTestWebhookEventRequest
    {
        Type = CreateTestWebhookEventRequestType.EmailBounced,
        Data = new Dictionary<string, object?>() { { "recipient", "ada@example.com" } },
    }
);
```

## Response 200

The event that was sent, and to how many receivers.

- `object` ("webhook_test_event", required)
- `event` (object, required): The event, as an endpoint on the request's API version receives it. Its `webhook-id` header is `event.id`.
  - One of (1):
    - `id` (string, required): The event id: the same as `EmailEvent.id`, and the `webhook-id` header.
    - `object` ("event", required)
    - `type` ("email.sent" | "email.delivered" | "email.delivery_delayed" | "email.bounced" | "email.complained" | "email.failed" | "email.suppressed" | "email.scheduled" | "email.canceled" | "email.opened" | "email.clicked" | "email.rescheduled" | "email.unsubscribed", required)
    - `api_version` (string, required): The API version (`Coss-Version`) this event is rendered in: the receiving endpoint's `api_version`.
    - `created_at` (string, required, date-time)
    - `data` (object, required)
      - `bounce` (object)
        - `type` ("permanent" | "transient" | "undetermined", required): `permanent`, `transient` or `undetermined`.
        - `sub_type` (string, required): The provider's finer classification of the bounce.
        - `diagnostic_code` (string | null, required): What the receiving server answered. `null`: not reported.
      - `complaint` (object)
        - `feedback_type` (string | null, required): The kind of complaint the mailbox provider reported. `null`: not reported.
        - `sub_type` (string | null, required): The provider's finer classification. `null`: not reported.
      - `delay` (object)
        - `type` (string, required): The provider's reason for the delay.
        - `expires_at` (string | null, required, date-time): When the provider stops trying. `null`: not reported.
        - `diagnostic_code` (string | null, required): What the receiving server answered. `null`: not reported.
      - `delivery` (object)
        - `smtp_response` (string | null, required): What the receiving server answered. `null`: not reported.
      - `failure` (object)
        - `code` (string, required): Machine-readable reason.
        - `message` (string, required): Human-readable explanation.
      - `suppression` (object): Only for `email.suppressed`: the entry that matched the recipient.
        - `id` (string, required): The suppression's id.
        - `scope` (string, required): What it covers: every email, every marketing email, or one category.
        - `reason` ("bounce" | "complaint" | "manual" | "import" | "unsubscribe", required): `bounce`: added after a permanent bounce. `complaint`: added after a spam complaint. `manual`: added one by one through the API or dashboard. `import`: added by a bulk import. `unsubscribe`: added by the recipient's one-click unsubscribe, scoped to the email's category.
      - `unsubscribe` (object): Only for `email.suppressed` without `suppression`: the recipient is a contact who unsubscribed (from marketing, or from the email's topic, `topic`).
        - `contact_id` (string | null, required): The contact who unsubscribed. `null`: none.
        - `topic` (string | null, required): The topic they left. `null`: marketing altogether.
      - `open` (object): Only for `email.opened`.
        - `user_agent` (string | null, required): The client's `User-Agent`. `null`: not sent.
      - `click` (object): Only for `email.clicked`.
        - `url` (string, required): The original link that was clicked.
        - `link_position` (integer, required): Index of the link among the email's tracked links.
        - `user_agent` (string | null, required): The client's `User-Agent`. `null`: not sent.
      - `reschedule` (object): Only for `email.rescheduled`.
        - `scheduled_at` (string, required, date-time): The new time.
        - `previous_scheduled_at` (string, required, date-time): The time it replaced.
      - `email_id` (string, required)
      - `from` (string, required)
      - `to` (string[], required)
      - `subject` (string, required)
      - `tags` (object[], required)
        - `name` (string, required)
        - `value` (string, required)
      - `category` (string | null, required)
      - `sandbox` (boolean, required)
      - `recipient` (string | null, required)
      - `occurred_at` (string, required, date-time)
      - `subaccount_id` (string): Only for an email sent for a sub-account: its id.
      - `traceparent` (string): Only for an email sent with a W3C `traceparent` header: that trace context (normalized to version `00`), also sent as this request's `traceparent` header, so handling the event joins the sender's trace.
  - One of (2):
    - `id` (string, required): The event id, and the `webhook-id` header.
    - `object` ("event", required)
    - `type` ("email.received", required)
    - `api_version` (string, required): The API version (`Coss-Version`) this event is rendered in: the receiving endpoint's `api_version`.
    - `created_at` (string, required, date-time)
    - `data` (object, required)
      - `received_email_id` (string, required)
      - `from` (string | null, required)
      - `to` (string[], required)
      - `recipients` (string[], required)
      - `subject` (string | null, required)
      - `message_id` (string | null, required)
      - `attachment_count` (integer, required)
      - `size` (integer, required)
      - `spam` (boolean, required)
      - `verdicts` (object, required): What the receiving server concluded: `pass`, `fail`, `gray` (could not decide) or `processing_failed`; `null` when the check did not run.
        - `spam` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The spam verdict.
        - `virus` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The virus verdict.
        - `spf` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The SPF verdict.
        - `dkim` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The DKIM verdict.
        - `dmarc` ("pass" | "fail" | "gray" | "processing_failed" | null, required): The DMARC verdict.
        - `dmarc_policy` (string | null, required): The sender domain's DMARC policy (`none`, `quarantine` or `reject`) when DMARC failed.
      - `sandbox` (boolean, required)
      - `received_at` (string, required, date-time)
  - One of (3):
    - `id` (string, required): The event id, also sent as the `webhook-id` header.
    - `object` ("event", required)
    - `type` ("hook_endpoint.disabled", required)
    - `api_version` (string, required): The API version (`Coss-Version`) this event is rendered in: the receiving endpoint's `api_version`.
    - `created_at` (string, required, date-time)
    - `data` (object, required)
      - `application_id` (string, required)
      - `application_uid` (string | null, required)
      - `endpoint_id` (string, required)
      - `url` (string, required)
      - `failing_since` (string, required, date-time)
      - `occurred_at` (string, required, date-time)
  - One of (4):
    - `id` (string, required): The event id, also sent as the `webhook-id` header.
    - `object` ("event", required)
    - `type` ("risk.assessment.review" | "risk.assessment.reviewed", required): What happened to the assessment.
    - `api_version` (string, required): The API version (`Coss-Version`) this event is rendered in: the receiving endpoint's `api_version`.
    - `created_at` (string, required, date-time)
    - `data` (object, required): The assessment, without its signals.
      - `assessment_id` (string, required): The assessment's id.
      - `event` ("signup" | "login" | "message" | "checkout" | "custom", required): What is being assessed. `custom` events are named by `event_name`; velocity is counted per event.
      - `event_name` (string | null, required): Your name for a `custom` event. `null`: none.
      - `decision` ("allow" | "review" | "block", required): `allow`: go ahead. `review`: suspicious; let it through with limits, or hold it for a person. `block`: refuse it.
      - `score` (number, required): 0-1: how risky the signals are together.
      - `reasons` (object[], required): Why, most significant first.
        - `code` (string, required, one of "email.invalid", "email.disposable", "email.undeliverable", "email.role_account", "email.typo", "email.domain_new", "ip.tor", "ip.vpn_network", "ip.hosting_provider", "ip.vpn", "ip.proxy", "ip.relay", "ip.private", "velocity.signups_per_ip_1h", "velocity.signups_per_ip_24h", "velocity.signups_per_subnet_1h", "velocity.signups_per_email_domain_1h", "velocity.signups_per_mailbox_24h", "velocity.signups_per_device_24h", "velocity.checkouts_per_ip_1h", "velocity.checkouts_per_user_1h", "velocity.checkouts_per_card_24h", "velocity.logins_per_ip_1h", "velocity.logins_per_user_1h", "velocity.events_per_ip_1h", "velocity.events_per_user_1h", "duplicate.canonical_mailbox", "duplicate.device", "history.fraud_mailbox", "history.fraud_user", "history.fraud_ip", "history.fraud_subnet", "history.fraud_card", "history.fraud_device", "checkout.card_country_mismatch", "checkout.billing_country_mismatch", "checkout.prepaid_card", "device.automation", "device.invalid", "login.new_country", "login.new_network", "captcha.failed", "captcha.missing", "content.spam", "content.phishing", "content.malware", "content.fraud", "rule.matched", "list.blocked", "list.allowed"): The reason's code, listed under Risk's reasons in the docs.
        - `message` (string, required): What it means, in words. May change.
        - `value` (number): The count behind a `velocity.*` reason, or the score behind a `content.*` one.
        - `threshold` (number): What a `velocity.*` or `content.*` reason fires at.
        - `window` ("1h" | "24h"): `velocity.*`: the window it's counted over.
        - `suggestion` (string): `email.typo`: the likely domain.
        - `provider` (string): `ip.hosting_provider`, `ip.vpn_network`: the network's operator; `ip.vpn`: the VPN service.
        - `previous_user` (string | null): `duplicate.canonical_mailbox`, `duplicate.device`: your id of the user who has the mailbox or device, if known.
        - `previous_assessment` (string): `duplicate.canonical_mailbox`, `duplicate.device`: the assessment that first saw the mailbox or device.
        - `entry` (string): `list.*`: the matching list entry.
        - `rule` (string): `rule.matched`: the rule's id.
        - `name` (string): `rule.matched`: the rule's name.
        - `type` ("email" | "domain" | "ip" | "asn" | "country" | "user"): `list.*`: what matched.
      - `user_id` (string | null, required): Your user id. `null`: none given.
      - `outcome` ("legitimate" | "fraud" | "abuse" | null, required): `risk.assessment.reviewed`: the outcome that resolved the review.
      - `occurred_at` (string, required, date-time): When this happened.
  - One of (5):
    - `id` (string, required): The event id, and the `webhook-id` header.
    - `object` ("event", required)
    - `type` ("contact.created" | "contact.updated" | "contact.deleted" | "contact.unsubscribed" | "contact.confirmed", required): What happened to the contact.
    - `api_version` (string, required): The API version (`Coss-Version`) this event is rendered in: the receiving endpoint's `api_version`.
    - `created_at` (string, required, date-time): When the event was created.
    - `data` (object, required): The contact, without its properties.
      - `contact` (object, required)
        - `id` (string, required): The contact's id.
        - `email` (string, required): The contact's address.
        - `status` ("subscribed" | "unsubscribed" | "pending", required): Its consent after this event.
      - `source` ("api" | "dashboard" | "import" | "preference_center" | "form", required): How the contact was created.
      - `topic` (string | null, required): `contact.unsubscribed` from one topic (its key); `null`: from marketing altogether.
      - `occurred_at` (string, required, date-time): When this happened.
  - One of (6):
    - `id` (string, required)
    - `object` ("event", required)
    - `type` ("broadcast.sending" | "broadcast.sent" | "broadcast.paused" | "broadcast.canceled" | "broadcast.failed", required): What happened to the broadcast.
    - `api_version` (string, required): The API version (`Coss-Version`) this event is rendered in: the receiving endpoint's `api_version`.
    - `created_at` (string, required, date-time): When the event was created.
    - `data` (object, required): The broadcast and how it fared.
      - `broadcast` (object, required)
        - `id` (string, required): The broadcast's id.
        - `name` (string, required): Its name.
        - `status` ("draft" | "scheduled" | "sending" | "paused" | "sent" | "canceled" | "failed", required): Its status after this event.
      - `pause_reason` (string | null, required): Why a paused broadcast waits. `null`: it isn't paused.
      - `error` (object | null, required): Why it failed. `null`: it didn't.
        - `code` (string, required): Machine-readable reason.
        - `message` (string, required): Human-readable explanation.
      - `stats` (object, required): How its emails fared so far.
        - `recipients` (integer, required): Emails made so far (one per reached contact).
        - `sent` (integer, required): Emails accepted by the provider.
        - `delivered` (integer, required): Emails delivered to recipients' servers.
        - `bounced` (integer, required): Permanent bounces.
        - `complained` (integer, required): Emails marked as spam by recipients.
        - `failed` (integer, required): Emails that couldn't be sent.
        - `opened` (integer, required): Emails opened at least once (with open tracking).
        - `clicked` (integer, required): Emails clicked at least once (with click tracking).
        - `unsubscribed` (integer, required): Unsubscribes through the broadcast's links.
      - `occurred_at` (string, required, date-time): When this happened.
  - One of (7):
    - `id` (string, required): The event id, and the `webhook-id` header.
    - `object` ("event", required)
    - `type` ("inbox.message.received", required)
    - `api_version` (string, required): The API version (`Coss-Version`) this event is rendered in: the receiving endpoint's `api_version`.
    - `created_at` (string, required, date-time)
    - `data` (object, required)
      - `inbox_id` (string, required)
      - `inbox_address` (string, required)
      - `thread_id` (string, required)
      - `message_id` (string, required): The inbox message's id (`imsg_…`).
      - `received_email_id` (string, required)
      - `from` (string | null, required)
      - `to` (string[], required)
      - `subject` (string | null, required)
      - `attachment_count` (integer, required)
      - `new_thread` (boolean, required): Whether the message started its thread.
      - `spam` (boolean, required)
      - `sandbox` (boolean, required)
      - `received_at` (string, required, date-time)
  - One of (8):
    - `id` (string, required): The event id: the same as `SmsEvent.id`.
    - `object` ("event", required)
    - `type` ("sms.scheduled" | "sms.sent" | "sms.delivered" | "sms.undelivered" | "sms.failed" | "sms.suppressed" | "sms.canceled", required): What happened to the message.
    - `api_version` (string, required): The API version (`Coss-Version`) this event is rendered in: the receiving endpoint's `api_version`.
    - `created_at` (string, required, date-time): When the event was created.
    - `data` (object, required)
      - `failure` (object): Why the message failed or wasn't delivered.
        - `code` (string, required): Machine-readable reason.
        - `message` (string, required): Human-readable explanation.
      - `provider_error_code` (string | null): The provider's or carrier's own error code, e.g. `30007`.
      - `suppression` (object): `sms.suppressed`: the entry that made coss.com skip the number.
        - `id` (string, required): The suppression's id.
        - `reason` ("opt_out" | "manual" | "invalid_number", required): Why the number is suppressed.
      - `sms_id` (string, required): The id of the message.
      - `from` (string, required): The number it's sent from.
      - `to` (string, required): The recipient's number.
      - `country` (string, required): The recipient's country (ISO 3166-1 alpha-2).
      - `segments` (integer, required): Segments the body takes (what is billed).
      - `tags` (object[], required): Your tags on the message.
        - `name` (string, required): The tag's name.
        - `value` (string, required): The tag's value.
      - `sandbox` (boolean, required): Whether it was sent from a sandbox environment: simulated.
      - `occurred_at` (string, required, date-time): When it happened.
      - `traceparent` (string): Only for a message sent with a W3C `traceparent` header: that trace context (normalized to version `00`), also sent as this request's `traceparent` header, so handling the event joins the sender's trace.
  - One of (9):
    - `id` (string, required): The event id.
    - `object` ("event", required)
    - `type` ("sms.received" | "sms.opted_out" | "sms.opted_in", required): `sms.received`: a message arrived. `sms.opted_out`: the sender replied with an opt-out keyword. `sms.opted_in`: the sender replied with an opt-in keyword.
    - `api_version` (string, required): The API version (`Coss-Version`) this event is rendered in: the receiving endpoint's `api_version`.
    - `created_at` (string, required, date-time): When the event was created.
    - `data` (object, required)
      - `received_sms_id` (string | null, required): The received message; `null` for an opt-out to a number whose replies go to no environment.
      - `from` (string, required): Who sent it.
      - `to` (string, required): Your number that received it.
      - `keyword` ("stop" | "start" | "help" | null, required): The keyword it is, if any: `stop`, `start` or `help`. `null`: none.
      - `sandbox` (boolean, required): Whether it's a simulated message of a sandbox environment.
      - `occurred_at` (string, required, date-time): When it happened.
  - One of (10):
    - `id` (string, required): The event id: the same as the audit trail's `SignEvent.id`.
    - `object` ("event", required)
    - `type` ("sign_request.sent" | "sign_request.viewed" | "sign_request.signer_signed" | "sign_request.declined" | "sign_request.completed" | "sign_request.canceled" | "sign_request.expired", required): `sent`: sent to signers. `viewed`: a signer opened it. `signer_signed`: a signer signed. `declined`: a signer declined. `completed`: the sealed document is ready to download. `canceled` and `expired`: it ended unsigned.
    - `api_version` (string, required): The API version the payload is rendered in (your endpoint's version).
    - `created_at` (string, required, date-time): When the event was created.
    - `data` (object, required): The request. Never documents or field values.
      - `sign_request_id` (string, required): The signature request's id.
      - `status` ("draft" | "sent" | "completed" | "declined" | "canceled" | "expired", required): The request's status after the event.
      - `title` (string, required): The request's title.
      - `metadata` (map of string, required): Your own key-value pairs.
      - `signer` (object | null, required): The signer who viewed, signed or declined; `null` otherwise.
        - `id` (string, required): The signer's id.
        - `name` (string, required): The signer's name.
        - `email` (string, required): The signer's email address.
        - `client_ref` (string | null, required): Your own id for the signer. `null`: none given.
        - `status` ("pending" | "notified" | "viewed" | "signed" | "declined", required): The signer's status after the event.
      - `reason` (string | null, required): A decline's reason, if the signer gave one.
      - `sandbox` (boolean, required): Whether it belongs to a sandbox environment.
      - `occurred_at` (string, required, date-time): When it happened.
  - One of (11):
    - `id` (string, required)
    - `object` ("event", required)
    - `type` ("verification.approved" | "verification.failed" | "verification.blocked", required): What happened to the verification.
    - `api_version` (string, required): The API version the payload is rendered in (your endpoint's version).
    - `created_at` (string, required, date-time): When the event was created.
    - `data` (object, required): The verification. Never its code.
      - `verification_id` (string, required): The verification's id.
      - `channel` ("sms" | "email", required): `sms` or `email`.
      - `to` (string, required): The phone number (E.164) or address the code goes to.
      - `status` ("pending" | "approved" | "expired" | "canceled" | "failed" | "blocked", required): Its status after this event.
      - `failure` (object | null, required): Why it `failed`. `null` otherwise.
        - `code` (string, required): Machine-readable reason.
        - `message` (string, required): Human-readable explanation.
      - `reasons` (object[], required): Why it was `blocked`. Empty otherwise.
        - `code` (string, required)
        - `value` (number)
      - `tags` (object[], required): Your tags on the verification.
        - `name` (string, required): The tag's name.
        - `value` (string, required): The tag's value.
      - `sandbox` (boolean, required): Whether it's made in a sandbox environment: simulated.
      - `occurred_at` (string, required, date-time): When this happened.
  - One of (12):
    - `id` (string, required): The event id.
    - `object` ("event", required)
    - `type` ("form.submission.received" | "form.submission.flagged", required): `received`: a submission was accepted (at once, after the submitter confirmed, or released from review). `flagged`: Risk held it for review or refused it (honeypot catches send nothing).
    - `api_version` (string, required): The API version the payload is rendered in (your endpoint's version).
    - `created_at` (string, required, date-time): When the event was created.
    - `data` (object, required): The submission.
      - `form_id` (string, required): The form's id.
      - `form_name` (string, required): The form's name.
      - `submission_id` (string, required): The submission's id.
      - `status` ("pending_confirmation" | "accepted" | "held" | "spam", required): The submission's status after this event.
      - `data` (map of string | string[], required): Field name → value; a field posted several times has an array.
      - `submitter_email` (string | null, required): The value of the form's `submitter.email_field`. `null` when it has none.
      - `files` (object[], required): Uploaded files (download them with the API; never their bytes here).
        - `id` (string, required)
        - `field` (string, required): The form field it was uploaded through.
        - `filename` (string, required): The file's name, made safe.
        - `content_type` (string, required): The MIME type it was uploaded as.
        - `size` (integer, required): Bytes.
      - `spam_reason` ("honeypot" | "risk_block" | "risk_review" | "content" | null, required): Why it was flagged. `null`: not flagged.
      - `sandbox` (boolean, required): Whether it belongs to a sandbox environment.
      - `occurred_at` (string, required, date-time): When this happened.
  - One of (13):
    - `id` (string, required): The event id.
    - `object` ("event", required)
    - `api_version` (string, required): The API version this payload is rendered in: the endpoint's.
    - `created_at` (string, required, date-time): When the event was created.
    - `type` ("scheduling.booking.created" | "scheduling.booking.pending_approval" | "scheduling.booking.confirmed" | "scheduling.booking.rescheduled" | "scheduling.booking.cancelled" | "scheduling.booking.declined" | "scheduling.booking.no_show" | "scheduling.booking.external_conflict" | "scheduling.booking.calendar_write_failed" | "scheduling.booking.location_ready" | "scheduling.booking.reassigned" | "scheduling.booking.started" | "scheduling.booking.ended" | "scheduling.booking.reminder", required): What happened to the booking.
    - `data` (object, required): Ids, times and statuses only. Retrieve the booking for anything about the person.
      - `booking_id` (string, required): The booking's id.
      - `event_type_id` (string, required): The booked event type's id.
      - `status` ("held" | "pending_approval" | "confirmed" | "cancelled" | "declined", required): The booking's status after this event.
      - `start` (string, required): When the booking starts.
      - `end` (string, required): When the booking ends.
      - `host_ids` (string[], required): The ids of the hosts taking it.
      - `attendee_uids` (string[], required): Your uids of its attendees.
      - `series_id` (string | null, required): The id of its series. `null`: not part of one.
      - `previous_start` (string): `scheduling.booking.rescheduled`: when it used to start.
      - `previous_host_ids` (string[]): On `scheduling.booking.reassigned`: who had it before.
      - `reassignment_id` (string): On `scheduling.booking.reassigned`: the bulk reassignment it was part of.
      - `reminder` (object): `scheduling.booking.reminder`: which reminder this is.
        - `key` (string, required): Which reminder this is.
        - `anchor` ("start" | "end" | "confirmed" | "rescheduled" | "cancelled" | "declined" | "pending_approval" | "no_show", required): The moment it's timed from.
        - `before_minutes` (number | null, required): How long before the anchor. `null` when it's after.
        - `after_minutes` (number | null, required): How long after the anchor. `null` when it's before.
        - `scheduled_for` (string, required): When it was due.
      - `occurred_at` (string, required): When this happened.
  - One of (14):
    - `id` (string, required): The event id.
    - `object` ("event", required)
    - `api_version` (string, required): The API version this payload is rendered in: the endpoint's.
    - `created_at` (string, required, date-time): When the event was created.
    - `type` ("scheduling.calendar.connected" | "scheduling.calendar.needs_reauth" | "scheduling.calendar.disconnected", required): `connected`: a calendar account was connected. `needs_reauth`: access was lost, and the host isn't offered until it's back. `disconnected`: the connection was removed.
    - `data` (object, required): The host and calendar connection this is about.
      - `host_id` (string, required): The host's id.
      - `connection_id` (string, required): The calendar connection's id.
      - `provider` (string, required): The calendar provider, such as `google`.
      - `occurred_at` (string, required): When this happened.
  - One of (15):
    - `id` (string, required): The event id.
    - `object` ("event", required)
    - `api_version` (string, required): The API version this payload is rendered in: the endpoint's.
    - `created_at` (string, required, date-time): When the event was created.
    - `type` ("scheduling.calendar_delegation.failing" | "scheduling.calendar_delegation.restored", required)
    - `data` (object, required)
      - `delegation_id` (string, required)
      - `provider` (string, required)
      - `domain` (string, required)
      - `code` (string | null, required): What the provider said, when it refused.
      - `occurred_at` (string, required)
  - One of (16):
    - `id` (string, required): The event id.
    - `object` ("event", required)
    - `api_version` (string, required): The API version this payload is rendered in: the endpoint's.
    - `created_at` (string, required, date-time): When the event was created.
    - `type` ("scheduling.out_of_office.created" | "scheduling.out_of_office.updated" | "scheduling.out_of_office.deleted" | "scheduling.out_of_office.started" | "scheduling.out_of_office.ended", required)
    - `data` (object, required)
      - `out_of_office_id` (string, required)
      - `host_id` (string, required)
      - `start` (string, required)
      - `end` (string, required)
      - `group` (string | null, required)
      - `occurred_at` (string, required)
  - One of (17):
    - `id` (string, required): The event id.
    - `object` ("event", required)
    - `api_version` (string, required): The API version this payload is rendered in: the endpoint's.
    - `created_at` (string, required, date-time): When the event was created.
    - `type` ("scheduling.reassignment.completed", required)
    - `data` (object, required)
      - `reassignment_id` (string, required)
      - `status` ("completed" | "cancelled", required)
      - `out_of_office_id` (string | null, required)
      - `counts` (object, required)
        - `total` (number, required)
        - `pending` (number, required)
        - `reassigned` (number, required)
        - `skipped` (number, required): They'd moved on since it was selected.
        - `no_candidate` (number, required): Nobody could take them: they stayed.
        - `failed` (number, required)
        - `cancelled` (number, required)
      - `occurred_at` (string, required)
  - One of (18):
    - `id` (string, required): The event id.
    - `object` ("event", required)
    - `api_version` (string, required): The API version this payload is rendered in: the endpoint's.
    - `created_at` (string, required, date-time): When the event was created.
    - `type` ("scheduling.calendar_delegation.failing" | "scheduling.calendar_delegation.restored", required)
    - `data` (object, required)
      - `delegation_id` (string, required)
      - `provider` (string, required)
      - `domain` (string, required)
      - `code` (string | null, required): What the provider said, when it refused.
      - `occurred_at` (string, required)
  - One of (19):
    - `id` (string, required): The event id.
    - `object` ("event", required)
    - `api_version` (string, required): The API version this payload is rendered in: the endpoint's.
    - `created_at` (string, required, date-time): When the event was created.
    - `type` ("scheduling.oauth_app.failing" | "scheduling.oauth_app.restored", required)
    - `data` (object, required)
      - `oauth_app_id` (string, required)
      - `provider` (string, required)
      - `code` (string | null, required): What the provider said, when it refused.
      - `occurred_at` (string, required)
- `endpoints` (integer, required): Enabled endpoints of the environment subscribed to the type, each sent it once.
- `listeners` (integer, required): Open `coss listen` listeners subscribed to the type, each handed it once.

Example:

```json
{
  "object": "webhook_test_event",
  "event": {
    "id": "evt_01k7c8m4r0c2b8w9y3d5f6g7h8",
    "object": "event",
    "type": "email.bounced",
    "api_version": "2026-10-10",
    "created_at": "2026-10-10T12:00:03.000Z",
    "data": {
      "email_id": "email_01k7c8m4q2f3e9v6t5r1n0p8yz",
      "from": "Acme <onboarding@acme.com>",
      "to": [
        "ada@example.com"
      ],
      "subject": "Welcome to Acme",
      "tags": [
        {
          "name": "template",
          "value": "welcome"
        }
      ],
      "category": "onboarding",
      "sandbox": true,
      "recipient": "ada@example.com",
      "occurred_at": "2026-10-10T12:00:03.000Z",
      "bounce": {
        "type": "permanent",
        "sub_type": "General",
        "diagnostic_code": "smtp; 550 5.1.1 The email account that you tried to reach does not exist"
      }
    }
  },
  "endpoints": 1,
  "listeners": 1
}
```

## Errors

- `400`: The body is not valid JSON (`invalid_json`). Also when the `Coss-Version` header names an unknown API version (`invalid_api_version`).
- `401`: The API key is missing, invalid, revoked or expired (`authentication_error`).
- `403`: The API key lacks the `webhook:create` permission, its organization is suspended, or it belongs to a live environment (`sandbox_only`).
- `413`: The request body is larger than 5 MB (`payload_too_large`).
- `415`: The body is not sent as `application/json` (`unsupported_media_type`).
- `422`: The body failed validation (`validation_error`), the type only reaches live environments (`live_only_event_type`: `domain.*`, `account.*`, `billing.*`), or `data` doesn't fit the type (`invalid_test_event`, with `issues`; unknown fields included).
- `429`: Too many requests with this API key (`rate_limited`), or too many requests with invalid keys from this address (`too_many_failed_authentications`). Retry after `Retry-After` seconds. Successful responses carry `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` (seconds until the limit is fully restored).
- `500`: Unexpected server error (`api_error` / `internal_error`).
- `503`: The API key could not be verified right now; retry (`service_unavailable`).