Skip to navigation

Webhooks and events

Receive a signed delivery whenever a resource changes.

An event records a committed change to a resource. It names the resource in relatedObject, carries it in data.object and, for a status change, gives the transition.

{
"id": "79da8cbc-5be2-5af5-9a04-d2ed29a2bc13",
"object": "event",
"type": "card.frozen",
"apiVersion": "2.0",
"createdAt": "2026-10-14T16:20:00.000Z",
"livemode": false,
"accountHolderId": "2b1f8f53-5d0e-4c0f-9a51-1d3b8c2e4f10",
"cardProgramId": "9c4e2a71-0f3b-4d8e-b6a2-5e7d1c3f8a90",
"relatedObject": {
"id": "6b1d4f0e-2a9c-4e7b-8d3f-0c5a1e9b7d26",
"type": "card",
"url": "/api/v2/cards/6b1d4f0e-2a9c-4e7b-8d3f-0c5a1e9b7d26"
},
"transition": { "field": "status", "from": "ACTIVE", "to": "FROZEN" },
"requestId": "4f6c1d2e-0a4b-4c55-9f37-2e8b9d1a7c10",
"data": {
"object": {
"id": "6b1d4f0e-2a9c-4e7b-8d3f-0c5a1e9b7d26",
"object": "card",
"livemode": false,
"accountHolderId": "2b1f8f53-5d0e-4c0f-9a51-1d3b8c2e4f10",
"userId": "8d7c6b5a-4f3e-4d2c-9b1a-0f9e8d7c6b5a",
"cardProgramId": "9c4e2a71-0f3b-4d8e-b6a2-5e7d1c3f8a90",
"type": "PHYSICAL",
"status": "FROZEN",
"nickname": "Field team",
"last4": "4242",
"network": "VISA",
"fulfillment": { "status": "DELIVERED", "service": "STANDARD", "carrier": "USPS" },
"walletTokens": [],
"policy": {
"dailyLimit": { "value": 50000, "currency": "USD" },
"monthlyLimit": { "value": 500000, "currency": "USD" }
},
"createdAt": "2026-10-12T14:30:00.000Z",
"updatedAt": "2026-10-14T16:20:00.000Z"
},
"previousAttributes": { "status": "ACTIVE" }
}
}

You can read the events of the last 30 days with GET /events, or have them delivered to a webhook endpoint. The Events API reference lists every event type with an example.

Event data

MemberDescription
data.objectThe resource as GET relatedObject.url returns it, as committed by this change. Every event type carries it. A replay sends the same value.
data.previousAttributesOn a change to an existing resource, each top-level member of object that changed, with its prior value, or null where it had none. Nested objects are listed whole, and updatedAt is never listed. {} when no member changed. Absent on *.created events and the other events of the change that created the resource, on test events, and on financialAccount.balanceUpdated.
data.objectOmittedtrue in place of object when the event would exceed 8,192 bytes or the resource could not be included. Read relatedObject.url instead.

Events recorded before resources were included have no data.

data.object never contains:

ResourceLeft out
CardcardToken, cardDetails and pendingChange
Financial accountroutingDetails
Card servicing sessioncredentials, kind, wallet and method
Embedded sessionclientToken, target and origin
Webhook endpointsecret
DisputeEvidence and its file. evidenceUploaded shows whether a file exists.

Full card numbers, CVVs and tokens are never in an event.

Register an endpoint

curl -X POST "https://$API_HOST/api/v2/webhookEndpoints" \
-H "Authorization: Bearer $TOKEN" \
-H "Account-Holder: $ACCOUNT_HOLDER_ID" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"url": "https://hooks.example.com/card-events",
"events": ["card.frozen", "card.unfrozen"]
}'

The response returns the endpoint’s signing secret, starting with whsec_, once. Store it now: reads never return it.

  • The URL must use https on port 443, with no user name, password or fragment, and its host must resolve only to public internet addresses.
  • List each event type. There are no wildcards.
  • The key needs webhooks:write, plus the read permission of each event’s object, for example cards:read for card events.
  • A platform key that sends no Account-Holder creates an endpoint for the platform.
  • At most 16 endpoints can exist at once for an account holder or a platform.
  • An endpoint keeps working when the API key that created it is rotated or revoked.

Receive deliveries

Each delivery is a POST of one event as JSON, with these headers:

HeaderMeaning
webhook-idThe event id. The same on every retry and replay.
webhook-timestampWhen this attempt was signed, in Unix seconds.
webhook-signatureSpace-separated v1,<signature> values.

Respond with any 2xx status within 15 seconds. A redirect, any other status, a timeout or a connection failure is a failed attempt. Failed deliveries are retried after about 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours, 24 hours and 24 hours, 9 attempts over about 3 days, then marked failed.

Deliveries are at least once and unordered. Handle each event once by its id.

data.object is the resource as of the event, not necessarily its current state. Compare createdAt with the newest event you applied for that resource. Read relatedObject.url, a path relative to your API host, when you need the current state or data.objectOmitted is true. A receiver that ignores data and reads relatedObject.url for every event keeps working.

Verify signatures

  1. Remove the whsec_ prefix from the secret and base64-decode the rest. The bytes are the HMAC key.
  2. Build <webhook-id>.<webhook-timestamp>.<raw request body>, using the body bytes exactly as received, before any JSON parsing.
  3. Compute its HMAC-SHA256 and base64-encode it.
  4. Compare it in constant time with each v1 value in webhook-signature. Accept the delivery when any one matches.
  5. Reject the delivery when no value matches, or when webhook-timestamp is more than 300 seconds from your clock.
const crypto = require("crypto");
function verifyWebhook(secret, headers, rawBody, nowSeconds = Math.floor(Date.now() / 1000)) {
const id = headers["webhook-id"];
const timestamp = headers["webhook-timestamp"] || "";
if (!id || !/^[0-9]+$/.test(timestamp) || Math.abs(nowSeconds - Number(timestamp)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const expected = crypto.createHmac("sha256", key).update(`${id}.${timestamp}.${rawBody}`).digest();
return (headers["webhook-signature"] || "").split(" ").some((value) => {
const [version, signature = ""] = value.split(",");
const received = Buffer.from(signature, "base64");
return version === "v1" && received.length === expected.length && crypto.timingSafeEqual(received, expected);
});
}

Test your code with these values. With the secret whsec_AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=, webhook-id 6a0e9e0b-63b8-4d0e-9a8e-0f6f8c1b2d34, webhook-timestamp 1792000000 and the body {"id":"6a0e9e0b-63b8-4d0e-9a8e-0f6f8c1b2d34","object":"event","type":"card.frozen"}, the signature is v1,KEmTnkw6RcOo17Gh0FRB7W666CHeKFesBWSwMvXPOXk=.

Rotate the secret

POST /webhookEndpoints/{webhookEndpointId}/rotateSecret returns a new secret once. For 24 hours each delivery carries two signatures, one per secret, so deploy the new secret within that window.

Test, follow and replay

OperationUse
POST /webhookEndpoints/{webhookEndpointId}/testSend a webhookEndpoint.tested event. It is signed only with the current secret and makes one attempt without retries.
GET /webhookEndpoints/{webhookEndpointId}/deliveriesFollow the endpoint’s deliveries of the last 30 days.
POST /webhookEndpoints/{webhookEndpointId}/replayEventsSend events again. A replay keeps the webhook-id and the body, so a receiver that deduplicates by id handles it once.
POST /webhookEndpoints/{webhookEndpointId}Change the URL or events, or set status to PAUSED. Deliveries due while paused are canceled, not held.