Webhooks

Know the moment anything happens.

A comment on Instagram, a WhatsApp message, a new App Store review, a post going live: your endpoint gets one signed POST, in the same shape the API returns. If your server is down, we keep trying.

Live deliveries · click one

POSThttps://zaynstack.com/api/hooks/social

X-SocialHub-Event
comment.received
X-SocialHub-Delivery
d0e3a17f5c-0b8d-4c26-97e4
X-SocialHub-Timestamp
1795210000
X-SocialHub-Signature-V2
sha256=1f8c6d2a90e4b7a30…
{
  "event": "comment.received",
  "data": {
    "platform": "instagram",
    "account_id": "ig_zaynstack",
    "post": "Drift launch reel",
    "author": {
      "name": "ayesha.mum"
    },
    "text": "Does it notice when the baby wakes up? 🥺"
  }
}

200 OK42 ms

01 · Verify the signature

Reject anything we did not send

Each endpoint has its own secret (shown once when you create it, and on rotation). Compute HMAC-SHA256 of <timestamp>.<raw body> and compare it with the header in constant time. Use the raw bytes: parsing and re-serialising the JSON changes the signature.

Node.js

import crypto from "node:crypto";

export function verify(req, rawBody, secret) {
  const ts = req.headers["x-socialhub-timestamp"];
  const sig = req.headers["x-socialhub-signature-v2"];      // "sha256=<hex>"
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // replay guard
  const expected = "sha256=" + crypto
    .createHmac("sha256", secret).update(`${ts}.${rawBody}`).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
}

Python

import hmac, hashlib, time

def verify(headers, raw_body: bytes, secret: str) -> bool:
    ts = headers["X-SocialHub-Timestamp"]
    sig = headers["X-SocialHub-Signature-V2"]                 # "sha256=<hex>"
    if abs(time.time() - int(ts)) > 300:                       # replay guard
        return False
    mac = hmac.new(secret.encode(), f"{ts}.".encode() + raw_body, hashlib.sha256)
    return hmac.compare_digest(sig, "sha256=" + mac.hexdigest())
X-SocialHub-Event
The event name, e.g. comment.received
X-SocialHub-Delivery
Same id on every retry: use it to ignore duplicates
X-SocialHub-Timestamp
Unix seconds when this attempt was signed
X-SocialHub-Signature-V2
sha256=<hex HMAC of timestamp.body>
X-SocialHub-Signature
sha256=<hex HMAC of the body alone>: older, no freshness check, prefer V2

02 · Retries

Down for a deploy? You will not miss it.

Answer with any 2xx within 10 seconds. If we cannot connect, or you answer 429 or a 5xx other than 501, we send it once more two seconds later, with the same delivery id. If that fails too, another attempt is scheduled. Every attempt is logged with its status and response body, and you can resend any delivery from the dashboard or POST /v1/webhooks/{id}/deliveries/{delivery}/retry.

  1. attempt 1 · now
  2. →#2 · +10 s
  3. →#3 · +1 min
  4. →#4 · +5 min
  5. →#5 · +15 min
  6. →#6 · +30 min
  7. →#7 · +1 h
  8. →#8 · +2 h
  9. →#9 · +4 h
  10. →#10 · +6 h

Waits vary by ±10% so a recovering server is not hit by every retry at once. After the last attempt the delivery is marked failed and a webhook.delivery_failed entry appears in Logs.

03 · Events

25 events, one envelope

Subscribe an endpoint to the events you need, or to all of them. GET /v1/webhooks/events returns this list. Payloads, and which platforms send each event, are in the webhook events reference.

posts

  • post.scheduledA post was scheduled
  • post.publishedA post reached every target
  • post.failedA post failed on every target
  • post.partialA post reached some targets and failed on others
  • post.updatedA post was edited (before publishing, or its live text after)
  • post.deletedA post was deleted
  • post.unpublishedA published post was removed from a platform
  • post.retriedA failed post was retried

inbox

  • comment.receivedA new comment arrived on a post
  • dm.receivedA direct message arrived
  • dm.sentA direct message was sent from the account
  • dm.referralSomeone opened a conversation from an ad or link
  • dm.postbackSomeone tapped a button in a message
  • dm.deletedA message was deleted by its sender
  • dm.status.sentA sent message was accepted by the platform
  • dm.status.deliveredA sent message was delivered
  • dm.status.readA sent message was read
  • dm.status.failedA sent message failed
  • review.receivedA new review arrived
  • review.updatedA review was edited
  • mention.receivedThe account was mentioned or tagged

accounts

  • account.connectedAn account was connected
  • account.disconnectedThe platform ended access to an account (not sent when you disconnect it yourself)
  • account.updatedAn account's status or details changed
  • page.removedA Page is no longer available to its login
  • WhatsApp sends dm.status.* for every message you send, with the error code and text when one fails. Facebook and Instagram send delivered and read receipts.
  • Button taps on Instagram and Facebook arrive as dm.postback; on WhatsApp as dm.received with the tap's payload.
  • Replies typed in the Instagram or Messenger app arrive as dm.sent; a message the sender unsends on Instagram as dm.deleted.
  • account.disconnected means the platform cut access. Disconnecting an account yourself sends no event.
  • App Store reviews send no events: list them instead.

Free to start

Your next post can go everywhere at once.

No card. Connect a profile, send a post, see it land.