> This page is for version v2.
> For other versions, use one of these documentation indexes:
> - v1 (default): https://developers.outpave.com/v1/llms.txt
> - v2: https://developers.outpave.com/v2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.outpave.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.outpave.com/_mcp/server.

# Webhooks and events

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`.

```json
{
  "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

| Member                    | Description                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data.object`             | The resource as `GET relatedObject.url` returns it, as committed by this change. Every event type carries it. A replay sends the same value.                                                                                                                                                                                                                                                |
| `data.previousAttributes` | On 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.objectOmitted`      | `true` 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:

| Resource               | Left out                                                               |
| ---------------------- | ---------------------------------------------------------------------- |
| Card                   | `cardToken`, `cardDetails` and `pendingChange`                         |
| Financial account      | `routingDetails`                                                       |
| Card servicing session | `credentials`, `kind`, `wallet` and `method`                           |
| Embedded session       | `clientToken`, `target` and `origin`                                   |
| Webhook endpoint       | `secret`                                                               |
| Dispute                | Evidence and its file. `evidenceUploaded` shows whether a file exists. |

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

## Register an endpoint

```bash
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:

| Header              | Meaning                                             |
| ------------------- | --------------------------------------------------- |
| `webhook-id`        | The event `id`. The same on every retry and replay. |
| `webhook-timestamp` | When this attempt was signed, in Unix seconds.      |
| `webhook-signature` | Space-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.

**`Node.js`**

```js title="Node.js"
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);
  });
}
```

**`Python`**

```python title="Python"
import base64
import hashlib
import hmac
import time


def verify_webhook(secret, headers, raw_body, now=None):
    msg_id = headers.get("webhook-id", "")
    timestamp = headers.get("webhook-timestamp", "")
    now = int(time.time()) if now is None else now
    if not msg_id or not timestamp.isdigit() or abs(now - int(timestamp)) > 300:
        return False
    key = base64.b64decode(secret.removeprefix("whsec_"))
    signed = f"{msg_id}.{timestamp}.".encode() + raw_body
    expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
    for value in headers.get("webhook-signature", "").split(" "):
        version, _, signature = value.partition(",")
        if version == "v1" and hmac.compare_digest(signature, expected):
            return True
    return False
```

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

| Operation                                                 | Use                                                                                                                       |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `POST /webhookEndpoints/{webhookEndpointId}/test`         | Send a `webhookEndpoint.tested` event. It is signed only with the current secret and makes one attempt without retries.   |
| `GET /webhookEndpoints/{webhookEndpointId}/deliveries`    | Follow the endpoint's deliveries of the last 30 days.                                                                     |
| `POST /webhookEndpoints/{webhookEndpointId}/replayEvents` | Send 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.                |