OmniSocialsOmniSocials
DocumentationAPI reference
Help centerSupport
  • Documentation
  • API reference
Developers
  • Quickstart
  • API reference
  • SDKs
  • MCP server
  • CLI
For AI agents
  • Docs for AI agents
  • llms.txt
  • OpenAPI spec
  • Postman collection
Product
  • OmniSocials
  • Pricing
  • Changelog
  • Help center
Company
  • Support
  • Privacy policy
  • Terms of service

© 2026 OmniSocials

OmniSocials on GitHubOmniSocials on XOmniSocials on LinkedIn
Overview
Get started
SDKs
CLI
MCPDocs for AI agentsWebhooks
Guides
Platforms
Integrations
Connect
Migrate
Plans and billing
GlossaryChangelogAPI reference
Documentation

Webhooks for post events

Subscribe to events to get real-time notifications when posts are published, scheduled, or fail, and when a reviewer approves or rejects a post in an approval workflow. Webhooks are the right choice when you want to know about state changes without polling the API.

Event catalog

EventWhen it firesdata.statusMain payload fields
post.scheduledA post is created or updated into the scheduled state through the API (POST /posts/create or PATCH /posts/:id). Not sent for posts scheduled in the dashboard, or for a post that waits for approvalscheduledscheduled_at. targets is empty and published_at is null
post.publishedA publish run ends with at least one channel live. Sent again after every retry run, manual or automaticposted, or warning when some channels failedpublished_at, and targets[] with platform, status, native_post_id, and error on a failed channel
post.failedA publish run ends with no channel live. An automatic retry can still followfailedtargets[] with platform, status and error
post.approvedThe last step of a post's approval workflow approves itscheduled, or posting when the publish time has passedapproval with status, decided_by and reason (null). targets is empty
post.rejectedAn approver rejects the post. It will not publishrejectedapproval with status, decided_by and the reason. targets is empty
x_statistics.pausedThe organisation's credits ran out, so its X statistics stopped. Posts still go out. One event per workspace with Xnoneworkspace_id, account_id, reason (insufficient_credits): see X statistics events
x_statistics.resumedCredits came in and X statistics run againnoneworkspace_id, account_id, reason (credits_added)

Every event uses the same envelope: id (the same value as the X-OmniSocials-Delivery header), type, created_at, and data. For the post events data holds post_id, workspace_id, status, post_type (Post, Story or Reel), scheduled_at, published_at and targets. data.status is the stored status, so a published post reads posted, not published.

One post can send several events, for example post.failed and later post.published when a retry succeeds. Keep your state per data.post_id; see Retries and duplicate posts.

Creating a webhook

TerminalTerminal
curl -X POST https://api.omnisocials.com/v1/webhooks \ -H "Authorization: Bearer $OMNISOCIALS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.com/webhooks/omnisocials", "events": ["post.published", "post.failed"] }'

Response:

JSON
{ "data": { "id": "5f3b0c1e-9a2d-4e77-b1c4-8a2f6d9e0b12", "workspace_id": 456, "url": "https://your-app.com/webhooks/omnisocials", "events": ["post.published", "post.failed"], "is_active": true, "created_at": "2026-04-10T14:22:00Z", "secret": "a1b2c3d4e5f6...c7d8e9f0" }, "message": "Webhook created. Save the secret - it will only be shown once." }

The id is a UUID and the secret is a 64-character hex string returned exactly once on creation. Store the secret. You will need it to verify incoming webhook signatures.

An organisation can have at most 100 webhooks, counted over all its workspaces, the organisation-wide ones and the switched-off ones. At that limit a create answers 409 webhook_limit_reached and nothing is made: delete a webhook you no longer use, or add the events to a webhook you have.

Available events

Subscribe to any of the seven events in the Event catalog: the five post events and the two X statistics events. These are the only seven valid events. Creating or updating a webhook with any other value (including a "*" wildcard) returns 400. There is no Social Inbox event (a new DM, comment, or mention) yet. Poll GET /inbox/conversations instead.

Partial publishes fire post.published, not a separate event. When a post succeeds on some platforms and fails on others, the payload's data.status is "warning" and the per-platform outcomes are in data.targets (each with its own status). Inspect targets to see exactly which platforms succeeded or failed.

Payload shape

JSON
{ "id": "8c1e0a2b-4d5f-4a67-9b0c-1d2e3f4a5b6c", "type": "post.published", "created_at": "2026-04-10T14:22:00Z", "data": { "post_id": "123", "workspace_id": 456, "status": "posted", "post_type": "Post", "scheduled_at": "2026-04-10T14:20:00Z", "published_at": "2026-04-10T14:22:00Z", "targets": [ { "platform": "instagram", "status": "success", "native_post_id": "18023456789012345" }, { "platform": "linkedin", "status": "failed", "native_post_id": null, "error": "The LinkedIn token has expired. Reconnect the account." } ] } }

data.targets holds one entry per selected platform. native_post_id is the platform's own post ID (present when that platform succeeded); error appears only on a non-successful target. data.status is the overall post status (posted, warning for a partial success, or failed). Always branch on the top-level type before accessing data.

post.scheduled, post.approved and post.rejected are delivered before anything is published, so their data.targets array is empty and published_at is null.

Approval events

post.approved and post.rejected use the same envelope and carry one more object, data.approval, that says how the review ended:

JSON
{ "id": "e7c9a1b2-3d4e-5f6a-7b8c-9d0e1f2a3b4c", "type": "post.rejected", "created_at": "2026-10-02T09:00:05.000Z", "data": { "post_id": "123456", "workspace_id": 789, "status": "rejected", "post_type": "Post", "scheduled_at": "2026-10-03T14:00:00.000Z", "published_at": null, "targets": [], "approval": { "status": "rejected", "decided_by": "c4a09e1d-7b52-4f38-a6d1-3e9f8b2c5d60", "reason": "Wrong product photo" } } }
FieldValue
data.approval.statusapproved or rejected
data.approval.decided_byUser id of the approver who gave the last approval, or who rejected the post
data.approval.reasonThe reason the approver gave with a rejection. null on post.approved and when the approver gave no reason

On post.approved, data.status is scheduled, or posting when the publish time has already passed. On post.rejected it is rejected. post.approved fires once, when the last step is approved; an approval of an earlier step sends no event.

The payload names the outcome only. For every step, every approver and the comment thread, call GET /posts/:id/approval with the post_id from the event.

X statistics events

x_statistics.paused and x_statistics.resumed describe an X account, not a post. data holds workspace_id, account_id (the X account's id, as in GET /accounts) and reason:

JSON
{ "id": "3c0f9a51-7d2e-4b8a-9e1f-5a6b7c8d9e0f", "type": "x_statistics.paused", "created_at": "2027-02-14T06:00:12.000Z", "data": { "workspace_id": 456, "account_id": "456_x", "reason": "insufficient_credits" } }

The pause covers the whole organisation, so an organisation with several X workspaces sends one event per workspace. They need no extra scope. What pauses and what keeps working is in When credits run out.

Verifying signatures

Every outbound webhook call is signed with HMAC-SHA256 using your webhook's secret. Each delivery carries these headers:

HeaderValue
X-OmniSocials-Signaturet=<unix_timestamp>,v1=<hex_signature>
X-OmniSocials-Signature-PreviousOnly in the 24 hours after a secret rotation: the same format, signed with the previous secret
X-OmniSocials-TimestampThe same unix timestamp, on its own
X-OmniSocials-EventThe event type (e.g. post.published)
X-OmniSocials-Webhook-IdThe webhook's ID
X-OmniSocials-DeliveryA unique ID per event, stable across retry attempts. Use it to deduplicate.

The signature is computed over `${timestamp}.${rawBody}` (the timestamp, a literal dot, then the raw JSON body), the same scheme Stripe uses. To verify: parse t and v1 out of the header, recompute the HMAC over timestamp.rawBody, and compare against v1. A mismatch means the request is not from OmniSocials. Reject it.

JavaScript
import crypto from 'crypto' function verifyWebhook(rawBody, signatureHeader, secret) { // signatureHeader looks like "t=1744294920,v1=abc123..." const parts = Object.fromEntries( signatureHeader.split(',').map((kv) => kv.split('=')) ) const { t: timestamp, v1: signature } = parts if (!timestamp || !signature) return false const expected = crypto .createHmac('sha256', secret) .update(`${timestamp}.${rawBody}`, 'utf8') .digest('hex') // timingSafeEqual throws when lengths differ, so check first const sigBuf = Buffer.from(signature) const expBuf = Buffer.from(expected) if (sigBuf.length !== expBuf.length) return false return crypto.timingSafeEqual(sigBuf, expBuf) }

Verify against the raw request body, before any JSON parsing or reserialization. Always compare with a constant-time function like timingSafeEqual. Optionally, reject deliveries whose t timestamp is more than a few minutes old to guard against replay. Keep that window at 5 minutes or more: the timestamp is set when the event is created and reused on retries, so a retried delivery arrives with the original timestamp.

Delivery and retries

  • Respond with any 2xx within 10 seconds. That counts as delivered. Anything else (including a timeout after 10 seconds) counts as a failure. The whole answer must also arrive within 15 seconds in total and be at most 1 MB: a slower or larger answer counts as a failed attempt (last_failure.error says which). Do your processing after you respond, not before, and keep the answer short.
  • Failed deliveries retry twice: the first retry after 2 seconds, the second after 5 more. Only 5xx, 429, and network errors are retried; any other 4xx fails immediately without a retry.
  • Delivery is at-least-once. If your endpoint processed the event but the response timed out, the retry delivers a duplicate. Deduplicate on X-OmniSocials-Delivery; it stays the same across retries of one event.
  • Ordering is not guaranteed. Deliveries fire asynchronously and concurrently; a retrying delivery can arrive after a newer event. Order on the payload's created_at.
  • After the final failed attempt the event is dropped. It is not re-sent later, and there is no replay endpoint. The webhook records the failure: failure_count increments and last_failure (time, status, error) is stored; read both via GET /webhooks/:id. Failed deliveries never switch a webhook off, so a recovered endpoint receives the next event normally. Reconcile missed events by polling GET /posts?status=.
  • A webhook stops when the person who set it up loses access. Before each delivery OmniSocials checks that the person who created the webhook (or last changed its URL or events, or switched it on) still belongs to the organisation, and to the workspace for a workspace webhook. An organisation-wide webhook (workspace_id: null) sends the events of every workspace, so its person must also still hold Manage API keys (manage_api) in the organisation. When they no longer do, the event is not sent, the webhook is switched off (is_active: false) and last_failure.error says why. Someone with API access switches it on again with PATCH /webhooks/:id and "is_active": true, and from then on the check uses that person. Webhooks created before this check existed have no recorded creator and are not checked.
  • A webhook stops when its API key or app loses access. A webhook made through the API (or whose URL or events were last changed, or which was last switched on, through the API) belongs to the API key or the OAuth-connected app of that call. When the key is revoked, deleted or expired, or the person disconnects the app, the webhook is switched off the same way and last_failure.error says why. Revoking the key or disconnecting the app in OmniSocials switches it off at once. Switch it on again with an active key or a connected app; it then belongs to that key or app. This applies from 2026-11-26 on: webhooks whose key was already revoked, deleted or expired before that date keep working, and so do webhooks made with an app before that date. Webhooks made in the OmniSocials dashboard are not affected.
  • Requests come with User-Agent: OmniSocials-Webhooks/1.0 and follow no redirects: a 3xx answer counts as a failed delivery and is not retried. Register the final https URL of your endpoint.
  • Deliveries of one organisation go out at most 10 at a time, so at a busy moment a delivery can wait in line behind the others.

Local testing. Webhook URLs must be publicly reachable. For local development, expose your dev server with a tunnel (for example cloudflared tunnel or ngrok http 3000) and register the tunnel URL as the webhook.

Managing webhooks

All webhook endpoints require the webhooks:manage scope on your API key.

EndpointDescription
GET /webhooksList the webhooks of this key's workspace and the organisation-wide webhooks
GET /webhooks/:idGet a single webhook
PATCH /webhooks/:idUpdate URL, events, or is_active (re-enabling resets failure_count)
DELETE /webhooks/:idDelete a webhook
POST /webhooks/:id/rotate-secretRotate the signing secret

A webhook created through the API belongs to the key's workspace. A webhook created in the OmniSocials dashboard (Settings, API) is organisation-wide: it receives the events of every workspace in the organisation and shows "workspace_id": null. The API lists, reads, changes, deletes and rotates organisation-wide webhooks too, for a key whose creator may manage the API in that organisation. A url set through the API (or the MCP server) on an organisation-wide webhook, even its current one, moves it to the key's workspace: from then on it receives only that workspace's events, and the answer shows the new workspace_id. Changing events or switching it on keeps it organisation-wide. To have an organisation-wide webhook at a new URL, create it again in the dashboard.

Rotating the secret

POST /webhooks/:id/rotate-secret returns a new secret once. The old secret keeps signing for 24 hours: during that time every delivery carries X-OmniSocials-Signature (new secret) and X-OmniSocials-Signature-Previous (old secret), both over the same timestamp and body. Your endpoint keeps accepting deliveries while you deploy the new secret. To verify in that window, check X-OmniSocials-Signature with the new secret and, while you still have the old one configured, X-OmniSocials-Signature-Previous with the old secret; accept the delivery when either matches. After 24 hours only the new secret signs. Rotating again within the 24 hours replaces the previous secret with the one you just rotated out.

With the verifyWebhook function from Verifying signatures:

JavaScript
// NEW_SECRET from rotate-secret; OLD_SECRET only until you removed it. const current = req.headers['x-omnisocials-signature'] const previous = req.headers['x-omnisocials-signature-previous'] const ok = verifyWebhook(rawBody, current, NEW_SECRET) || Boolean(previous && OLD_SECRET && verifyWebhook(rawBody, previous, OLD_SECRET))

The SDK helpers work the same way: call them with the X-OmniSocials-Signature-Previous value and the old secret when the first check fails.

Last modified on December 2, 2026
Docs for AI agentsPosts
On this page
  • Event catalog
  • Creating a webhook
  • Available events
  • Payload shape
    • Approval events
    • X statistics events
  • Verifying signatures
  • Delivery and retries
  • Managing webhooks
    • Rotating the secret
JSON
JSON
JSON
JSON
Javascript
Javascript