Skip to Content
PUT
/api/v1/domains/{domain}/event-webhook

One URL per domain, all events, no filters. Mailboxes on the domain start feeding it within seconds (a background walk arms them) — take a baseline first and treat the first batches as deltas. Any PUT re-enables, and re-runs the arm walk: it is the recovery if a walk ever died mid-domain (visible as a dead_lettered arm:<domain> row in the delivery log). What your endpoint receives (payload, X-OpenEmail-Signature scheme, retry policy) is specified as event-batch in this document's top-level webhooks section.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Two credential kinds share this scheme; GET /api/v1/auth/whoami answers which one you hold and what it reaches.

oek_… API key (minted by POST /api/v1/api-keys; shown once at mint). role: account reaches the full account surface: the directory (domains, routes, patterns, api-keys, accounts, address lists) plus every mailbox the account owns. role: system additionally reaches the operator surface, which is documented separately.

oemp_… mailbox app password (minted by POST /api/v1/identities/{identityId}/credentials). Reaches ONE mailbox: its messages, labels, threads, search, sync, send, filters and PIM collections. Directory routes refuse it with 403 insufficient_scope.

Refusal vocabulary: a missing, malformed, expired, or revoked credential answers 401 unauthorized with a WWW-Authenticate: Bearer challenge; a VALID credential outside its scope answers 403 (insufficient_scope for an app password on a directory route, system_credentials_required where only the operator may call). The public routes (health, branding, token-in-path capabilities) declare security: [].

Path Parameters

domain*string

Domain name

Request Body

application/json
  1. body
secret?|

HMAC signing secret — write-only. Omit to keep, string to set, null to clear

Length1 <= length <= 256
url*string

HTTPS endpoint on a public host

Formaturi

Response Body

The hook

application/json
  1. response
consecutiveFailures*integer

Consecutive delivery failures; reset by any success or PUT

createdAt*integer

Creation timestamp in epoch seconds

Formatint64
degraded?boolean

Platform domains only: true while attempts above the hook's supported rate are queued on their retry ladder (never dropped). The health fields of a platform hook are a projection published at a fixed cadence of about a minute

disabledReason*|

'failing' after the 24h auto-disable; any PUT re-enables

domain?string

Present on the domain scope

enabled*boolean
failingSince*|

When the current failing streak began, epoch seconds

Formatint64
hasSecret*boolean

Whether a signing secret is set (write-only)

lastDeliveredAt*|

Last successful delivery, epoch seconds

Formatint64
lastFailure*string|null
lastFailureAt*|

Last failed delivery, epoch seconds

Formatint64
mailboxId?string

Present on the mailbox scope

retryAfter?|

Platform domains only: when the degraded hook has room again, epoch seconds

Formatint64
scope*string
Value in"mailbox""domain"
updatedAt*integer

Last update timestamp in epoch seconds

Formatint64
url*string
Example Request
curl -X PUT 'https://api.open.email/api/v1/domains/string/event-webhook' \
  -H 'Content-Type: application/json' \
  -d '{
  "secret": "whsec_5e8a1c9f2b7d4e6a8c1f3b5d7e9a2c4f",
  "url": "https://hooks.acme.example/openemail"
}'
Example Response
{
  "consecutiveFailures": 0,
  "createdAt": 0,
  "degraded": true,
  "disabledReason": "string",
  "domain": "string",
  "enabled": true,
  "failingSince": 0,
  "hasSecret": true,
  "lastDeliveredAt": 0,
  "lastFailure": "string",
  "lastFailureAt": 0,
  "mailboxId": "string",
  "retryAfter": 0,
  "scope": "mailbox",
  "updatedAt": 0,
  "url": "string"
}