Skip to content

Guides

Webhooks

Receive Inspow events in your system — set up an endpoint, verify the signature, retries, deduplication, test and resend.

With webhooks, Inspow tells your system when something happens in your Organization (a subscription is activated, an invoice is paid…) without you having to poll the API. Each notification is a POST with an event in JSON, signed with the Standard Webhooks standard.

  1. In the console, go to Developers → Webhooks tab → Add endpoint.
  2. Enter the URL that will receive the events. It must start with https://, point to a public internet address and carry no user or password.
  3. Add a description to recognize it (optional).
  4. Choose the events: All, including the ones we add later, or Choose the types you care about. You can only pick the available ones from the catalog.
  5. Save and copy the secret (whsec_…): you need it to verify the signature. To see it later, open the endpoint and click Show.

Your plan sets how many endpoints you can have (see Limits).

A POST with the event in the body and these headers:

HeaderContent
content-typeapplication/json
user-agentInspow-Webhooks/1
webhook-idThe event id (evt_…). It is the same across all retries and resends.
webhook-timestampUnix seconds of the attempt.
webhook-signaturev1,<base64 signature>. While you rotate the secret, two signatures arrive separated by a space.
{
"id": "evt_6553f1a2b3c4d5e6f7a8b9f1",
"type": "invoice.paid",
"timestamp": "2026-11-15T14:03:22.000Z",
"livemode": true,
"data": { "object": { "id": "…" } }
}

The full shape of each type is in the Event catalog. If the body exceeds 64 kB, data.object only carries its id and data.truncated: true: fetch the resource through the API.

Verify every request before processing it: that’s how you know it comes from Inspow and nobody changed it. The signature covers the exact body you receive: read it raw and verify it before parsing it as JSON.

Standard Webhooks has libraries for several languages (official list). In Node.js:

Ventana de terminal
npm install standardwebhooks
import express from 'express';
import { Webhook } from 'standardwebhooks';
const app = express();
const wh = new Webhook(process.env.INSPOW_WEBHOOK_SECRET); // whsec_…
app.post('/webhooks/inspow', express.raw({ type: 'application/json' }), (req, res) => {
let event;
try {
event = wh.verify(req.body, {
'webhook-id': req.header('webhook-id'),
'webhook-timestamp': req.header('webhook-timestamp'),
'webhook-signature': req.header('webhook-signature'),
});
} catch {
return res.status(400).send('Invalid signature');
}
// Store event.id so you don't process it twice and answer now; heavy work goes to the background.
res.sendStatus(204);
});

verify accepts the secret with its whsec_ prefix, checks the signature and rejects a webhook-timestamp more than 5 minutes away from your clock. If everything is fine, it returns the parsed event.

If your language has no library:

  1. Take what follows whsec_ in your secret and base64-decode it: that is the key.
  2. Build the signed content: <webhook-id>.<webhook-timestamp>.<body>, with the body exactly as it arrived.
  3. Compute HMAC-SHA256 with the key and encode the result in standard base64.
  4. Compare, in constant time, against each v1,… signature in webhook-signature. One match is enough.
  5. Reject the event if webhook-timestamp is more than 5 minutes away from your current time.
import { createHmac, timingSafeEqual } from 'node:crypto';
export function validSignature({ secret, id, timestamp, body, signatureHeader }) {
const now = Math.floor(Date.now() / 1000);
if (Math.abs(now - Number(timestamp)) > 5 * 60) return false;
const key = Buffer.from(secret.slice('whsec_'.length), 'base64');
const expected = Buffer.from(
createHmac('sha256', key).update(`${id}.${timestamp}.${body}`).digest('base64')
);
return signatureHeader.split(' ').some((signature) => {
const [version, value] = signature.split(',');
if (version !== 'v1' || !value) return false;
const received = Buffer.from(value);
return received.length === expected.length && timingSafeEqual(received, expected);
});
}

Answer with a 2xx code within 15 s. Any other code, a timeout or a connection error count as a failure and are retried. If you need heavy work, store the event, answer and process it later.

A failed delivery is retried, up to 8 attempts in total (about 27 hours):

AttemptWait since the previous one
1immediately
25 s
35 min
430 min
52 h
65 h
710 h
810 h
  • Each wait varies by ±10 % so deliveries don’t all arrive at once.
  • If you answer 429 or 503 with a Retry-After header (seconds or HTTP date), we wait what you ask, up to 10 h, when it is longer than the table’s wait. That attempt counts within the 8.
  • If you answer 410 Gone to an automatic delivery, the endpoint is disabled right away and not retried.
  • After the last attempt, the delivery is marked Failed. You can resend it by hand (below).

Delivery is at least once: the same event can arrive more than once (a retry after a timeout, a manual resend). Store the webhook-id of every event you process and ignore repeats.

Order isn’t guaranteed: an invoice.paid can arrive before its invoice.created. Use timestamp to order them and, when in doubt, fetch the resource’s current state through the API.

Ignore event types you don’t know: we will add more.

In the endpoint detail, click Send test event and pick a type. Inspow sends the catalog example with livemode: false, in a single attempt, regardless of which events the endpoint has chosen. Test events don’t appear in Events or in GET /events, and they don’t count toward disabling the endpoint. The endpoint must be enabled.

Expand a delivery’s attempts (in the endpoint detail, or in the Events tab) and click Resend now. A new single-attempt delivery is created with the same webhook-id: if you already processed it, your deduplication ignores it. It only works on enabled endpoints and with events that are still stored.

If an endpoint fails for 5 days in a row (since the first failure of an automatic delivery; a successful automatic delivery resets the count, tests and resends don’t count), Inspow disables it and lets you know. When an endpoint is disabled (by failures, by a 410 or by hand), its pending deliveries are canceled and no new ones are created.

Enabling it again doesn’t resend what was lost: recover it with GET /events or with a manual resend.

In the endpoint detail, click Rotate. The previous secret keeps signing for another 24 h: during that time every request carries two signatures, one per secret, and the libraries accept either. Update the secret in your system within that window.

While your Organization’s account is locked or suspended, each delivery is postponed by 1 h without using up attempts. Whatever can’t be delivered while the event is stored is discarded.

In Developers → Webhooks, each endpoint’s detail shows its recent deliveries and, for each delivery, every attempt with its code, its duration and the time of the next one. Events and their deliveries are kept for 7 days.

ActionPermission
See endpoints, deliveries and eventsread:webhook-endpoints
Add an endpointcreate:webhook-endpoints
Edit, enable or disable, see or rotate the secret, send tests and resendupdate:webhook-endpoints
Delete an endpointdelete:webhook-endpoints