Webhooks

Webhooks

Have Superpay send each event to your endpoint as it happens, signed, retried and logged.

A webhook subscription sends the events you choose to an endpoint of yours as they happen. Each delivery is a POST whose body is the event, signed so you can check that Superpay sent it.

Deliveries follow the Standard Webhooks specification: a stock Standard Webhooks library verifies them with your subscription's secret, as it is.

EndpointIdempotency-KeyDoes
POST /v1/webhook-subscriptionsRequiredCreate a subscription
GET /v1/webhook-subscriptions—List subscriptions
GET /v1/webhook-subscriptions/{id}—Retrieve a subscription
POST /v1/webhook-subscriptions/{id}RequiredUpdate, disable or enable it
DELETE /v1/webhook-subscriptions/{id}—Delete it
POST /v1/webhook-subscriptions/{id}/rotate-secretRequiredRotate its secret
GET /v1/webhook-subscriptions/{id}/deliveries—List its deliveries
GET /v1/webhook-subscriptions/{id}/deliveries/{delivery_id}—Retrieve a delivery and its attempts
POST /v1/webhook-subscriptions/{id}/deliveriesRequiredRedeliver an event

Every route needs the webhooks:manage scope, reads included. It shows each subscription's full URL, so grant it only where it is needed. Subscriptions belong to one mode: a test subscription is sent test events, signed with its test secret, and a live subscription live events.

Webhooks tell you, the event log keeps you right

Deliveries arrive at least once, in no particular order, and an endpoint that is down misses what is sent meanwhile. Use webhooks to react quickly, and backfill from the event log to be sure you have seen everything.

Create a subscription#

POST/v1/webhook-subscriptionswebhooks:manage

Subscribes a URL to the events you name. The subscription is ENABLED at once and is sent the matching events recorded from then on. Nothing is sent to the URL, and it is not looked up, when you create the subscription.

urlstringRequired

Where deliveries go. At most 2048 bytes, following the URL rules. Stored and returned in canonical form.

enabled_eventsarray of stringsRequired

The events to send, 1 to 64 entries, each once: an exact event type such as payout.completed, every type of a family such as payout.*, or * for everything. The families are payout, beneficiary, originator, fx, business, webhook_subscription and treasury. A family or * also matches types added later.

descriptionstring

Your own note, at most 256 characters. It is never sent anywhere.

You cannot choose the secret. A body with any other field, such as secret, is rejected with 400 REQUEST_BODY_INVALID.

Shell
curl https://api.withsuperpay.com/v1/webhook-subscriptions \
  -H "Authorization: Bearer $SUPERPAY_TOKEN" \
  -H "Idempotency-Key: 6c1f0e2a-94b7-4d35-8a2e-7b0d5c3f9e41" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.example.com/superpay",
    "enabled_events": ["payout.*", "beneficiary.verification_updated"],
    "description": "Payout status for the ledger team"
  }'

The response carries Location: /v1/webhook-subscriptions/{id}.

Save the secret now

secret appears in this response and in the response to rotate-secret, and nowhere else. A retry of this request with the same Idempotency-Key within 24 hours returns the same response, secret included. After that, rotate the secret to get a new one.

  • You can have at most 16 subscriptions in each mode, disabled ones included and deleted ones not. One more returns 422 WEBHOOK_SUBSCRIPTION_LIMIT_REACHED.
  • A URL can be subscribed once per mode. A second subscription to it returns 409 WEBHOOK_URL_ALREADY_SUBSCRIBED.
  • If a create succeeded but you never received its response, and its key has expired, a retry meets that conflict. List your subscriptions to find it, then rotate its secret with previous_secret_expires_in 0.
  • Superpay cannot check your endpoint when you subscribe, and there is no test event. To try your endpoint, subscribe in test mode and cause an event, or redeliver one.

URL rules#

RuleDetail
Schemehttps in live mode. https or http in test mode, for example for a tunnel to your machine
HostA public DNS name with at least two labels: letters, digits and hyphens. Not an IP address. The last label must contain a letter. International names are stored in punycode
Private namesRefused: localhost, and names under a private or reserved suffix such as .local, .internal, .test or .example. Superpay's own hosts and some third-party hosts are refused too
PortThe scheme's default, or one from 1024 to 65535 that Superpay does not reserve. A reserved port is refused with a message saying so. The default port is the safe choice
Other partsNo user name or password, and no #fragment
Every connectionThe host is looked up again, and the attempt is refused if any address it resolves to is private, loopback, link-local or otherwise not public

A URL that breaks a rule is refused with 400 INVALID_ARGUMENT. The errors[] entry on url names the rule, for example a live URL must use https, and never repeats the URL.

The canonical form lower-cases the scheme and host, drops a default port, turns an empty path into / and drops a bare ?. HTTPS://Hooks.Example.com:443/superpay is stored as https://hooks.example.com/superpay.

Superpay does not publish a list of the addresses deliveries come from. Verify the signature instead.

Receive events#

The request#

Each delivery is an HTTP/1.1 POST to your URL, over TLS 1.2 or later for https. The body is the event: the same bytes that GET /v1/events/{id} returns. It is compact JSON of at most 16 KiB.

HeaderValue
Webhook-IdThe event's id. The same on every attempt at the event, and on a redelivery. Deduplicate on it
Webhook-TimestampWhen this attempt was sent, in Unix seconds. New on every attempt
Webhook-Signaturev1, followed by a base64 signature. Two space-separated entries while a rotation overlaps, newest secret first
Content-Typeapplication/json
User-AgentSuperPay-Webhooks/1.0
Content-LengthThe body's length in bytes

No other header is sent: no cookies, no compression, no trace headers. Header names are case-insensitive; read them that way.

A delivery's request line and headers
POST /superpay HTTP/1.1
Host: hooks.example.com
Content-Type: application/json
Content-Length: 773
User-Agent: SuperPay-Webhooks/1.0
Webhook-Id: evt_01M2G0A7ZQ3K9V5T1R8N6P4J2H
Webhook-Timestamp: 1790763702
Webhook-Signature: v1,MsBERy96b8WZCIeA73s7A+cMTEtX6B3kdPHiijATowM=

Respond quickly#

Answer with any 2xx. Your response's headers must arrive within 10 seconds of the request, and the whole exchange, connecting included, must finish within 15 seconds. Your response body is ignored and is not read past 64 KiB.

Anything else is a failed attempt, and the delivery is retried:

  • any other status, including a redirect: redirects are never followed;
  • no answer in time;
  • a DNS, connection or TLS failure.

Acknowledge first, then process: store the event and answer 200, and do the work afterwards, so that slow processing does not turn into a retry.

Verify the signature#

  1. Take the raw request body, exactly as received. Verify it before you parse it, and never re-serialise it: the bytes are what is signed.
  2. Reject the delivery if Webhook-Id, Webhook-Timestamp or Webhook-Signature is missing, or if the timestamp is more than five minutes from your clock.
  3. Build the signed content: {Webhook-Id}.{Webhook-Timestamp}.{body}.
  4. Decode your secret: base64-decode the part after whsec_. The key is the decoded bytes, not the string.
  5. Compute the HMAC-SHA256 of the signed content with that key, and base64-encode it.
  6. Split Webhook-Signature on spaces. Compare your value, in constant time, with each v1, entry. The delivery is genuine if any entry matches a secret you hold.
Node.js
import crypto from 'node:crypto';

const TOLERANCE_SECONDS = 5 * 60;

// rawBody is a Buffer of the unparsed request body; headers have lower-case names, as Node gives them.
// secrets are the whsec_… secrets you accept: one, or two while you move to a rotated secret.
export function verifyWebhook(rawBody, headers, secrets) {
  const id = headers['webhook-id'];
  const timestamp = headers['webhook-timestamp'];
  const signatures = headers['webhook-signature'];
  if (!id || !timestamp || !signatures || !/^\d+$/.test(timestamp)) return false;
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > TOLERANCE_SECONDS) return false;

  const signed = Buffer.concat([Buffer.from(`${id}.${timestamp}.`), rawBody]);
  const received = signatures
    .split(/\s+/)
    .filter(entry => entry.startsWith('v1,'))
    .map(entry => Buffer.from(entry.slice(3), 'base64'));

  return secrets.some(secret => {
    const key = Buffer.from(secret.slice('whsec_'.length), 'base64');
    const expected = crypto.createHmac('sha256', key).update(signed).digest();
    return received.some(sig => sig.length === expected.length && crypto.timingSafeEqual(sig, expected));
  });
}

Read the body as raw bytes. A framework that parses JSON before your handler runs changes the bytes, and the signature no longer matches.

Test your verification#

Check your code against this delivery. Its timestamp is fixed, so skip the five-minute check while you test.

Secretwhsec_ciyZWGyPhuM71aN58LCa30zdL4xV64U4EMgs1f5Ohn4=
Webhook-Idevt_01M2G0A7ZQ3K9V5T1R8N6P4J2H
Webhook-Timestamp1790763702
Webhook-Signaturev1,MsBERy96b8WZCIeA73s7A+cMTEtX6B3kdPHiijATowM=
Body: 773 bytes, one line, no trailing newline
{"id":"evt_01M2G0A7ZQ3K9V5T1R8N6P4J2H","object":"event","type":"payout.completed","api_version":"v1","created_at":"2026-09-30T10:21:41Z","livemode":false,"resource":{"object":"payout","id":"po_01M2FPYTCG9B1D3F5H7K9M1P3R","version":8},"data":{"object":"payout","id":"po_01M2FPYTCG9B1D3F5H7K9M1P3R","originator_id":"org_01M2FPKH20W4N5X6M3P9R2T1VA","beneficiary_id":"ben_01M2FPNHGG6C8D0F2H4K6M8P0R","corridor":"IN-INR-BANK","amount":{"amount":5000000,"currency":"INR"},"fee":{"amount":12500,"currency":"INR"},"status":"COMPLETED","purpose_code":"P1301","reference":"INV-2026-0042","bank_reference":"425714839201","rail":"IMPS","created_at":"2026-09-30T10:21:14Z","updated_at":"2026-09-30T10:21:41Z","submitted_at":"2026-09-30T10:21:16Z","completed_at":"2026-09-30T10:21:41Z"}}

During a rotation overlap with the previous secret whsec_1SUElxxd54C9NVxq8MU3mnVPwYFW3WwLl3l67U9J5pA=, the same delivery carries v1,MsBERy96b8WZCIeA73s7A+cMTEtX6B3kdPHiijATowM= v1,jB4EpM1u5ROc4ZK7ZE57b2lf1XQF0+HSWrn9/nvJMRM=, and either secret verifies it.

Duplicates, order and concurrency#

RuleWhat you do
At least onceThe same event can arrive more than once: after a late 2xx, after an interrupted attempt, from a redelivery, or once per subscription that matches it. Deduplicate on Webhook-Id
No particular orderEvents can arrive out of order, even for one object. Order one object's events by resource.version, and ignore one older than the version you hold
ConcurrentSeveral deliveries to one subscription can be in flight at once. Handle them in parallel
Not everythingdata is a subset of the object. Retrieve the object when you need every field
GapsAn endpoint that was down, or a subscription that was disabled, misses events. Backfill from the event log

Retries#

A failed delivery is attempted again, at most 10 times in all. Each delay counts from the end of the previous attempt and is spread by up to 10% either way, so that deliveries which failed together do not retry together.

Before attempt2345678910
Delay after the previous attempt5 s1 min5 min30 min1 h2 h4 h8 h8 h
  • The tenth attempt comes about 23 hours 36 minutes after the first.
  • A 429 or 503 with Retry-After, in seconds or as an HTTP date and at most one hour, can put the next attempt later, never earlier.
  • A delivery that has not succeeded 72 hours after its event was published is abandoned, as FAILED with status_reason EXPIRED. After ten failed attempts it is FAILED with ATTEMPTS_EXHAUSTED.
  • An attempt Superpay itself interrupts (ABORTED, LEASE_EXPIRED, INTERNAL) does not count against your endpoint's health, but it uses one of the ten attempts. It is retried if attempts remain.

An endpoint that keeps failing#

WhenWhat happens
5 failed attempts in a rowThe subscription's circuit opens. Its deliveries are held, not attempted, for 30 seconds, then twice as long after each further failure, up to 30 minutes. While it is failing, it is sent one attempt at a time. health.circuit_open_until says until when
A successCloses the circuit. The held deliveries follow, earliest due first
Failing for at least 5 days, with at least 10 failed attempts in a rowThe subscription is disabled with disabled_reason FAILING_ENDPOINT, and its waiting deliveries are cancelled. A webhook_subscription.disabled event is sent to your other subscriptions that match it

The circuit holds a delivery for at most 30 minutes at a time, well within the hours between later retries. So on an endpoint that stays down, a delivery still uses its ten attempts over about a day and then fails as ATTEMPTS_EXHAUSTED. On a busy endpoint, where deliveries queue behind the one attempt at a time, many expire at 72 hours after fewer attempts.

Your endpoint was down forWhat to do
A few hoursNothing. Retries catch up
Around a day or moreDeliveries that failed their tenth attempt, about 24 hours after their first, are not tried again, and on a busy endpoint deliveries expire at 72 hours. Backfill from the event log, or redeliver single events
5 days or moreThe subscription is disabled. Fix the endpoint, enable it with {"status": "ENABLED"}, then backfill. Nothing is replayed for you

Watch a subscription's health, and subscribe a second endpoint to webhook_subscription.disabled, or check GET /v1/events?type=webhook_subscription.disabled.

Rotate the secret#

POST/v1/webhook-subscriptions/{id}/rotate-secretwebhooks:manage

Creates a new signing secret and shows it, once, in secret. secret_version goes up by one. Works on a disabled subscription too.

previous_secret_expires_ininteger

Seconds the replaced secret keeps signing beside the new one, 0 to 604800. Default 86400, one day. 0 stops it at once: use it when a secret has leaked. The body is optional.

Shell
curl -X POST https://api.withsuperpay.com/v1/webhook-subscriptions/whs_01M2FR3E7G9J1K3M5P7R9T1V3X/rotate-secret \
  -H "Authorization: Bearer $SUPERPAY_TOKEN" \
  -H "Idempotency-Key: 0b9e4d21-7c3a-4f86-9e15-2d8a6f4c1b73" \
  -H "Content-Type: application/json" \
  -d '{ "previous_secret_expires_in": 3600 }'
  • While the old secret keeps signing, every delivery carries two signatures, one per secret. Move your receiver to the new secret at any point in that window: either secret verifies.
  • previous_secret_expires_at says when the old secret stops. It is null when only one secret signs, including after a rotation with 0.
  • At most two secrets sign at a time. Rotating again during an overlap stops the oldest secret at once.
  • A retry with the same Idempotency-Key within 24 hours returns the same new secret. It does not rotate twice.

Update a subscription#

POST/v1/webhook-subscriptions/{id}webhooks:manage

Changes any of url, enabled_events, description and status. A field you leave out, or send as null, stays as it is. A field sent with its current value changes nothing. There is no PATCH: this POST is the update, and it takes an Idempotency-Key.

FieldEffect
urlA new endpoint, under the URL rules. Deliveries still waiting go to it. Its failures are forgotten
enabled_eventsReplaces the whole list for events published from now on. Deliveries already waiting are still sent
descriptionReplaces the note. "" removes it
status DISABLEDStops automatic deliveries. disabled_reason becomes MANUAL, and waiting deliveries are cancelled, a long backlog over the following seconds. An attempt already under way finishes. Redeliveries you asked for still go
status ENABLEDResumes deliveries from the next published event, clears disabled_reason and forgets the endpoint's failures. Nothing published while the subscription was disabled is sent

The signing secret does not change. To change it, rotate it.

Shell
curl https://api.withsuperpay.com/v1/webhook-subscriptions/whs_01M2FR3E7G9J1K3M5P7R9T1V3X \
  -H "Authorization: Bearer $SUPERPAY_TOKEN" \
  -H "Idempotency-Key: 3a7d9c50-18e2-4b6f-a4c9-5e0b2f7d8a16" \
  -H "Content-Type: application/json" \
  -d '{ "status": "DISABLED" }'

Delete a subscription#

DELETE/v1/webhook-subscriptions/{id}webhooks:manage
Shell
curl -X DELETE https://api.withsuperpay.com/v1/webhook-subscriptions/whs_01M2FR3E7G9J1K3M5P7R9T1V3X \
  -H "Authorization: Bearer $SUPERPAY_TOKEN"

Returns 204 No Content. No body and no Idempotency-Key.

  • The subscription is sent nothing more. Its secrets are deleted, and its waiting deliveries, redeliveries included, are cancelled. An attempt already under way finishes.
  • Deleting it again returns 204 and changes nothing.
  • A deleted subscription is no longer found by GET, but its deliveries stay listable for as long as their events are kept.
  • Its URL can be subscribed again. Drop its secret from your receiver.

List subscriptions#

GET/v1/webhook-subscriptionswebhooks:manage

Your subscriptions in the token's mode, newest first. Deleted subscriptions are not listed, and no secret is shown.

statusstring

Query parameter. ENABLED or DISABLED.

limitinteger

Query parameter. 1 to 100. Default 10.

starting_afterstring

Query parameter. A whs_ id. Returns the page of older subscriptions after it.

ending_beforestring

Query parameter. A whs_ id. Returns the page of newer subscriptions before it. Can't be combined with starting_after.

Shell
curl -G https://api.withsuperpay.com/v1/webhook-subscriptions \
  -H "Authorization: Bearer $SUPERPAY_TOKEN" \
  -d status=DISABLED

The response is a list of subscription objects.

Retrieve a subscription#

GET/v1/webhook-subscriptions/{id}webhooks:manage

Returns the subscription with Superpay's view of its endpoint in health. The secret is never shown. A deleted subscription, or one from the other mode, returns 404 WEBHOOK_SUBSCRIPTION_NOT_FOUND.

Shell
curl https://api.withsuperpay.com/v1/webhook-subscriptions/whs_01M2FR3E7G9J1K3M5P7R9T1V3X \
  -H "Authorization: Bearer $SUPERPAY_TOKEN"
200 OK
{
  "object": "webhook_subscription",
  "id": "whs_01M2FR3E7G9J1K3M5P7R9T1V3X",
  "url": "https://hooks.example.com/superpay",
  "enabled_events": ["*"],
  "api_version": "v1",
  "status": "ENABLED",
  "disabled_reason": null,
  "status_changed_at": "2026-09-30T09:00:00Z",
  "secret_version": 1,
  "previous_secret_expires_at": null,
  "health": {
    "consecutive_failures": 6,
    "failing_since": "2026-09-30T11:02:10Z",
    "circuit_open_until": "2026-09-30T11:40:12Z",
    "last_success_at": "2026-09-30T10:21:42Z",
    "last_failure_at": "2026-09-30T11:39:12Z"
  },
  "livemode": false,
  "created_at": "2026-09-30T09:00:00Z",
  "updated_at": "2026-09-30T11:39:12Z"
}

The subscription object#

Unlike most objects, a subscription sends null for a field with no value. Only description is left out when there is none.

FieldTypeDescription
objectstringwebhook_subscription
idstringwhs_…
urlstringThe endpoint, in canonical form, including any path and query
descriptionstringYour note. Left out when there is none
enabled_eventsarrayThe event types, families or * you subscribed to, in your order
api_versionstringThe event envelope version deliveries use. Always v1
statusstringENABLED: sent the events it matches. DISABLED: sent nothing automatically
disabled_reasonstring or nullMANUAL (you disabled it), FAILING_ENDPOINT (its endpoint kept failing) or TENANT_OFFBOARDED (your account was closed). null while enabled
status_changed_atstringWhen status last changed
secret_versionintegerWhich secret signs, counting from 1. Each rotation adds one
previous_secret_expires_atstring or nullWhen the secret a rotation replaced stops signing. null when only one secret signs
health.consecutive_failuresintegerFailed automatic attempts in a row, across all its deliveries. From 5, deliveries are held
health.failing_sincestring or nullWhen the current run of failures began. null after a success
health.circuit_open_untilstring or nullWhile in the future, deliveries are held. It can stay in the past until the next success
health.last_success_atstring or nullThe last successful automatic attempt
health.last_failure_atstring or nullThe last failed automatic attempt
livemodebooleantrue for live, false for test
created_at, updated_atstringRFC 3339, UTC. updated_at also moves when an attempt changes health

Only automatic attempts change health: redeliveries never do. Enabling a subscription, or changing its URL, clears its failures.

Delivery log#

Every delivery to a subscription, and every attempt at it with the status your endpoint answered, is recorded. Use it to answer "did my endpoint get this event, and what happened?"

A delivery is created when its event is published, a moment after the change it records, or when you redeliver an event. It is kept, with its attempts, as long as its event: 30 days. Nothing of your endpoint's response is kept except its status, and the URL is never shown.

List deliveries#

GET/v1/webhook-subscriptions/{id}/deliverieswebhooks:manage

Newest first. Also works for a deleted subscription.

event_idstring

Query parameter. Only the deliveries of this event.

event_typestring

Query parameter. Only the deliveries of events of this type (payout.completed) or family (payout.*). * is not accepted.

statusstring

Query parameter. PENDING, IN_FLIGHT, SUCCEEDED, FAILED or CANCELLED.

kindstring

Query parameter. AUTOMATIC for the deliveries publishing created, REDELIVERY for the ones you asked for.

limitinteger

Query parameter. 1 to 100. Default 10.

starting_afterstring

Query parameter. A whd_ id. Returns older deliveries. Can't be combined with ending_before.

ending_beforestring

Query parameter. A whd_ id. Returns newer deliveries.

Shell
curl -G https://api.withsuperpay.com/v1/webhook-subscriptions/whs_01M2FR3E7G9J1K3M5P7R9T1V3X/deliveries \
  -H "Authorization: Bearer $SUPERPAY_TOKEN" \
  -d event_id=evt_01M2G0A7ZQ3K9V5T1R8N6P4J2H

No delivery of an event means one of these:

  • the event is not published yet: an event can be read by id a moment before it is published and delivered;
  • it did not match enabled_events when it was published;
  • the subscription was created after it, or was disabled when it was published;
  • the event is older than 30 days.

Retrieve a delivery#

GET/v1/webhook-subscriptions/{id}/deliveries/{delivery_id}webhooks:manage

Returns the delivery with every attempt at it in attempts, first attempt first. A delivery of another subscription returns 404 WEBHOOK_DELIVERY_NOT_FOUND.

200 OK (attempts)
{
  "object": "webhook_delivery",
  "id": "whd_01M2FR5B8D0F2H4K6M8P0R2T4V",
  "status": "SUCCEEDED",
  "attempt_count": 2,
  "attempts": [
    {
      "attempt_number": 1,
      "started_at": "2026-09-30T10:21:42Z",
      "finished_at": "2026-09-30T10:21:42Z",
      "duration_ms": 212,
      "outcome": "HTTP_ERROR",
      "response_status": 503,
      "signatures": 1
    },
    {
      "attempt_number": 2,
      "started_at": "2026-09-30T10:21:47Z",
      "finished_at": "2026-09-30T10:21:47Z",
      "duration_ms": 184,
      "outcome": "SUCCEEDED",
      "response_status": 200,
      "signatures": 1
    }
  ]
}

The delivery object#

A delivery sends null for a field with no value.

FieldTypeDescription
objectstringwebhook_delivery
idstringwhd_…
subscription_idstringThe subscription it was sent to
event_id, event_typestringThe event and its type
kindstringAUTOMATIC (created when the event was published) or REDELIVERY (you asked for it)
statusstringPENDING (waiting for its next attempt), IN_FLIGHT (being attempted), or final: SUCCEEDED, FAILED or CANCELLED
status_reasonstring or nullWhy a delivery that did not succeed ended: ATTEMPTS_EXHAUSTED, EXPIRED, SUBSCRIPTION_DISABLED, SUBSCRIPTION_DELETED or TENANT_OFFBOARDED. CANCELLED with null means Superpay refused to send it on a safety check
attempt_countintegerAttempts made so far, including one in flight
max_attemptsinteger10 for an automatic delivery, 1 for a redelivery
next_attempt_atstring or nullWhen a PENDING delivery is next due. While the circuit is open it can be in the past
expires_atstringWhen the delivery is abandoned if it has not succeeded: 72 hours after it was created, or one hour for a redelivery
first_attempt_at, last_attempt_atstring or nullWhen attempts were made
last_response_statusinteger or nullThe status your endpoint answered the last finished attempt with. null when it did not answer
last_error_codestring or nullThe outcome of the last finished attempt when it failed
last_duration_msinteger or nullHow long the last finished attempt took. null when no connection was made
requested_bystring or nullThe API client (cli_…) that asked for a redelivery. null for an automatic delivery
livemodebooleantrue for live, false for test
created_atstringWhen the delivery was created
completed_atstring or nullWhen it reached a final status
attemptsarrayRetrieve only. Each attempt: attempt_number, started_at, finished_at, duration_ms, outcome, response_status, and signatures: how many signatures it carried, 2 during a rotation overlap

Attempt outcomes#

outcomeMeaning
SUCCEEDEDYour endpoint answered 2xx
HTTP_ERRORAny other status, except a redirect
REDIRECTA 3xx. Redirects are never followed
TIMEOUTConnected, but no answer in time
CONNECTION_FAILEDThe connection was refused, reset or timed out, or the response was malformed or had over 16 KiB of headers
DNS_ERRORThe host did not resolve
TLS_CERT_EXPIRED, TLS_HOSTNAME_MISMATCH, TLS_UNKNOWN_AUTHORITY, TLS_HANDSHAKE_FAILEDA TLS failure, as named
DESTINATION_BLOCKEDThe host resolved to an address that is not public. Nothing was sent
URL_NOT_ALLOWEDThe URL no longer passes the URL rules. Nothing was sent
ABORTEDSuperpay interrupted the attempt. It is retried at once, if attempts remain
LEASE_EXPIREDSuperpay lost track of the attempt. Your endpoint may have received it. It is retried, if attempts remain
INTERNALSuperpay could not make the attempt

Redeliver an event#

POST/v1/webhook-subscriptions/{id}/deliverieswebhooks:manage

Sends one event to this subscription again, and returns 202 Accepted with the new delivery, of kind REDELIVERY, and a Location header.

event_idstringRequired

The evt_ id of the event to send.

Shell
curl https://api.withsuperpay.com/v1/webhook-subscriptions/whs_01M2FR3E7G9J1K3M5P7R9T1V3X/deliveries \
  -H "Authorization: Bearer $SUPERPAY_TOKEN" \
  -H "Idempotency-Key: 9f2c6b18-4e7a-4d03-b5c1-8a3e0d6f2b94" \
  -H "Content-Type: application/json" \
  -d '{ "event_id": "evt_01M2G0A7ZQ3K9V5T1R8N6P4J2H" }'
  • The request carries the event's own Webhook-Id and body, freshly signed. A receiver that deduplicates on Webhook-Id treats it as the event it already has.
  • A redelivery is one attempt, made within the hour (expires_at), usually at once. It is not retried: ask again with a new key if it fails.
  • It is sent to a DISABLED subscription too, and while the circuit is open. It does not change the subscription or its health.
  • The event must be one of yours in this mode, published, recorded in the last 29 days, and of a type that enabled_events matches now. It need not have been delivered to this subscription before.
  • One redelivery of an event to a subscription can be open (PENDING or IN_FLIGHT) at a time, and at most 5 redeliveries to a subscription.

A refusal is stored against its Idempotency-Key like any other answer. Once its cause has gone, ask again with a new key.

Errors#

Errors are problem documents. Authentication, scope, idempotency and request-body errors are shared by every endpoint and listed on Errors.

CodeHTTPEndpointWhenWhat you do
INVALID_ARGUMENT400AnyA field or query parameter is invalid. errors[] names it: url (missing, too long, or breaks a URL rule), enabled_events (empty, over 64 entries, a repeat, or an entry that names no event type), description (over 256 characters), status, previous_secret_expires_in (not 0 to 604800), event_id, event_type, kind, limit, or a cursorFix it. Send with a new key
WEBHOOK_SUBSCRIPTION_NOT_FOUND404Retrieve, update, rotate, list deliveries, redeliverNo such subscription in this mode. Retrieve, update, rotate and redeliver also return it for a deleted subscription, whose deliveries stay listableCheck the id and mode
WEBHOOK_DELIVERY_NOT_FOUND404Retrieve a deliveryNo such delivery of this subscriptionCheck both ids
EVENT_NOT_FOUND404RedeliverNo such event of yours in this mode, published in the last 30 daysCheck the event id. A just-recorded event may not be published yet: try again shortly with a new key
WEBHOOK_URL_ALREADY_SUBSCRIBED409Create, updateAnother of your subscriptions in this mode has this URLUse the existing subscription
REDELIVERY_IN_PROGRESS409RedeliverA redelivery of this event to this subscription is still PENDING or IN_FLIGHTWait for it to finish, then ask again with a new key
WEBHOOK_SUBSCRIPTION_LIMIT_REACHED422CreateYou already have 16 subscriptions in this modeDelete one first
EVENT_TOO_OLD_TO_REDELIVER422RedeliverThe event was recorded more than 29 days agoReconcile the object with its GET endpoint instead
EVENT_NOT_SUBSCRIBED422RedeliverThe subscription's enabled_events do not match the event's typeUpdate enabled_events first, or redeliver to another subscription
REDELIVERY_LIMIT_REACHED422Redeliver5 redeliveries to this subscription are already openWait for one to finish, then ask again with a new key