Webhooks
Webhooks deliver real-time HTTP POST notifications when background asynchronous tasks complete, such as successful post publishing, failures, or reply dispatches.
📌 Endpoints
Section titled “📌 Endpoints”| Method | Path | Description | Required Scope |
|---|---|---|---|
POST | /v1/brand/webhooks/subscriptions | Register a new webhook endpoint | webhooks:write or * |
GET | /v1/brand/webhooks/subscriptions | List registered webhook subscriptions | webhooks:read or * |
DELETE | /v1/brand/webhooks/subscriptions/{id} | Delete a webhook subscription | webhooks:write or * |
🔔 Supported Event Types
Section titled “🔔 Supported Event Types”| Event Name | Trigger Condition |
|---|---|
sns.publish.succeeded | Post successfully published to the target social network |
sns.publish.failed | Post publishing failed (includes error code and retry eligibility) |
sns.publish.blocked_entitlement | Publishing blocked due to quota limits or expired plan |
sns.reply.succeeded | Reply comment successfully posted |
sns.reply.failed | Reply comment dispatch failed |
sns.provider.notification_received | Real-time webhook received from external SNS provider |
📦 Webhook Payload Example (sns.publish.succeeded)
Section titled “📦 Webhook Payload Example (sns.publish.succeeded)”{ "event_id": "evt_01jm8za2example", "event_type": "sns.publish.succeeded", "schema_version": 1, "occurred_at": "2026-08-16T03:30:00Z", "producer": "ankk.sns", "brand_ref": "brand_01jm8v4k9example", "idempotency_key": "launch-2026-001", "trace_id": "trc_9a8b7c6d", "data": { "content_id": "content_01jm8za2example", "publish_job_id": "job_01jm8za2jobexample", "sns_type": "instagram", "connection_id": "conn_01jm8x9k2example", "provider_post_id": "18029384756102938", "permalink": "https://www.instagram.com/p/C-example/" }}🔐 Signature Verification (HMAC SHA256)
Section titled “🔐 Signature Verification (HMAC SHA256)”Webhook requests include custom verification headers:
Social-Webhook-Signature: Signature payload (t=1723780000,v1=hex_signature)Social-Webhook-Timestamp: Unix timestamp in secondsSocial-Webhook-Id: Event identifier
Node.js (Crypto) Verification
Section titled “Node.js (Crypto) Verification”import crypto from 'node:crypto';
export function verifyWebhookSignature( rawBody: string, signatureHeader: string, timestampHeader: string, secret: string): boolean { const signedPayload = `${timestampHeader}.${rawBody}`; const expectedSignature = crypto .createHmac('sha256', secret) .update(signedPayload) .digest('hex');
return crypto.timingSafeEqual( Buffer.from(signatureHeader), Buffer.from(expectedSignature) );}Python (hmac) Verification
Section titled “Python (hmac) Verification”import hmacimport hashlib
def verify_webhook_signature(raw_body: bytes, signature: str, timestamp: str, secret: str) -> bool: signed_payload = f"{timestamp}.".encode('utf-8') + raw_body expected = hmac.new(secret.encode('utf-8'), signed_payload, hashlib.sha256).hexdigest() return hmac.compare_digest(signature, expected)[!CAUTION] Signature verification must use the unparsed raw request body.