Add an endpoint
Add an endpoint in the console (Developers → Webhooks) or with the API. The signing secret is returned once: store it to verify deliveries.
curl -X POST "https://YOUR_DOMAIN/api/v1/projects/$TECHRACE_PROJECT_ID/webhooks" \
-H "Authorization: Bearer $TECHRACE_API_KEY" \
-H "Content-Type: application/json" \
--data @- <<EOF
{
"url": "https://your-app.com/webhooks/techrace",
"name": "Production backend",
"event_types": [
"account.connected",
"account.disconnected"
],
"customer_ids": null
}
EOF{
"endpoint": {
"id": "5d8b1e3f-2a6c-4b97-8e10-9c4f7a2d1b65",
"url": "https://your-app.com/webhooks/techrace",
"enabled": true,
"created_at": "2026-11-14T10:00:00.000Z",
"name": "Production backend"
},
"signing_secret": "…shown once, store it securely…"
}Event types
| Event | Sent when |
|---|---|
account.connected | A customer connected (or reconnected) an account |
account.disconnected | An account was disconnected, its token expired or access was revoked |
connection.authorization_revoked | The person removed your app's access on the platform |
execution.queued | A post was accepted |
execution.succeeded | A post was published |
execution.failed | A post failed |
execution.ambiguous | The platform may or may not have published (check before retrying) |
execution.cancelled | A scheduled post was cancelled |
inbox.changed | New or changed comments or messages |
inbox.acknowledged, email.acknowledged, ads.acknowledged | A queued inbox, mail or ad action finished |
customer.deleted | A profile and its data were deleted |
Subscribe to all events (*) or pick some. You can also limit an endpoint to specific profiles.
Payload
{
"id": "a3c9e1f4-7b2d-4e60-9f18-2d5c8b7a0e13",
"project_id": "$PROJECT_ID",
"customer_id": "8f1c2a4e-6b3d-4e21-9a77-1d0c5b2e9f10",
"type": "account.connected",
"created_at": "2026-11-14T10:00:00.000Z",
"data": {
"customer_id": "8f1c2a4e-6b3d-4e21-9a77-1d0c5b2e9f10",
"customer_external_id": "user_1234",
"connection_id": "3b7e9d12-5c4a-4f8e-8b21-6a0d2c9e7f34",
"provider": "facebook",
"reconnected": false
}
}account.disconnected has the same data plus status and reason (user_disconnected, token_expired, authorization_revoked …).
Verify the signature
| Header | Value |
|---|---|
Webhook-Id | Event ID; use it to ignore duplicates |
Webhook-Timestamp | Unix seconds when it was sent |
Webhook-Signature | v1=<signature>; during a secret rotation two values separated by a space |
The signature is HMAC-SHA256 of {Webhook-Id}.{Webhook-Timestamp}.{raw body} with your secret, base64url-encoded without padding. Reject timestamps older than 5 minutes.
import crypto from "node:crypto";
export function verify(rawBody, headers, secret) {
const id = headers["webhook-id"];
const ts = headers["webhook-timestamp"];
const sigs = String(headers["webhook-signature"] || "").split(" ");
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const expected = crypto
.createHmac("sha256", secret)
.update(`${id}.${ts}.${rawBody}`)
.digest("base64url");
return sigs.some((s) => {
const got = Buffer.from(s.replace(/^v1=/, ""));
const want = Buffer.from(expected);
return got.length === want.length && crypto.timingSafeEqual(got, want);
});
}Responding and retries
- Reply with any 2xx status within 8 seconds; do slow work afterwards.
- Other statuses, timeouts and redirects count as failures and are retried with growing waits (from about 30 seconds up to 6 hours) until the attempt limit is reached.
- Deliveries can arrive more than once or out of order: de-duplicate on Webhook-Id.
- See each attempt in the console (Webhooks → Delivery log) and send a test event with POST /webhooks/{endpoint_id}/test.