Tutorials

How Social Media Webhooks Tell You When a Post Publishes, Fails or Gets a Comment

Taras Shynkarenko
•Updated: •5 min read
How Social Media Webhooks Tell You When a Post Publishes, Fails or Gets a CommentHow Social Media Webhooks Tell You When a Post Publishes, Fails or Gets a Comment

TL;DR, Quick Answer

5 min read

AdaptlyPost sends signed webhooks for 13 events across 14 social networks: post.published, post.partially_failed, post.failed, post.scheduled, post.manual_due, account.unauthorized, image.completed, image.failed, and the inbox events comment.created, comment.replied, mention.created, message.received and review.created. Add a webhook on the API Tokens page, through the API, the CLI or the SDK. Each delivery is a JSON POST with x-adaptly-signature (sha256= plus an HMAC-SHA256 of timestamp.body with your whsec_ secret), x-adaptly-timestamp, x-adaptly-event and x-adaptly-webhook-id headers. AdaptlyPost tries 5 times, disables an endpoint that answers 410 or keeps failing for 3 days, and allows 10 webhooks per workspace.

AdaptlyPost sends social media webhooks to your server the moment something happens on a connected account: a post publishes or fails, an account's connection expires, or a comment, mention, message or review arrives. One endpoint covers all 14 networks, and every delivery is signed so you can trust it.

Polling is the thing webhooks replace. Publishing is asynchronous on every network that matters, and Instagram can take a minute to process a Reel. A script that checks GET /social-posts/{id}/results every few seconds works, until you have a few hundred scheduled posts and a rate limit. A webhook tells you once, when it's true.

The short version: open API Tokens in AdaptlyPost, choose the Webhooks tab, add your HTTPS URL, copy the signing secret, and verify x-adaptly-signature on every request.

Which events can a webhook receive?

An AdaptlyPost webhook can receive 13 events, grouped into posts, accounts, AI images and the inbox. A new webhook gets the default set of 7; the manual-post and inbox events arrive only when you name them.

EventWhen it firesDefault
post.publishedEvery network published the postYes
post.partially_failedSome networks published, some refusedYes
post.failedNo network published the postYes
post.scheduledA post was scheduledYes
account.unauthorizedA connected account needs reconnectingYes
image.completedAn AI image finishedYes
image.failedAn AI image failedYes
post.manual_dueChannels you publish by hand are due, with the post and media URLsNo
comment.createdA new comment on a connected accountNo
comment.repliedSomeone replied to a comment, with the parent comment's idNo
mention.createdThe account was mentionedNo
message.receivedA direct message arrivedNo
review.createdA new Google Business Profile reviewNo

A webhook created with a list of events gets only those. Pick account.unauthorized even when you only care about posts: an expired LinkedIn token is the most common reason posts start failing, and this event arrives before the next post does.

Hands typing on a laptop at a desk, the kind of setup where you register a new webhook from the command line.

How do you create a webhook?

You create a webhook on AdaptlyPost's API Tokens page under the Webhooks tab, or with POST /webhooks in the API, webhook create in the CLI, or the SDK. Each webhook gets its own whsec_ signing secret, shown once when you create it.

adaptlypost webhook create --url https://example.com/hooks/adaptlypost \
  --event post.published --event post.failed --event account.unauthorized

Then send a test: the Send test button, webhook test <id> or POST /webhooks/{id}/test delivers a webhook.test event and reports the HTTP status your endpoint answered. Admins and Editors manage webhooks; other roles can see them but not change them. A workspace holds up to 10.

What does a delivery look like?

A delivery is an HTTPS POST with a JSON body and four headers. The body names the event and carries its data, such as the post with its per-network results for a post event.

HeaderValue
x-adaptly-signaturesha256= followed by the hex HMAC-SHA256 of timestamp.body
x-adaptly-timestampUnix seconds when AdaptlyPost signed the request
x-adaptly-eventThe event name, such as post.failed
x-adaptly-webhook-idThe webhook that sent it

Answer with any 2xx status within 10 seconds. Do the slow work after you answer, in a queue, so a burst of posts going out at 9:00 doesn't time out your endpoint.

How do you verify the signature?

You verify it by computing an HMAC-SHA256 over the timestamp header, a dot, and the raw request body, using the webhook's whsec_ secret, then comparing sha256= plus that hex digest with x-adaptly-signature in constant time. Reject the request if they differ or if the timestamp is old.

import { createHmac, timingSafeEqual } from 'node:crypto';
 
const verify = (rawBody: string, signature: string, timestamp: string, secret: string) => {
  const expected = `sha256=${createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex')}`;
  const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
  return fresh && expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
};

Use the raw body, before any JSON parser touches it; re-serialised JSON won't match. The AdaptlyPost SDK does all of this in constructWebhookEvent, which also rejects deliveries older than five minutes.

A technician checks cables in a server rack, the sort of work that follows when an endpoint goes down and deliveries start failing.

What happens when your endpoint is down?

AdaptlyPost tries each delivery 5 times, waiting longer between attempts, then gives up on that event. An endpoint that keeps failing for 3 days is disabled, and one that answers 410 Gone is disabled right away.

A failing webhook, step by step
1
Retry. A delivery that times out or gets a non-2xx answer is tried again, 5 attempts in total.
2
Keep failing. AdaptlyPost tracks how long the endpoint has failed without a success.
3
Disable. After 3 days of failures, or on a 410 Gone, the webhook's status turns disabled.
Re-enable a disabled webhook by updating it once your endpoint works again.

After an outage, GET /social-posts with a status filter shows what published or failed while your endpoint was down.

Do Zapier and n8n use the same webhooks?

The AdaptlyPost triggers in Zapier and n8n register the same webhooks when you turn a Zap or workflow on, and remove them when you turn it off. Each active trigger uses one of the workspace's 10 webhook slots.

That matters on busy workspaces. Ten Zaps with AdaptlyPost triggers fill the limit, and the eleventh fails to turn on. One webhook to your own endpoint that fans out by x-adaptly-event uses one slot for everything. The Zapier LinkedIn guide and the n8n LinkedIn guide show the trigger side, and the Slack alerts guide covers alerts with no code at all.

Two ways to spend your 10 webhook slots
One trigger per Zap
  • Each active trigger takes one slot
  • Ten Zaps fill the limit
  • The eleventh fails to turn on
One webhook to your endpoint
  • Takes one slot for everything
  • Your code reads x-adaptly-event
  • It fans each event out to the right job
Zapier and n8n triggers count toward the same workspace limit as your own webhooks.

Frequently Asked Questions

Does AdaptlyPost support webhooks?

AdaptlyPost sends signed webhooks for 13 events, including post published, partially failed and failed, account disconnected, AI image results, and new comments, mentions, messages and reviews.

How many webhooks can a workspace have?

A workspace holds up to 10 webhooks. Zapier and n8n triggers count toward the same limit, because each one registers its own webhook.

How do I verify an AdaptlyPost webhook signature?

Compute HMAC-SHA256 over the x-adaptly-timestamp value, a dot and the raw body with your whsec_ secret, prefix it with sha256=, and compare it with x-adaptly-signature in constant time.

Can I get a webhook when a social account disconnects?

The account.unauthorized event fires when a connected account needs reconnecting, such as an expired LinkedIn or Instagram token. It's in the default set.

Can I get webhooks for new comments and DMs?

Name comment.created, mention.created, message.received or review.created when you create the webhook. Inbox events aren't in the default set.

What happens if my webhook endpoint fails?

AdaptlyPost tries each delivery 5 times. An endpoint that keeps failing for 3 days is disabled, and an answer of 410 Gone disables it right away.

Should I use webhooks or polling to check if a post published?

Use webhooks. Publishing is asynchronous, and a script that polls GET /social-posts/{id}/results every few seconds runs into trouble once you have a few hundred scheduled posts and a rate limit. A webhook tells you once, when the result is true.

How do I test an AdaptlyPost webhook?

Use the Send test button, run webhook test <id> in the CLI, or call POST /webhooks/{id}/test. AdaptlyPost delivers a webhook.test event and reports the HTTP status your endpoint answered.

How fast does my endpoint need to respond to a webhook?

Answer with any 2xx status within 10 seconds. Put slow work in a queue and run it after you answer, so a burst of posts going out at 9:00 doesn't time out your endpoint.

Why does my webhook signature not match?

Check that you're hashing the raw request body, before any JSON parser touches it, because re-serialised JSON won't match. The signed string is the timestamp header, a dot and the body, using that webhook's own whsec_ secret. Your result also needs the sha256= prefix before you compare it.

Was This Article Helpful?

Let us know what you think!

See us more often in Google

One click marks AdaptlyPost as a preferred source, so our articles sit higher in your Top Stories, AI Mode, and AI Overviews.

Related Articles