Skip to content
SociaMesh

Webhooks

Signed events when posts, accounts and comments change.

POST /v1/webhooks with { url, eventTypes }. The answer includes the signing secret, shown once.

Events

post.scheduled, post.approval_required, post.publishing, post.published, post.partial, post.failed, post.cancelled, account.connected, account.disconnected, account.reauthorization_required, analytics.updated, comment.received, message.received, quota.warning. POST /v1/webhooks/{id}/test sends a webhook.test.

Verify the signature

Every delivery has X-SociaMesh-Event-Id, X-SociaMesh-Event-Type and

X-SociaMesh-Signature: t=1793000000,v1=<hex HMAC-SHA256(secret, t + "." + rawBody)>

Compute the HMAC over the raw body, compare in constant time, and reject timestamps more than five minutes old. During a secret rotation a delivery carries a v1 for each secret; accept either.

import { verifyWebhookSignature } from "@sociamesh/sdk";

const result = await verifyWebhookSignature(secret, req.headers["x-sociamesh-signature"], rawBody);
if (!result.ok) return res.status(400).end();

Delivery

Answer with any 2xx within 10 seconds. A delivery gets up to five attempts with exponential backoff; redirects aren't followed. Use X-SociaMesh-Event-Id to ignore duplicates. Deliveries are listed per webhook in the console and through the API, and you can replay any of them.