EventWebhookPayload
What parseEventWebhook answers: the batch of events an event webhook posts to your endpoint, its signature checked first.
What parseEventWebhook answers: the batch of events an event webhook posts to your endpoint, its signature checked first.
type EventWebhookPayload = {
accountId?: string
domain?: string
events: EventWebhookEvent[]
id: string
mailboxId?: string
scope: ('mailbox' | 'domain')
sentAt: number
sequence?: EventWebhookPayloadSequence
states?: Record<string, string>
}Fields
| Field | Type | Description |
|---|---|---|
accountId | string | Optional. Owning account id, when known |
domain | string | Optional. The batch's domain, when known |
events | EventWebhookEvent[] | The batch's events, in order |
id | string | Batch id (ULID): the receiver's idempotency key. Constant across retries and across the mailbox/domain copies; dedupe on (id, scope) |
mailboxId | string | Optional. The mailbox the batch is about, for store batches |
scope | ('mailbox' | 'domain') | Which hook this copy addresses: the mailbox's own, or its domain's |
sentAt | number | THIS attempt's clock, epoch seconds. Inside the signed body, so a freshness-tolerance check still holds for a day-three retry while id stays the dedupe constant |
sequence | EventWebhookPayloadSequence | Optional. The contiguous outbox range this batch drains; store batches only |
states | Record<string, string> | Optional. Current sync state token per type ({ Email, Mailbox, Thread, EmailDelivery }); store batches only. The Email value is a valid since for GET /mailboxes/{mailboxId}/messages/changes, so a receiver can re-sync incrementally instead of re-listing |