For the complete documentation index, see llms.txt. This page is also available as Markdown.

Webhooks

The Webhooks API is the registration surface for outbound event callbacks. A subscription is a (url, events) pair: when one of the listed event types fires for the calling tenant (subscription.created, payment.succeeded, invoice.paid, …), the platform's webhook router POSTs the event payload to url with an HMAC signature derived from the subscription's secret.

Use this for replication into a data warehouse, for triggering downstream automations (Zapier, n8n, in-house workers), or for keeping a customer-facing app in sync without polling. Signed delivery, automatic retry with exponential back-off, and per-subscription delivery logs are all handled by the router.

Writes (POST / PATCH / DELETE) require the commerce scope; reads require read. Disabled subscriptions (isActive=false) stay in the registry but receive no deliveries.

Endpoints

GET /api/v1/outbound-events

List outbound events (the webhook outbox)

get
/outbound-events

Events PeakCommerce has recorded to announce, newest first. An event is written in the same transaction as the change it announces, then fanned out to your webhook subscriptions. failed means it could not be fanned out after 12 attempts; it is also recorded in API Call Stats (integration outbox) and raised as a critical alert, and can be replayed. id is the event id every delivery carries (body id, X-Webhook-Id).

Required scopes
This endpoint requires the following scopes:
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Query parameters
statusstring · enumOptionalPossible values:
limitinteger · min: 1 · max: 100OptionalDefault: 50
beforestring · date-timeOptional

Only events created before this time (ISO 8601), for paging

Responses
200

data is a list of { id, eventType, resourceType, resourceId, status, attempts, nextAttemptAt, lastError, occurredAt, dispatchedAt, createdAt }

No content

get/outbound-events
GET /api/v1/outbound-events HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*

No content

Notes, examples, or caveats for GET /outbound-events go here.

POST /api/v1/outbound-events/{id}/replay

Replay a failed outbound event

post
/outbound-events/{id}/replay

Re-queues a failed event for dispatch, with the same id. Subscriptions that already received it are not sent it again. Audited.

Required scopes
This endpoint requires the following scopes:
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Path parameters
idstring · uuidRequired
Responses
202

Re-queued; data is the event

No content

post/outbound-events/{id}/replay
POST /api/v1/outbound-events/{id}/replay HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*

No content

Notes, examples, or caveats for POST /outbound-events/{id}/replay go here.

GET /api/v1/outbound-events/health

Outbox health

get
/outbound-events/health

This tenant's outbound events by status, the age of its oldest undispatched event, and the answering instance's dispatcher sweep stats (last sweep time, duration, outcome counts, last retention prune). Dispatched events are pruned after 30 days; failed ones are kept until replayed.

Required scopes
This endpoint requires the following scopes:
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Responses
200

data is { counts: { pending, dispatching, dispatched, failed }, oldestUndispatchedAgeSeconds, dispatcher }

No content

get/outbound-events/health
GET /api/v1/outbound-events/health HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*

No content

Notes, examples, or caveats for GET /outbound-events/health go here.

GET /api/v1/webhooks

List webhook subscriptions

get
/webhooks
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Query parameters
limitinteger · min: 1 · max: 100Optional

Max items to return (1–100, default 20)

Default: 20
offsetintegerOptional

Number of items to skip (default 0)

Default: 0
isActivebooleanOptional

Filter by active status

Responses
200

Paginated list of webhook subscriptions

get/webhooks
GET /api/v1/webhooks HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*

No content

Returns every webhook subscription for the calling tenant (active and disabled). The response includes each subscription's url, subscribed events, isActive, last-delivery timestamp, and recent failure count for quick triage.

Requires the read scope.

POST /api/v1/webhooks

Register a webhook subscription for event callbacks. Use `GET /webhooks/event-types` to discover available event type names. Subscribing to `*` receives all events.

post
/webhooks
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Header parameters
Idempotency-KeystringOptional

Idempotency key to safely retry without creating duplicates

Body
urlstring · uriRequired

Public HTTPS endpoint that will receive POST requests. Must use https:// and must not point at a loopback, private-network (10/8, 172.16/12, 192.168/16) or link-local (169.254/16, including cloud metadata) address; otherwise the request is rejected with 400 validation_failed and the reason in details[].message.

eventsstring[]Required

Event type names to subscribe to. Use * for all events.

Responses
201

Webhook subscription created. The response includes the secret (shown once) used to verify payloads — see signature scheme in the description.

No content

post/webhooks
POST /api/v1/webhooks HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 47

{
  "url": "https://example.com",
  "events": [
    "text"
  ]
}

No content

Registers a new webhook subscription. url must be HTTPS in production. events is the array of event types to subscribe to — use ["*"] to receive everything, or list specific types from the registry exposed by GET /capabilities / event-types listing.

The response 201 carries the new subscription plus the per-subscription signing secret (only ever returned at create time — store it). Use it to verify the X-Signature header on incoming deliveries.

Requires the commerce scope.

DELETE /api/v1/webhooks/{id}

Delete a webhook subscription

delete
/webhooks/{id}
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Path parameters
idstringRequired
Responses
204

Webhook deleted

No content

delete/webhooks/{id}
DELETE /api/v1/webhooks/{id} HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*
204

Webhook deleted

No content

Permanently removes the subscription and its delivery history. To stop deliveries without losing history, prefer PATCH with isActive: false.

Requires the commerce scope. Returns 204 on success.

GET /api/v1/webhooks/{id}

Get webhook subscription details

get
/webhooks/{id}
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Path parameters
idstringRequired
Responses
200

Webhook subscription details

No content

get/webhooks/{id}
GET /api/v1/webhooks/{id} HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*
200

Webhook subscription details

No content

Returns the full subscription including delivery stats. The signing secret is not returned here — it is only emitted at create time. If you've lost the secret, delete the subscription and create a new one.

Requires the read scope.

PATCH /api/v1/webhooks/{id}

Update a webhook subscription

patch
/webhooks/{id}
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Path parameters
idstringRequired
Body
urlstring · uriOptional

Same rule as on create: Must use https:// and must not point at a loopback, private-network (10/8, 172.16/12, 192.168/16) or link-local (169.254/16, including cloud metadata) address; otherwise the request is rejected with 400 validation_failed and the reason in details[].message.

eventsstring[]Optional
isActivebooleanOptional
Responses
200

Webhook updated

No content

patch/webhooks/{id}
PATCH /api/v1/webhooks/{id} HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 63

{
  "url": "https://example.com",
  "events": [
    "text"
  ],
  "isActive": true
}

No content

Partial-update; supply only the fields you want to change. Common patterns: rotate url after a infrastructure migration, narrow events once a downstream consumer is ready for fewer event types, or flip isActive: false to pause deliveries while keeping the subscription for later.

Changing events does not retroactively redeliver missed events. Requires the commerce scope.

GET /api/v1/webhooks/{id}/deliveries

List delivery history for a webhook subscription with optional status and time-range filtering

get
/webhooks/{id}/deliveries
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Path parameters
idstringRequired

Webhook subscription ID

Query parameters
limitinteger · min: 1 · max: 100Optional

Max items to return (1–100, default 20)

Default: 20
offsetintegerOptional

Number of items to skip (default 0)

Default: 0
statusstring · enumOptional

Filter by delivery status (pending | retrying | delivered | dead_letter)

Possible values:
sincestring · date-timeOptional

Return deliveries created at or after this ISO 8601 timestamp

untilstring · date-timeOptional

Return deliveries created at or before this ISO 8601 timestamp

Responses
200

Paginated delivery history

application/json
get/webhooks/{id}/deliveries
GET /api/v1/webhooks/{id}/deliveries HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "webhookSubscriptionId": "123e4567-e89b-12d3-a456-426614174000",
      "eventType": "text",
      "status": "pending",
      "statusCode": 1,
      "responseBody": "text",
      "attempts": 1,
      "maxAttempts": 1,
      "lastAttemptAt": "2026-01-01T00:00:00.000Z",
      "nextRetryAt": "2026-01-01T00:00:00.000Z",
      "createdAt": "2026-01-01T00:00:00.000Z"
    }
  ],
  "pagination": {
    "total": 1,
    "limit": 1,
    "offset": 1,
    "hasMore": true
  }
}

Notes, examples, or caveats for GET /webhooks/{id}/deliveries go here.

GET /api/v1/webhooks/{id}/deliveries/{deliveryId}

Get a single delivery record including request payload, response body, and attempt history

get
/webhooks/{id}/deliveries/{deliveryId}
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Path parameters
idstringRequired

Webhook subscription ID

deliveryIdstringRequired

Delivery ID

Responses
200

Delivery record

application/json

A single webhook delivery attempt record.

idstring · uuidOptional
webhookSubscriptionIdstring · uuidOptional
eventTypestringOptional

The event type that triggered this delivery.

statusstring · enumOptional

Current delivery status. dead_letter means max retry attempts were exhausted.

Possible values:
statusCodeinteger · nullableOptional

HTTP status code returned by the consumer endpoint.

responseBodystring · nullableOptional

First 1000 chars of the consumer response body.

attemptsintegerOptional

Number of delivery attempts made so far.

maxAttemptsintegerOptional

Maximum number of attempts before dead-lettering.

lastAttemptAtstring · date-time · nullableOptional
nextRetryAtstring · date-time · nullableOptional

When the next retry is scheduled (null if delivered or dead-lettered).

createdAtstring · date-timeOptional
get/webhooks/{id}/deliveries/{deliveryId}
GET /api/v1/webhooks/{id}/deliveries/{deliveryId} HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "webhookSubscriptionId": "123e4567-e89b-12d3-a456-426614174000",
  "eventType": "text",
  "status": "pending",
  "statusCode": 1,
  "responseBody": "text",
  "attempts": 1,
  "maxAttempts": 1,
  "lastAttemptAt": "2026-01-01T00:00:00.000Z",
  "nextRetryAt": "2026-01-01T00:00:00.000Z",
  "createdAt": "2026-01-01T00:00:00.000Z"
}

Notes, examples, or caveats for GET /webhooks/{id}/deliveries/{deliveryId} go here.

POST /api/v1/webhooks/{id}/deliveries/{deliveryId}/replay

Replay a delivery — re-enqueues the original payload for re-delivery. Works for any status including dead_letter.

post
/webhooks/{id}/deliveries/{deliveryId}/replay
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Path parameters
idstringRequired

Webhook subscription ID

deliveryIdstringRequired

Delivery ID

Responses
202

Replay enqueued. The delivery will be re-attempted asynchronously and its status updated.

No content

post/webhooks/{id}/deliveries/{deliveryId}/replay
POST /api/v1/webhooks/{id}/deliveries/{deliveryId}/replay HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*

No content

A replay starts a fresh series of up to 5 attempts, with the same backoff as an original delivery. While a replay is attempting, the automatic retry schedule leaves that delivery alone, so a replay and an automatic retry never fire together. A replay is a new delivery of the same payload, so your endpoint may see the event again; process it idempotently.

Deliveries that were dead-lettered because they stayed undelivered for 24 hours, or because the subscription was inactive, are replayable here once the endpoint is healthy again.

POST /api/v1/webhooks/{id}/rotate-secret

Rotate the signing secret. The new secret signs deliveries immediately; the previous one keeps verifying for 24 hours so the endpoint can be redeployed without dropping events.

post
/webhooks/{id}/rotate-secret
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Path parameters
idstringRequired
Responses
200

Secret rotated. The response carries the new secret (shown once), previousSecretExpiresAt, and overlapHours.

post/webhooks/{id}/rotate-secret
POST /api/v1/webhooks/{id}/rotate-secret HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*

No content

The new secret is returned once, in this response — there is no way to fetch it again afterwards.

Rotation is designed so you never have to coordinate a simultaneous cutover:

  1. Call this endpoint and store the returned secret.

  2. Deploy it to your endpoint any time within overlapHours (24). Deliveries in this window carry a signature under both the new and the previous secret, so an endpoint still holding the old one keeps verifying normally.

  3. After previousSecretExpiresAt passes, only the new secret signs deliveries.

Because the header can carry more than one signature, your verifier must split X-Webhook-Signature on commas and accept the delivery if any entry matches — see the signature scheme. A verifier that compares the whole header against a single digest works fine until the first rotation, then rejects every delivery for 24 hours.

GET /api/v1/webhooks/event-types

List all supported webhook event types that can be used in subscription `events` arrays

get
/webhooks/event-types
Authorizations
X-API-KeystringRequired

Scoped secret API key — send an sk_live_… value (keys issued before the typed format carry a bare pk_<hex> prefix and are also secret; they still work). A publishable pk_live_…/pk_test_… key is browser-safe, carries no scopes, and is refused by every endpoint in this spec with publishable_key_not_allowed. Coarse scopes: read, commerce, admin (admin covers everything below). Narrow per-resource scopes: journeys|pages :read|write|publish|delete, productsets :read|write|publish|delete, components|rules :read|write|delete, context :read (read-only context tier), catalog :read|write-native. publish is never implied by write.

Responses
200

List of platform-supported event types

application/json
totalintegerOptional
get/webhooks/event-types
GET /api/v1/webhooks/event-types HTTP/1.1
Host: api.peakcommerce.app
X-API-Key: YOUR_API_KEY
Accept: */*
200

List of platform-supported event types

{
  "data": [
    {
      "name": "text",
      "category": "text",
      "description": "text"
    }
  ],
  "total": 1
}

Notes, examples, or caveats for GET /webhooks/event-types go here.

Last updated

Was this helpful?