Basics

Guides

Webhooks

Subscribing to events, verifying the signature, retries and replays.

A subscription has a URL, a list of events and a signing secret. It belongs to your account and receives the events of every project; each event carries its project_id and mode. An empty list of events means every event of the catalog.

const sub = await dc.webhooks.create({
  url: 'https://api.harborlending.com/webhooks/didconnect',
  events: ['verify.session.approved', 'verify.session.rejected', 'verify.session.review', 'lens.alert'],
});
sub.signing_secret; // returned once

The body

{
  "id": "4f1c…",
  "event": "verify.session.approved",
  "type": "verify.session.approved",
  "created_at": "2026-11-30T15:04:12Z",
  "platform_id": "…",
  "data": { "session_id": "…", "project_id": "…", "subject_reference": "cus_10442", "level": "l2", "mode": "live" }
}

The signature

HeaderValue
DidConnect-Signaturesha256= and the hex HMAC-SHA256 of timestamp.body with the secret
DidConnect-TimestampUnix seconds
DidConnect-EventThe event type
DidConnect-DeliveryThe delivery id, the same for every retry

Reject a delivery whose timestamp is more than five minutes away from your clock. Compare signatures in constant time. dc.webhooks.verify(body, headers, secret) does both and returns the parsed event.

Retries

A delivery is answered by a 2xx. Otherwise it is attempted five times in all: at once, then after 5 minutes, 30 minutes, 2 hours and 12 hours. Handle an event once per id. Replay a delivery with POST /webhooks/:id/deliveries/:deliveryId/retry.

Events

The catalog is GET /webhooks/events. See Webhooks for every event and its data.

On this page