Zapmail
latest
  • latest
  • v1
latest
  • latest
  • v1
Sign In
latest
  • latest
  • v1
Root
Root
  1. Root
  • Zapmail Docs
  • Webhooks
  • MCP
  • users
    • Retrieve User Details
      GET
  • quick setup
    • Quick Setup
      POST
  • workspaces
    • Retrieve all workspaces
      GET
    • Create new workspace
      POST
    • Update workspace
      PUT
    • List all workspace members
      GET
    • Update user role
      PUT
    • Revoke User Access
      DELETE
    • Send invitiation to join workspace
      POST
    • List all invitations
      GET
    • Revoke invitation
      DELETE
    • Update Domain Renewal Settings
      POST
  • billing
    • Add Billing Details
      POST
    • Update Billing Details
      PUT
  • mailbox
    • Retrieve All Mailboxes
      GET
    • Get Mailbox Details by ID
      GET
    • Assign New Mailboxes to Domains
      POST
    • Update mailbox
      PUT
    • Remove mailboxes on next renewal
      PUT
    • Get Authenticator code
      GET
    • Custom OAuth
      POST
    • schedule mailbox creation
      POST
    • retry creation of failed mailboxes
      PUT
  • payments & wallet
    • Add balance to wallet
    • Get wallet balance
    • Enable auto recharge
    • Purchase add on mailboxes
    • get invoices for subscription
  • export
    • Export mailboxes
    • Add third party account details
    • Update third party account details
    • Get Export Status
    • Fetch Workspaces by App
    • List all third-party accounts
  • subscriptions
    • Get all subscriptions
    • Cancel subscription
    • Upgrade existing subscription
    • Purchase subscription
    • Get Mailboxes in a Subscription
  • domains
    • Retrieve All Domains
    • List Assignable Domains
    • Add DMARC record
    • Add Domain forwarding
    • Get Name servers to connect domain
    • Verify Name Server Propagation
    • Connect Domain with Zapmail
    • Enable email forwarding
    • Remove email forwarding
    • Enable catch all emails
    • Remove catch all emails
    • Check DNS records
    • Remove unused domains
    • Get available domains for registration
    • Get domains purchase payment link
    • Get domain connection requests
    • Remove domain connection requests
    • Connect Domain with Zapmail (New)
    • Add Google Client ID to Domain
    • Get availability of multiple domain names.
    • Retrieve Domain Health Score
    • Retrieve All Domains (With filters)
    • AI Domain Finder
    • Move Domains Across workspace
    • Assign Domain Tag
    • list domain tags
    • Create Domain Tags
    • Remove Domain Forwarding
    • List Domains Eligible for Renewal
    • Get Renewal Price
    • Renew Domains
    • Delete Tag
    • Remove Tags From Domains
    • Update Auto Renew Preference
  • dns
    • Get dns records
    • Add dns records
    • Update dns records
    • Delete dns records
  • High Reputation Domains
    • Get available domains
    • Purchase high reputation domains
  • prewarmed domains
    • Get prewarmed domains
    • purchase prewarmed subscription
    • Assign prewarmed mailboxes
    • Get Available Domains Count
    • Get Prewarm Subscriptions
  • placement test
    • Get subscriptions
    • Get Overall Report
    • Get placement test orders
    • Get report by cart order id
    • Get Eligible Mailboxes for Placement Tests
    • Get Available Placement Test Credits
    • Purchase Placement Test
    • Purchase plan
    • Cancel Subscription
  • dns shield
    • Get eligible domains
    • Get available slots
    • Get subscriptions
    • Get Allocated Domains for Subscription
    • Allocate Domains to DNS Shield
    • Purchase DNS Shield
    • Upgrade DNS Shield LTD Plan
    • Cancel subscription
  • Zapsites
    • Scan A Site
    • Create a New Zapsite
    • Fetch A Zapsite
    • Edit a Zapsite
    • Regenerate a Zapsite
    • Deploy a Zapsite
  • global
    • Global mailbox-domain search
  • zapbox
    • List Connected Accounts
    • Fetch emails
    • get emails from a thread
    • Search emails
    • Send Email
    • Download Attachment
    • Create New Label
    • Delete Label
    • Rename Label
  • Webhooks
    • Get Event Types
    • Get Webhook Endpoints/Destinations
    • Create New Webhook Endpoint/Destination
    • Update a Specific Endpoint
  • Schemas
    • domain with filter
  1. Root

Webhooks

Zapmail webhooks let you subscribe to account events (domains, mailboxes, subscriptions, exports, placement tests, and workspaces) and get them pushed to your own HTTPS endpoint in near real time, instead of polling the API.
๐Ÿ’ก
This is the live reference for the shipped webhooks feature. All endpoints below are mounted under /api/v2/webhooks and are scoped per-user (the API key owner) โ€” x-workspace-key has no effect on webhook resources.

Quick start#

1
Create an endpoint
POST /webhooks/endpoints with your url and the enabled_events you want. Save the secret from the response โ€” it is only ever returned once.
2
Verify the signature
Every delivery is signed with an X-Zapmail-Signature header. Recompute the HMAC on your side and compare before trusting the payload โ€” see Verifying signatures below.
3
Go live
Subscribe to the real events you care about via enabled_events

Event envelope#

FieldDescription
idUnique event ID (evt_ + UUIDv7). Use this to de-duplicate โ€” delivery is at-least-once.
typeOne of the event types listed below.
createdUnix timestamp (seconds) the event was generated.
api_versionEnvelope schema version, currently 2026-07-01.
dataEvent-specific payload โ€” shape varies per type, see Event catalog.
Delivery request headers:
HeaderValue
Content-Typeapplication/json
X-Zapmail-Signaturet=<unix_ts>,v1=<hex_hmac_sha256> โ€” see Verifying signatures
User-AgentZapmail-Webhooks/1.0

Event catalog#

Fetch this list programmatically at any time via GET /webhooks/events (returns value/label/description/category for each type) โ€” use it to populate an event picker instead of hardcoding the strings below.
Domains
domain.updated ยท domain.connection_status_changed
Mailboxes
mailbox.updated
Subscriptions
subscription.status_changed
Exports
export.started ยท export.completed ยท export.failed ยท export.reconnected
Placement Tests
placement_test.status_changed
Workspaces
workspace.status_changed ยท workspace.invitations
domain.updated
Fires when a domain's status, configuration, or DNS state changes. data.domainDetails is the domain record restricted to an explicit allow-list of fields (internal relations like cloudflareCredentials are never included), plus a flattened healthScore / healthErrorMessage / healthLabel and a live assignedMailboxesCount. data.previousState contains only the fields that changed.
{
  "domainDetails": {
    "id": "a1b2c3d4-0000-0000-0000-000000000001",
    "userId": "a1b2c3d4-0000-0000-0000-000000000002",
    "workspaceId": "a1b2c3d4-0000-0000-0000-000000000003",
    "domain": "dummy-domain.com",
    "status": "CONNECTED",
    "purchaseType": "REGISTERED",
    "serviceProvider": "GOOGLE",
    "registeredOn": "2026-01-15T00:00:00.000Z",
    "expireOn": "2027-01-15T00:00:00.000Z",
    "isWarmedUp": true,
    "healthScore": 92,
    "healthErrorMessage": null,
    "healthLabel": "Healthy",
    "assignedMailboxesCount": 5,
    "createdAt": "2026-01-15T00:05:00.000Z",
    "updatedAt": "2026-07-30T09:12:00.000Z"
  },
  "previousState": {
    "status": "PENDING"
  }
}
domain.connection_status_changed
mailbox.updated
subscription.status_changed
subscription.billing_changed
export.started
export.completed
export.failed
export.reconnected
placement_test.status_changed
workspace.status_changed
workspace.invitations

Endpoints#

All paths below are relative to /api/v2/webhooks and require the standard auth headers (x-auth-zapmail required).
MethodPathDescription
GET/eventsList all subscribable event types with labels/descriptions/categories.
POST/endpointsCreate an endpoint: { url, enabled_events[] }. Response includes secret โ€” shown only this once.
GET/endpointsList all endpoints owned by the caller (never includes secret).
PATCH/endpoints/:idUpdate url / enabled_events / status (partial, all optional). Setting status: "active" resets the endpoint's consecutive-failure counter.

Verifying signatures#

Every delivery includes an X-Zapmail-Signature header in the form:
X-Zapmail-Signature: t=1753100000,v1=5257a869e7bfbe86...
t โ€” the unix timestamp (seconds) the request was signed at
v1 โ€” an HMAC-SHA256 hex digest of ${t}.${raw_request_body}, keyed with your endpoint's secret (the whsec_... value returned once from POST /endpoints)
To verify a delivery: read the raw, unparsed request body, recompute the HMAC the same way, and compare it to v1 using a constant-time comparison. Reject the request if the signatures don't match, or if t is further from the current time than you're comfortable with (recommended: 5 minutes) to guard against replay.
Node.js
Python
PHP
cURL / OpenSSL

Delivery behavior#

Timeout: 10 seconds per attempt.
Retry schedule: on failure (non-2xx response, timeout, or network error), retries follow a fixed backoff: 1m โ†’ 5m โ†’ 30m โ†’ 2h โ†’ 5h โ†’ 10h โ†’ 24h, for 8 attempts total including the first.
Redirects: not followed โ€” your endpoint must respond directly.
Auto-disable: an endpoint's status flips to disabled after 20 consecutive failed deliveries (across all events, tracked at the endpoint level), and the owner is notified by email. Re-enable it with PATCH /endpoints/:id (status: "active"), which also resets the failure counter.

Consumer checklist#

Verify X-Zapmail-Signature on every request โ€” see Verifying signatures.
Return a 2xx as soon as the payload is durably queued; do the actual processing asynchronously rather than inline in the request handler, since slow handlers count toward the 10s timeout.
Persist the raw payload before processing, so failed processing can be replayed without needing resend.

#

#
Was this page helpful?
Modified atย 2026-09-09 07:56:19
Previous
Zapmail Docs
Next
MCP
Built with