Skip to content
techrace/
TECHRACE DOCUMENTATION

Webhooks and events

Techrace calls your HTTPS endpoint when something happens: an account connects or disconnects, a post finishes, a new comment arrives.

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
Response
JSON
{
  "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

EventSent when
account.connectedA customer connected (or reconnected) an account
account.disconnectedAn account was disconnected, its token expired or access was revoked
connection.authorization_revokedThe person removed your app's access on the platform
execution.queuedA post was accepted
execution.succeededA post was published
execution.failedA post failed
execution.ambiguousThe platform may or may not have published (check before retrying)
execution.cancelledA scheduled post was cancelled
inbox.changedNew or changed comments or messages
inbox.acknowledged, email.acknowledged, ads.acknowledgedA queued inbox, mail or ad action finished
customer.deletedA profile and its data were deleted

Subscribe to all events (*) or pick some. You can also limit an endpoint to specific profiles.

Payload

account.connected
JSON
{
  "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

HeaderValue
Webhook-IdEvent ID; use it to ignore duplicates
Webhook-TimestampUnix seconds when it was sent
Webhook-Signaturev1=<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.