Use caseUpdated
Social media webhooks API: signed, retried and resendable
A social media webhook tells your server what happened to a post without polling. Siar, a unified social media API, signs every delivery with HMAC-SHA256 and sends post.published when a post has published or failed, with each network's result. If your server is down, Siar retries 7 times over about 45 hours.
- 16 event types across posts, comments, brands, accounts, X credit and conversations.
- HMAC-SHA256 over
timestamp.rawBody, in thex-siar-signatureheader. - Failed deliveries are retried 7 times over about 45 hours: 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours.
- A delivery log per endpoint: inspect, resend, send a test, rotate the secret.
The retry schedule
A 2xx response within 15 seconds means delivered. Anything else, a timeout or a redirect schedules the next attempt. After the last one the delivery is marked failed and stays in the log.
| Attempt | Sent | Time since the first try |
|---|---|---|
| 1 | When the event happens | 0 |
| 2 | 1 minute after attempt 1 | 1 min |
| 3 | 5 minutes after attempt 2 | 6 min |
| 4 | 30 minutes after attempt 3 | 36 min |
| 5 | 2 hours after attempt 4 | 2 h 36 min |
| 6 | 6 hours after attempt 5 | 8 h 36 min |
| 7 | 12 hours after attempt 6 | 20 h 36 min |
| 8 | 24 hours after attempt 7 | 44 h 36 min |
That is 7 retries over 44 h 36 min, about 45 hours. Events can arrive out of order and more than once, so deduplicate on the event id.
Verify the signature
Each delivery carries x-siar-event, x-siar-delivery, x-siar-timestamp and x-siar-signature. The signature is a hex HMAC-SHA256 of timestamp + "." + rawBody with your endpoint's secret.
Compute it over the raw body exactly as received, compare in constant time, and reject timestamps far from now to stop replays. The webhook guide also has a Python verifier.
import { createHmac, timingSafeEqual } from 'node:crypto';
// Use the raw request body exactly as received, before any JSON parsing.
export function verifySiarWebhook(rawBody, headers, secret, toleranceSeconds = 300) {
const timestamp = headers['x-siar-timestamp'];
const signature = headers['x-siar-signature'];
if (!timestamp || !signature) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSeconds) return false;
const expected = createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
const a = Buffer.from(expected, 'hex');
const b = Buffer.from(String(signature), 'hex');
return a.length === b.length && timingSafeEqual(a, b);
}
// Express example: keep the raw body for this route.
app.post('/webhooks/siar', express.raw({ type: 'application/json' }), (req, res) => {
const raw = req.body.toString('utf8');
if (!verifySiarWebhook(raw, req.headers, process.env.SIAR_WEBHOOK_SECRET)) return res.sendStatus(401);
const event = JSON.parse(raw);
// Deduplicate on the x-siar-delivery header or event.id, then handle event.type.
res.sendStatus(200);
}); What you get when a post fails
post.published fires when a post reaches its final state: published, or failed on one or more networks. It fires again after a retry settles. The payload is the post with each network's result.
For each network that failed you get the network's own code and message, a plain-English fix and a verdict: retry, don't retry, or unknown. The other networks still publish, so your handler can tell the user exactly which network said no and why.
// post.published for a post where one network said no (fields trimmed)
{
"id": "evt_...",
"type": "post.published",
"data": {
"id": "POST_ID",
"status": "ERROR",
"errors": { "MASTODON": "<a plain-English fix>" },
"errorsVerbose": {
"MASTODON": {
"code": "PERMISSION",
"errorMessage": "<the network's own message>",
"httpStatus": 403,
"retryability": "non_retryable",
"userFacingMessage": "<a plain-English fix>"
}
}
}
} Inspect and resend
Every delivery is logged with its status, response code and the start of the response body. Organization owners and admins can resend any delivery, send a test event and rotate the secret from the dashboard. API keys cannot change webhooks.
A resend is a new delivery of the same event, with a new x-siar-delivery id and the same event id.
Create an endpoint
Up to 5 endpoints per organization, each subscribed to the events it needs. The signing secret is shown once, when you create the endpoint.
# Webhooks are managed by organization owners and admins from the dashboard.
# API keys cannot create or change them. The underlying request is:
POST https://api.siaran.my/api/v1/webhook
{
"url": "https://yourapp.example/webhooks/siar",
"events": ["post.published", "comment.received", "social-account.updated"]
}
# → { "id": "...", "url": "...", "events": [...], "active": true, "secret": "..." }
# The secret is returned once. It signs every delivery. Events
16 event types. Conversation events need the DM beta.
| Event | When it fires |
|---|---|
post.published | A post reached a final state: published, or failed on one or more networks. Carries each network's result. Sent once per post, and again after a retry settles. |
comment.published | A comment or reply you created through Siar was published (or failed). |
team.created | A team was created. |
team.updated | A team was renamed or its settings changed. |
team.deleted | A team was deleted. |
social-account.created | An account was connected to a team. |
social-account.updated | An account changed: channel picked, profile refreshed, or it needs reconnecting. |
social-account.deleted | An account was disconnected. |
credit.low-balance | The X credit balance fell below the threshold you set. |
credit.exhausted | The X credit balance reached zero. X actions stop until you top up; other networks keep publishing. |
comment.received | Someone commented on a post, and Siar picked it up from the network. |
conversation.created | A new direct-message conversation started. (DM beta) |
conversation.updated | A conversation was archived, reopened or otherwise changed. (DM beta) |
conversation.message.created | A message was sent or received in a conversation. (DM beta) |
conversation.message.updated | A message changed (reaction, edit, delivery state). (DM beta) |
conversation.read.updated | The read state of a conversation changed. (DM beta) |
What this doesn't cover yet
- Up to 5 endpoints per organization.
- Only owners and admins manage webhooks, from the dashboard. API keys cannot.
- Events can arrive out of order and more than once.
Keep reading
Frequently asked questions
What is a social media webhooks API?
It sends your server an HTTPS request when something happens on a social account, so you don't poll. Siar signs each delivery, sends post.published with each network's result, and retries failed deliveries.
What if my endpoint is down?
Siar retries after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours, about 45 hours in all, then marks the delivery failed. Owners and admins can resend it from the delivery log.
How do I verify a delivery?
Compute a hex HMAC-SHA256 of the timestamp, a dot and the raw body with your endpoint's secret, and compare it in constant time with x-siar-signature. Reject old timestamps.
Which events exist?
post.published, comment.published, team.created, team.updated, team.deleted, social-account.created, social-account.updated, social-account.deleted, credit.low-balance, credit.exhausted, comment.received, conversation.created, conversation.updated, conversation.message.created, conversation.message.updated, conversation.read.updated.
Can I test without publishing a real post?
Yes. Send a test event to your endpoint from the dashboard. It is signed like any other delivery.
Write it once. Siar it everywhere.
Pick a use case, send one request, and see what happened on each network. 20 free posts to try, no card.