Platform
Webhooks
Signed event notifications, retries and signature verification.
RelayPoint sends events to HTTPS endpoints you register, in the dashboard (API keys & webhooks) or with /v1/webhook_endpoints (scope webhooks, up to 20 endpoints). Subscribe to a list of event types, or to * for all of them. The signing secret (whsec_…) is shown only when the endpoint is created and when you rotate it.
curl https://api.relaypoints.online/v1/webhook_endpoints \
-H "Authorization: Bearer $RELAYPOINT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/hooks/relaypoint", "events": ["job.completed", "job.failed", "balance.low"] }'Events
| Type | When |
|---|---|
job.completed | A job succeeded. data is the job object. |
job.failed | A job failed; its hold was released. data is the job object with error. |
balance.low | The wallet fell below your low-balance threshold. |
order.paid | A top-up or bundle order was paid and credited. |
order.failed | A payment for an order failed. |
connection.created | An account was connected (through a connect link, the dashboard or the API). |
connection.expired | A connection's access expired or was revoked by the account owner; it must be connected again. |
connection.disconnected | A connection was disconnected. |
social.post.published | A social post was published on every network, or on some of them (status partially_published). data is the post. See Social posting. |
social.post.failed | A social post failed on at least one network after the retries. data is the post with each target's error. |
social.post.pending_approval | A drafter's post waits for an approver. data is the post. |
whatsapp.message.received | An inbound WhatsApp message on an end user's number. data is the message. See WhatsApp. |
whatsapp.message.status | A sent WhatsApp message changed status (sent, delivered, read, failed). data is the message. |
sub_account.cap_reached | A sub-account reached its monthly spend cap (sent to the reseller). |
video_avatar.completed | An avatar video is done. data is the video object with result (MP4, thumbnail and captions URLs). |
video_avatar.failed | An avatar video failed; every hold was released. data is the video object with error. |
catalog.updated | Products shown or hidden, renamed; availability (a product can or can no longer be served); the connections catalogue; display FX rates; feature flags. See Catalog. |
pricing.updated | A product's price, unit or unit size; the BYOK platform fees. See Catalog. |
packs.updated | Top-up packs: price, credits, bonus percentage, availability. See Catalog. |
plans.updated | Connection bundles and add-ons. See Catalog. |
voices.updated | The voices list, or which voices a product can speak. See Catalog. |
limits.updated | Platform limits: maximum avatar video length, default rate limits, verification threshold. See Catalog. |
account.updated | Your own terms: custom prices, mark-ups, white-label names, spend cap, rate limit, status. Only your account receives it; a sub-account learns only that its prices, names or status changed. See Catalog. |
service.status | Maintenance switched on or off, or a product family became degraded or recovered. See Catalog. |
ping | Sent by the dashboard's "Send test" button and POST /v1/webhook_endpoints/{id}/test. |
Every event has the same envelope. Resellers also receive the job events of their sub-accounts, with data.account set to the sub-account.
{
"id": "evt_…",
"type": "balance.low",
"created": 1793232101,
"data": { … }
}Delivery and retries
POST /hooks/relaypoint HTTP/1.1
Content-Type: application/json
User-Agent: RelayPoint-Webhooks/1.0
RelayPoint-Event: job.completed
RelayPoint-Delivery: whd_…
RelayPoint-Signature: t=1793232101,v1=5f0c…e9a1
{"id":"evt_…","type":"job.completed","created":1793232101,"data":{"id":"job_…","object":"job","status":"succeeded",…}}- Answer with any
2xxwithin 10 seconds. Do the work after answering, or in a queue. - Anything else is retried up to 8 times with growing delays: 1 min → 5 min → 15 min → 1 h → 3 h → 6 h → 12 h → 24 h. After that the delivery is marked failed.
- Deliveries can arrive more than once or out of order: de-duplicate on the event
id. - Every delivery and its result is listed in the dashboard, where you can send it again.
Verifying signatures
RelayPoint-Signature is t=<unix seconds>,v1=<hex>, where the hex value is the HMAC-SHA256 of <t>.<raw request body> with your endpoint's secret. Compute it over the raw body (before any JSON parsing), compare in constant time, and reject timestamps more than 5 minutes old to block replays. After you rotate the secret, deliveries are signed with the new secret straight away, so update your server promptly (signatures are checked against every v1 value in the header).
import express from "express";
import { verifyWebhook, WebhookSignatureError } from "@relaypoint/sdk";
const app = express();
// Verify against the raw body: parse JSON only after the signature check.
app.post("/hooks/relaypoint", express.raw({ type: "application/json" }), async (req, res) => {
let event;
try {
event = await verifyWebhook(req.body.toString("utf8"), req.get("RelayPoint-Signature"), process.env.RELAYPOINT_WEBHOOK_SECRET, { toleranceSeconds: 300 });
} catch (e) {
if (e instanceof WebhookSignatureError) return res.status(400).send("bad signature");
throw e;
}
// Handle event.type, de-duplicating on event.id, then answer quickly.
res.sendStatus(204);
});
// Without the SDK (Node's crypto):
import crypto from "node:crypto";
function verify(raw, header, secret, tolerance = 300) {
const parts = (header ?? "").split(",").map((p) => p.trim().split("="));
const t = Number(parts.find(([k]) => k === "t")?.[1]);
const sigs = parts.filter(([k]) => k === "v1").map(([, v]) => v);
if (!t || Math.abs(Date.now() / 1000 - t) > tolerance) return false;
const expected = crypto.createHmac("sha256", secret).update(`${t}.${raw}`).digest("hex");
return sigs.some((s) => s.length === expected.length && crypto.timingSafeEqual(Buffer.from(s), Buffer.from(expected)));
}