Skip to Content

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

FieldTypeDescription
accountIdstringOptional. Owning account id, when known
domainstringOptional. The batch's domain, when known
eventsEventWebhookEvent[]The batch's events, in order
idstringBatch id (ULID): the receiver's idempotency key. Constant across retries and across the mailbox/domain copies; dedupe on (id, scope)
mailboxIdstringOptional. 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
sentAtnumberTHIS 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
sequenceEventWebhookPayloadSequenceOptional. The contiguous outbox range this batch drains; store batches only
statesRecord<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

On this page