Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Webhook events

Pylota Identity delivers events to your HTTPS endpoints using Standard Webhooks. Configure endpoints through the API or idvy webhooks create.

Delivery

POST /webhooks/mail HTTP/1.1
Content-Type: application/json
User-Agent: PylotaIdentity/1.0 (+https://github.com/PILOTAAI/pylota-identity)
webhook-id: evt_01J9Z5…
webhook-timestamp: 1791540000
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4= v1,Hq3…(second during rotation)

Verify every request

  1. Build the signed content: {webhook-id}.{webhook-timestamp}.{raw body}. Use the raw request body bytes, not re-serialised JSON.
  2. Compute base64(HMAC-SHA256(secret_bytes, content)). secret_bytes is the base64-decoded part of whsec_… after the prefix.
  3. Compare it, in constant time, with each v1, signature in webhook-signature. Accept on any match.
  4. Reject the request if webhook-timestamp is more than 5 minutes from your clock.
  5. Deduplicate on webhook-id: delivery is at least once.

Standard Webhooks libraries exist for most languages. idvy webhooks verify checks a captured request locally.

Responses and retries

  • Any 2xx within 15 seconds counts as delivered. Response bodies are ignored and read only up to 4 KB.
  • Anything else, including a timeout, TLS error, DNS error, redirect or 3xx, is a failure. Failures retry at about 30 s, 2 min, 10 min, 30 min, 1 h, 2 h, 4 h, 8 h, 12 h, 12 h, 12 h, 19 h, which adds up to about 72 hours. Each delay has ±10% jitter.
  • After the last attempt, the delivery is marked dead. The event can be replayed with POST /v1/webhooks/{id}/replay for 30 days from its occurred_at (or retention.events_days, if shorter), counted from when the event happened, not from when the delivery went dead.
  • After 100 consecutive failures spread over at least 24 hours, the endpoint is disabled (disabled_reason: failing) and a webhook.disabled event goes to the platform’s endpoints and, for an endpoint of a partner (a partner endpoint, or an endpoint of one of the partner’s tenants), to that partner’s other endpoints; never to tenant endpoints. webhook.test is delivered once and is never replayed.
  • 410 Gone from an endpoint disables it immediately.

Ordering

Events are not guaranteed to arrive in order. Each payload carries occurred_at, and a sequence that increases strictly per owner: per identity for mailbox events (message.*, identity.*, verification.received, calendar.received, draft.*, suppression.created, quota.warning, sms.*, call.*), per domain for domain.* events, and per job for erasure.* and export.* events, and for identity.deleted, which the erasure job emits after the mailbox is gone (it still carries identity_id, so identity-filtered endpoints receive it). Use it to discard stale updates, for example a message.deferred arriving after message.delivered. Platform events (webhook.disabled, webhook.test, member.*, billing.*, tenant.policy_updated, account.*, signup.verified, phone_request.*, phone_number.*, phone_registration.*, phone_compliance.*, phone_consent.changed, phone_spend.warning, phone_setup.status_changed, phone_budget.changed and vault.*) have sequence: null.

message.screened always precedes, by one sequence, the message.received or message.quarantined it causes, and message.released precedes its message.received. message.received is emitted exactly once per message (re-parse re-emissions excepted).

The same events can also be read in order from the tenant’s event log (REST API › Event feed): positions follow the order of appends, not occurred_at, and an event is in the log before its first webhook delivery is queued.

Envelope

{
  "id": "evt_01J9Z5…",
  "type": "message.received",
  "api_version": "2026-10-01",
  "occurred_at": "2026-10-09T10:12:03.412Z",
  "tenant_id": "ten_01J9…",
  "identity_id": "idn_01J9…",
  "sequence": 1842,
  "data": { }
}

identity_id is null for events that do not belong to one identity (domain, job and platform events); identity.deleted is the one job event that sets it. tenant_id is null only for deployment-level platform events.

Payloads are thin. They carry IDs, a summary, verdicts and up to policy.webhook_text_bytes of extracted_text (default 16 KB, maximum 64 KB). Fetch anything else through the API.

Because the message.*, verification.received and calendar.received payloads carry mail, an endpoint that receives them can only be created, re-pointed or replayed by a key that also holds messages:read (and quarantine:review for message.quarantined) (REST API › Webhooks, J29). An endpoint subscribed to message.screened also needs quarantine:review, because a verdict can reveal a held message. Events of the deployment’s system identity go to platform endpoints only.

Event types

Messages

TypeWhendata
message.receivedAn inbound message is stored and visiblemessage (summary, see below), thread_id, trust (with the authentication detail: spf_domain, dkim_domains, dmarc_domain, arc_sealer and the rest), extracted_text, extracted_text_truncated, attachments[] (id, filename, content type, size); plus reprocessed: true when a re-parse emits it again (J3): it is not new mail; screening (the record or null); released: true when a release emitted it: it is the first time this message is visible
message.quarantinedAn inbound message is stored but quarantinedas message.received, plus quarantine_reason. No extracted_text. reprocessed: true as for message.received; screening; rescreened: true when a late signal moved a delivered message back (a re-parse that does both emits one event with both flags, after message.screened)
message.releasedA quarantined message was releasedmessage, released_by_key_id (API release) or released_by_user_id (console release; the other is null), reason. Followed in the same transaction by message.received (released: true) when the message was never evented as received
message.triagedTriage finished (or failed)message_id, thread_id, triage (with version, the triage logic version, and run, which counts completed runs)
message.screenedA screening verdict was reached (or decided at ingest), or a late signal changed itmessage_id, thread_id, message_status, quarantine_reason, late, screening (the record). No subject, address or text (Screening hold §20)
message.sentThe transport accepted an outbound message, or a person resolved an uncertain send as sentmessage, provider, provider_message_id (null after a resolve), sent_via_fallback
message.deliveredA recipient’s server accepted itmessage_id, recipient, smtp_code
message.deferredA temporary failure; the provider is retryingmessage_id, recipient, smtp_code, smtp_response
message.bouncedA permanent failure, or retries exhaustedmessage_id, recipient, bounce_type (hard or soft), smtp_code, smtp_response, suppressed
message.complainedA recipient reported spammessage_id, recipient, suppressed: true
message.rejectedThe transport refused it, at submission or, for some recipients, when the recipient’s server rejected it after submissionmessage_id, reason, detail
message.failedIt could not be sentmessage_id, reason
message.uncertainThe outcome is unknown; never resent automaticallymessage_id, reason (transport_timeout, transport_connection_lost or provider_outcome_unknown), fix
message.reconciledAn uncertain send was matched to a provider eventmessage_id, status
message.suppressedEvery recipient is suppressedmessage_id, recipients[]
message.canceledCancelled while queuedmessage_id
message.labels_changedOpt-in. Labels of visible messages changed through the API, MCP or the consolemessages[] (message_id, thread_id; at most 100), added, removed, actor (kind, key_id, user_id), source (message, thread or batch), request_id, part, parts
verification.receivedA verification code or link was found in authenticated mailmessage_id, sender_domain, kind (code or link), account_id (the approved service-ledger entry that matched, or null when the tenant does not require approval). The value itself is only available through wait

The message summary used in data.message is:

{
  "id": "msg_01J9…", "thread_id": "thr_01J9…", "direction": "inbound", "status": "received",
  "from": { "address": "jo@example.net", "name": "Jo Rivera" },
  "to": [ { "address": "bookings.acme@agents.example", "name": "" } ],
  "cc": [], "delivered_to": "bookings.acme@agents.example", "is_primary_recipient": true,
  "subject": "Change of dates for BK-2291", "sent_at": "…", "received_at": "…",
  "kind": "normal", "labels": [], "in_reply_to": "…", "draft_id": null, "flags": []
}

draft_id is the draft an outbound message was sent from, or null.

Opt-in events. message.labels_changed is written only while the tenant’s policy has events.labels_changed: true, and is delivered only to endpoints that name it: * never includes it. It is never emitted for state the service sets (labels given at send time, erasure, expiry, release), and never names a message that is not visible (Parity additions § 4).

Calendar

TypeWhendata
calendar.receivedA message with a calendar object first becomes visible as received: when it is stored, released from quarantine or screening, or when a re-parse changed its object. Never for quarantined, screening, hidden or throttled mail, or the system identitymessage_id, thread_id, object_status, method, uid, sequence, recurrence_id, verified, verified_by, reason, organized_here; released: true or reprocessed: true when it comes from a release or a re-parse. The uid is text the sender chose; read the object with GET …/messages/{message_id}

Drafts

Mailbox events with the identity’s sequence (Drafts). They carry no subject, body, address, filename or note, so an endpoint needs only webhooks:manage to receive them. draft is the draft summary: id, identity_id, draft_kind, kind, status, revision, digest, recipient_count, attachment_count, send_at, in_reply_to, forward_of, thread_id, client_id.

TypeWhendata
draft.approval_requestedA draft waits for approval, or was edited while waitingdraft, reason (requested, new_recipients, external, always), requested_by_key_id
draft.approvedA revision was approveddraft, send, approved_by_key_id or approved_by_user_id, on_behalf_of
draft.rejectedAn approver rejected it, or the request expired after 7 daysdraft, reason (operator or expired), rejected_by_key_id or rejected_by_user_id, on_behalf_of
draft.sentThe draft became a messagedraft, message_id, thread_id, message_status (queued or suppressed)
draft.failedA scheduled or approved send ended without a messagedraft, reason, attempts

Identities and addresses

Typedata
identity.createdidentity
identity.updatedidentity, changed (list of field names)
identity.pausedidentity_id, reason (manual, abuse_threshold or tenant_suspended), metrics (for abuse)
identity.resumedidentity_id
identity.deletedidentity_id, erasure_request_id. Emitted once, when the identity-scope erasure that deletes the identity completes and its status becomes deleted (after any legal holds end). It comes from the erasure job, so its sequence is the job’s, and identity_id is set
identity.address_addedaddress
identity.address_activatedaddress (pending → active once its domain is healthy or degraded)
identity.address_promotedaddress, previous_primary (with retire_at)
identity.address_retiredaddress
identity.key_createdidentity_id, kid. A signing key was created for an identity that had no active key, lazily by a signing request or by POST …/keys (Identity keys). A rotation’s new key emits identity.key_rotated instead
identity.key_rotatedidentity_id, kid (the new active key), previous_kid (the key now retiring, or null when the rotation created the first key)
identity.key_revokedidentity_id, kid. The key is retired and has left the identity’s JWK Set. Not sent when the key was already retired

Domains

Typedata
domain.createddomain
domain.verifieddomain (verification passed: verifying → healthy, also after a re-proved suspension. A domain that reaches degraded first gets domain.degraded, then domain.recovered when it becomes healthy)
domain.degradeddomain_id, issues[] (code, record, fix)
domain.failingdomain_id, issues[], fallback_active
domain.suspendeddomain_id, reason (failing_14_days, nameservers_changed, ownership_record_missing or registration_changed)
domain.recovereddomain_id, from_state
domain.reminderdomain_id, state, hours_in_state (sent at 24 h, 72 h and 7 days; a domain never verified also gets one at 12 days, 288 h, two days before its unverified expiry; a nameservers domain still pending also gets a final one at 21 days, 504 h, before Cloudflare deletes the zone at 28 days)
domain.removeddomain_id, reason: requested (removed through DELETE /v1/domains/{id}), zone_expired (a nameservers zone was never activated and Cloudflare deleted it; the domain can be added again), evicted (the domain was never verified, and another tenant proved control of its DNS with a claim record) or unverified_expired (the domain was never verified within 14 days of being added, or of its zone’s activation)

Privacy, platform and webhooks

Typedata
erasure.completederasure_request (with receipt)
erasure.failederasure_request_id, step, error. Sent only after the job runner retried the step until 20 hours after the first request; submit the erasure again to restart it (a tenant erasure resumes at the failed step)
export.completedexport_id, expires_at (fetch the download link from the API)
suppression.createdaddress_hint, reason, source_message_id
quota.warningmetric (sends in v1), used, limit, scope (tenant or identity). Sent at 80% and at 100% of a daily send cap
webhook.disabledwebhook_id, reason (platform endpoints, and the other endpoints of the disabled endpoint’s partner: its own, or its tenant’s)
webhook.testmessage: "hello"

Workspaces, members and billing

Typedata
member.invitedinvitation_id, email_hint (masked), role
member.joineduser_id, role
member.role_changeduser_id, from, to
member.removeduser_id
billing.plan_changedfrom_plan, to_plan, reason (checkout, portal (an upgrade confirmed in the Stripe Customer Portal), scheduled_downgrade (a downgrade the owner scheduled took effect at the period end), payment_failed_grace_ended, payment_recovered (the plan was restored after a late payment, or when a dispute closed in the workspace’s favour), canceled, operator, dispute (a payment was disputed: the default plan applies and sends stop until the dispute closes))
billing.payment_failedgrace_until
billing.limit_reachedfeature, granted, resets_at (sent once per feature per period, when the first 402 is returned)
signup.verifiedsignup_id, address, verified_via (code, link or claim), user_id. A provisional agent sign-up was verified; a platform event with tenant_id and identity_id set (Agent self-sign-up)
tenant.policy_updatedfields (the dotted paths written), by (platform, partner, tenant or console), actor_key_id, actor_user_id (one of them null), policy_version. Sent for every policy write except a tenant’s creation, to the tenant’s, its partner’s and platform endpoints (Workspace policy)

Service accounts

Platform events with tenant_id and identity_id set, so an endpoint’s identity filter applies (Service sign-up ledger). account is the service account as the API returns it.

TypeWhendata
account.requestedAn agent recorded that it wants an account at a serviceaccount
account.approvedAn operator approved the entryaccount
account.rejectedAn operator rejected it, or it stayed undecided for 7 daysaccount, reason (operator or expired)
account.closedThe entry was closed, or deleted while it was pending or approvedaccount

Phone numbers

Mailbox events carry the identity’s sequence, like message.*. SMS text and transcripts are untrusted content; verification codes are never in an event (an SMS text shows them as [code]), and an SMS withheld for the vault (vault_code) emits nothing. Counterparty numbers appear in sms and call only where a mail event would carry an address; masked hints elsewhere.

TypeWhendata
sms.receivedAn inbound SMS is stored and visiblesms (summary below), conversation_id, trust (sender_unverified: true, screening), media[] (n, content type, size)
sms.quarantinedAn inbound SMS is stored but heldAs sms.received without text, plus quarantine_reason (account_unapproved, otp_unsolicited, steering_suspected, screening_unavailable, risky_attachment)
sms.releasedA held SMS was releasedsms_id, released_by_key_id or released_by_user_id
sms.screenedA screening verdict on an SMSsms_id, status, quarantine_reason, screening
sms.verification_receivedA verification code was found in a visible SMSsms_id, number_id, sender_hint, kind (code), account_id. The value is only available through GET …/sms/wait
sms.sentThe provider accepted the SMSsms_id, segments, sender_used, sender_substituted
sms.deliveredThe handset or carrier confirmed deliverysms_id
sms.failedThe SMS was refused or not deliveredsms_id, reason
sms.delivery_unconfirmedThe carrier gave no final answersms_id
sms.uncertainThe outcome is unknown; never resent automaticallysms_id, reason, fix
sms.reconciledAn uncertain SMS was matched to a provider recordsms_id, status
call.startedA call on one of the identity’s numbers begancall
call.endedIt ended, or a call record filled it in latercall (with duration_seconds, outcome, cost_pence, source: webhook or cdr)

The SMS summary in data.sms:

{ "id": "sms_01JB…", "conversation_id": "smc_01JB…", "number_id": "pnm_01JB…", "direction": "inbound",
  "status": "received", "from": "+447700900456", "to": "+447700900123", "text": "Can I collect at 3?",
  "segments": 1, "client_reference": null, "received_at": "…", "sent_at": null, "flags": ["sender_unverified"] }

The call object: id, number_id, direction (inbound, outbound), counterparty, route_kind, started_at, answered_at, ended_at, duration_seconds, outcome (answered, no_answer, busy, failed, rejected), disclosure_applied, cost_pence, source.

Platform events have sequence: null, with tenant_id and identity_id set where the subject belongs to an identity. phone_request is the phone request as the API returns it to the endpoint’s level (provider costs only to platform and partner endpoints).

TypeWhendata
phone_request.requestedA request was created, or returned to pending_approval because its price rosephone_request, reason (created or quote_changed)
phone_request.approvedA person, an allowed key or the tenant’s standing budget approved itphone_request, approved_by (person, key, standing_budget, purchase), approved_by_key_id or approved_by_user_id, on_behalf_of, budget_version (with standing_budget)
phone_request.rejectedRejected, or expired after 7 daysphone_request, reason (operator or expired)
phone_request.canceledCanceled by the requester, or by erasurephone_request, reason
phone_request.completedThe provider work ended successfullyphone_request, result
phone_request.failedThe provider work ended without successphone_request, reason
phone_request.uncertainA billable call’s outcome is unknown; the service is reconcilingphone_request
phone_number.status_changedA number changed statusnumber_id, identity_id, from, to, setup_state, provisioning (status, code, retryable), reason (for example moved, adopted, released, missing_at_provider)
phone_number.capability_changedOne of the number’s capability facets changed state (for example outbound_sms from activating to enabled when a US registration became ready)number_id, identity_id, capability (outbound_sms, inbound_sms, inbound_calls, outbound_calls), from, to, reason, next_step
phone_number.expiringA number bought with expires_at will be released within 24 hoursnumber_id, identity_id, release_at
phone_number.action_neededThe provider needs information before a deadlinenumber_id, action_needed (kind, message as untrusted text, deadline_at)
phone_number.port_out_requestedAnother carrier asked for the numbernumber_id, port_out_id, respond_by
phone_number.port_out_decidedA person authorised or rejected it, or the provider authorised itnumber_id, port_out_id, decision (authorized, rejected, provider_authorized), decided_by_key_id or decided_by_user_id
phone_registration.status_changedA US 10DLC brand, campaign or number assignment, or a toll-free verification, changed statusregistration_id, kind, from, to, failure_reason
phone_compliance.status_changedThe compliance profile’s status for a country, number type and action changedcountry, number_type, action, from, to (no personal data)
phone_consent.changedA counterparty opted out or innumber_hint (masked), state, purpose, source
phone_spend.warningPhone spend reached 80% or 100% of a monthly capscope (tenant, identity, registration), identity_id, percent, used_pence, cap_pence, resets_at
phone_setup.status_changedThe tenant’s onboarding status for a country changedcountry, from, to, next_step (no personal data)
phone_budget.changedThe tenant’s standing purchase budget was set, loosened, tightened or turned offversion, enabled, change (set, loosened, tightened, disabled), decided_by (person, key)

Vault

Platform events with tenant_id set, and identity_id set where the change concerns one identity. Every data carries audit: { "seq", "row_hash" }, the head of the tenant’s hash-chained vault audit after the change, so an integrator that stores its events holds an independent copy of the chain heads. No event carries a value, a ticket, a packet, an unlock key or a placeholder. item is the vault item as the API returns it (with title and username, which are not secrets; filter by type if you want neither in a webhook), grant and use likewise (a use never carries its ticket). vault.item.*, vault.grant.*, vault.use.* and vault.ticket.* need vault:read, and identity keys see those of their own identity; vault.consumer.changed and vault.key.changed need vault:admin and are never shown to identity keys.

TypeWhendata (besides audit)
vault.item.createdAn item was created or importeditem (with import.source for an import)
vault.item.updatedIts metadata, origins, approval level or state changeditem
vault.item.rotatedA new version became current (rotation, write-back, rotate_fill)item
vault.item.deletedIt was crypto-shreddeditem_id and the shred receipt
vault.item.revealedA person revealed a value in the console, or was shown a new managed value onceitem_id, actor_user_id, rotated
vault.item.health_changedIts health changeditem_id, health, health_reason
vault.grant.requestedAn agent asked for a grantgrant
vault.grant.approvedA person (or a key under vault.key_approval) approved it, or created it approvedgrant
vault.grant.deniedIt was deniedgrant
vault.grant.revokedIt was revoked, or given up by its agentgrant
vault.grant.expiredIts pending week or active period endedgrant
vault.use.requestedThe orchestrator created a use (also for refusals at creation, with outcome: "refused")use
vault.use.approval_requestedA person must decideuse
vault.use.approvedIt was approved; mint a ticket nowuse
vault.use.deniedIt was denieduse
vault.use.expiredIts approval deadline or first-redemption window passeduse
vault.use.canceledThe orchestrator canceled ituse
vault.use.closedIt closed, normally or earlyuse (with close_reason)
vault.ticket.issuedA ticket was minteduse_id, item_id, consumer_id
vault.ticket.redeemedA consumer redeemed a phaseuse_id, item_id, consumer_id, phase
vault.ticket.refusedA redemption was refuseduse_id, item_id, consumer_id, phase, reason
vault.ticket.reportedA consumer reported an outcomeuse_id, item_id, consumer_id, phase, outcome
vault.consumer.changedA consumer was registered, activated, suspended, resumed, re-keyed or revokedconsumer_id, change
vault.key.changedThe tenant key rotated, custody changed, or revoke-all ranchange (rotated, custody_changed, revoke_all), custody

Twenty-four types. Subscribing an endpoint to vault.consumer.changed or vault.key.changed needs vault:admin, and to the others vault:read.

Versioning

api_version is the payload schema date. Additive changes, such as new fields or new event types, keep the version. v1 has one version, 2026-10-01, so there is nothing to pin and endpoints have no version field. A breaking change would get a new api_version, and the old one would stay available for 12 months; the endpoint field that selects a version is added with that change, through an ADR.

Reading events without an endpoint

Every event that webhooks deliver for a tenant is also kept, with the same envelope and evt_ ID, in the tenant’s event log for retention.events_days (Event feed and live stream):

  • GET /v1/events: pages after a cursor, with a long poll of up to 60 seconds;
  • durable event consumers: a named position kept for you, with commit and redelivery;
  • GET /v1/events/stream: a WebSocket that pushes events and resumes from a cursor with nothing lost.

Endpoint filters do not apply to the log. A key sees an event only when it could read its subject through the API (SMS and call events need phone:read, held SMS events also quarantine:review; phone request, number, registration, consent, spend, setup and budget events need phone:read, and phone compliance events phone:compliance; vault events need vault:read, and vault.consumer.changed and vault.key.changed need vault:admin), and events of the system identity are never in a log. Deduplicate on id across every surface.