MySocials

Webhooks

Events, HMAC signatures, and delivery health.

Webhooks

MySocials POSTs signed JSON to your endpoints when real events happen. Manage them under Developer → Webhooks.

Events

  • post.published — a post landed on a platform
  • post.failed — a post failed on a platform
  • post.approved — a pending post was approved
  • post.rejected — a pending post was rejected
  • post.evergreen_recycled — an evergreen rule recycled a post
  • account.disconnected — a connected account disconnected

Signatures

Deliveries are signed with HMAC-SHA256 using a per-endpoint secret, shown once at registration. The signature travels in the X-Webhook-Signature header as sha256=<hex> and is computed over the raw request body, exactly as sent. Always verify before acting, and treat the sent_at field inside the signed body as a replay window:

python
import hmac, hashlib, json
from datetime import datetime, timezone, timedelta

raw = request.body                                       # raw bytes, before JSON parsing
sent = request.headers["X-Webhook-Signature"]            # "sha256=<hex>"
mac = "sha256=" + hmac.new(secret.encode(), raw, hashlib.sha256).hexdigest()
if not hmac.compare_digest(sent, mac):                   # constant-time comparison
    abort(401)

event = json.loads(raw)
age = datetime.now(timezone.utc) - datetime.fromisoformat(event["sent_at"])
if age > timedelta(minutes=5):                           # stale = possible replay
    abort(401)

Headers on every delivery: X-Webhook-Signature, X-Webhook-Event (the event name), X-Webhook-Delivery-Id (unique per attempt; use it to dedupe the one automatic retry, which also carries X-Webhook-Retry: 1).

Reliability

Each endpoint shows its last delivery status, response snippet, and consecutive-failure count (three or more failures flags attention; you can rotate the secret or send a test delivery from the UI).