Head terms

Facebook Webhooks in 2026: Setup, Verify Token and Fixes

Set up Facebook webhooks for Pages and Messenger: verify token, subscribed_apps, signature checks, Meta's retry rules and a fix list for missing events.

Prefer it in screens? See this guide as a Web Story

Quick answer

Facebook webhooks are HTTPS callbacks Meta sends when a Page you manage gets a post, comment or Messenger message. Build an endpoint that returns hub.challenge and checks X-Hub-Signature-256, subscribe the app to the page object, then POST to each Page's /subscribed_apps edge. Messenger unsubscribes a Page after one hour of failed deliveries.

Facebook webhooks are HTTPS callbacks that Meta sends to your server when something changes on a Facebook Page your app is installed on: a new post or comment in the Page feed, a Messenger message, a reaction. To get them you need three things: an endpoint that answers Meta’s verification request with the hub.challenge value, a subscription to the page object in the App Dashboard, and a POST to each Page’s /subscribed_apps edge with a Page access token.

Most “my Facebook webhook verifies but never fires” reports come from that last step, or from one of three other switches covered below. This guide walks through the setup, the fields and permissions for Pages and Messenger, how Meta retries failed deliveries, and a checklist for when nothing arrives.

PostGate handles OAuth, publishing and delivery evidence for every network through one API. Start free or read the docs.

01

What do Facebook webhooks send?

Webhooks are the read side of the Facebook API. Publishing is a request you make; comments, messages and reactions happen to the Page, and Meta pushes them to your callback URL so you don’t have to poll. If you are still working out which networks accept posts from code at all, the overview of platforms with a posting API covers that part. This post is about what comes back once the Page is live.

For a Facebook Page, two webhook fields on the page object matter, per Meta’s Webhooks for Pages guide:

Field What arrives Permissions the Page token needs
feed Changes to the Page feed: posts, comments, reactions, shares pages_manage_metadata and pages_show_list
messages A message sent to the Page through Messenger pages_messaging (plus pages_manage_metadata to subscribe)

Messenger adds its own fields on the same object, such as messaging_postbacks, message_reactions, message_reads, message_echoes and messaging_handovers. The Messenger Platform webhooks reference lists all of them. Subscribe only to what your product reads, because each permission you ask for is another item in Facebook App Review.

02

How do you set up a Facebook webhook step by step?

1. Build the callback endpoint

Your endpoint has to handle two kinds of HTTPS request, and the certificate must be valid. Meta does not accept self-signed certificates.

The verification request is a GET that Meta sends whenever you configure the Webhooks product. It carries three query parameters: hub.mode (always subscribe), hub.verify_token (the string you typed in the Verify Token field) and hub.challenge (a number). Compare the token with your own, then return the challenge as the plain response body. Return 403 if the token does not match.

The event notification is a POST with a JSON body and an X-Hub-Signature-256: sha256=<signature> header. The signature is an HMAC SHA256 of the payload, keyed with your app secret. Meta calls validation optional but strongly recommends it. Without it, anyone who finds your URL can inject fake comments into your system.

JavaScript
import express from 'express';
import crypto from 'node:crypto';

const app = express();
const { APP_SECRET, VERIFY_TOKEN } = process.env;

// Verification request
app.get('/webhooks/facebook', (req, res) => {
  const ok = req.query['hub.mode'] === 'subscribe'
    && req.query['hub.verify_token'] === VERIFY_TOKEN;
  if (!ok) return res.sendStatus(403);
  res.status(200).send(req.query['hub.challenge']);
});

// Event notifications: keep the raw body for the signature
app.post('/webhooks/facebook', express.raw({ type: 'application/json' }), (req, res) => {
  const header = req.get('x-hub-signature-256') || '';
  const expected = 'sha256=' + crypto.createHmac('sha256', APP_SECRET).update(req.body).digest('hex');
  const valid = header.length === expected.length
    && crypto.timingSafeEqual(Buffer.from(header), Buffer.from(expected));
  if (!valid) return res.sendStatus(401);

  res.sendStatus(200);              // acknowledge first
  enqueue(JSON.parse(req.body));    // process outside the request
});

Two details that break real setups. First, sign the raw bytes, not a re-serialized object: Meta computes the signature over an escaped-unicode version of the payload, so äöå arrives as äöå, and a parsed-then-stringified body produces a different hash. Second, if your endpoint runs on PHP, the parameters arrive as hub_mode, hub_verify_token and hub_challenge, because PHP turns dots into underscores.

2. Subscribe the app to the Page object

In the App Dashboard, add the Webhooks product, pick the Page object, enter your Callback URL and Verify Token, and click verify. Meta sends the GET from step 1 right away, and the dashboard shows whether your endpoint answered correctly. Then subscribe to the fields you need (feed, messages or the Messenger fields). For messaging, the same settings also live under Messenger > Settings.

The dashboard also has an Include Values setting. With it on, each entry carries a changes array with the new values. With it off, you only get changed_fields and have to fetch the data yourself.

3. Install the app on each Page

This is the step people miss. A dashboard subscription says which fields your app wants; Meta still won’t send anything for a Page until that Page installs the app. Send a POST to the Page’s subscribed_apps edge with a Page access token:

Bash
curl -i -X POST "https://graph.facebook.com/{page-id}/subscribed_apps?subscribed_fields=feed,messages&access_token={page-access-token}"

A successful call returns {"success": true}. A GET on the same edge lists the apps installed on the Page and their subscribed_fields, which is the fastest way to check this step later. The token has to come from someone who can perform the CREATE_CONTENT, MANAGE or MODERATE task on the Page (MESSAGING for message fields). How to get that token is covered on our Facebook page access token page.

You can do the same call in the Graph API Explorer: get a User token with pages_manage_metadata, switch it to the Page token, change the method to POST and query {page-id}/subscribed_apps.

4. Go live and get access for real users

Meta’s Messenger docs say an app with Standard Access only receives notifications from people who have a role on the app (admins, developers, testers). To receive events from your customers you need Advanced Access, which goes through App Review, and the app must be published. Our guide to Meta Advanced Access covers that request.

03

What does a Facebook Page webhook payload look like?

A comment on a Page post arrives on the feed field. The envelope is the same for every Page event: object is page, and entry is an array with the Page id, a time and the changes.

JSON
{
  "object": "page",
  "entry": [{
    "id": "{page-id}",
    "time": 1764849600,
    "changes": [{
      "field": "feed",
      "value": {
        "item": "comment",
        "verb": "add",
        "post_id": "{page-post-id}",
        "comment_id": "{comment-id}",
        "parent_id": "{page-post-id}",
        "from": { "id": "{user-id}", "name": "Jane Doe" },
        "message": "Is this still available?",
        "created_time": 1764849598
      }
    }]
  }]
}

item says what changed (post, comment, reaction and so on) and verb says how (add, edited, remove). For a reply to another comment, parent_id points to the parent comment instead of the post. Messenger events use a different shape: each entry carries a messaging array with sender, recipient, timestamp and a message object holding mid and text.

Meta keeps no history of notifications. Store what you need when it arrives, because you can’t query old webhook events later.

04

How does Meta retry failed webhook deliveries?

Your endpoint must answer every notification with 200 OK. The rules after a failure depend on the field, and the two documented sets differ a lot:

Messenger fields (messages and others) Other Graph API webhooks (such as feed)
Response time 200 OK within 5 seconds 200 OK
Retries A few immediate retries Immediate, then decreasing frequency
Alert Developer alert after 15 minutes of failures Not documented
Hard stop After 1 hour, “Webhooks Disabled” and the app is unsubscribed from the Page Undelivered updates dropped after 36 hours
Batching Several events per entry Up to 1,000 updates per batch, not guaranteed

Sources: the Messenger webhooks docs and the delivery section of Meta’s webhook setup guide.

The Messenger row is the dangerous one. One hour of downtime and Meta unsubscribes the Page, so after a deploy outage you have to call /subscribed_apps again for every affected Page. Two habits follow from the table. Acknowledge first and process later: verify the signature, write the payload to a queue, return 200. If you are choosing that queue, our BullMQ vs RabbitMQ comparison covers the trade-offs for this kind of job. And deduplicate, because retries resend events and Meta says messages can arrive out of order, so sort by the event timestamp, not by arrival.

This plumbing is where most of the work goes. If the reason you want Page webhooks is publishing (did my scheduled post go live?) or Instagram engagement (comments and DMs), PostGate already handles Meta’s side and sends its own signed events, like post.published, post.failed, profile.reauth_required, comment.created and message.received. The same features work from the no-code dashboard, from an AI agent over MCP and from the REST API, so you only verify one signature format.

05

Why is my Facebook webhook not working?

Go through these in order. Each one is a separate switch, and all of them have to be on.

Symptom Likely cause Fix
Dashboard says “callback URL couldn’t be validated” Endpoint returns JSON or HTML instead of the bare challenge, wrong token, or a self-signed or expired certificate Return hub.challenge as plain text with 200 and use a valid TLS certificate
Verified, but no events at all Page never installed the app POST /{page-id}/subscribed_apps with the fields; confirm with a GET
Events only from your own test account App in development mode or Standard Access Publish the app and request Advanced Access
GET subscribed_apps shows the app, still nothing Page has the App platform turned off in its settings, or the field is not selected in the dashboard Re-enable apps for the Page; check the field list on both sides
Every event fails the signature check Hashing a parsed body, or using the wrong app secret Hash the raw request bytes with the secret of the app that owns the subscription
Worked for weeks, then stopped Messenger deliveries failed for an hour and Meta unsubscribed the Page Fix the endpoint, then call /subscribed_apps again
Duplicate events Normal retry behavior Deduplicate by an ID in the payload (comment_id, mid)

To test without waiting for real traffic, send the verification GET to your own server with curl (?hub.mode=subscribe&hub.verify_token=...&hub.challenge=CHALLENGE_ACCEPTED) and check that the body comes back as CHALLENGE_ACCEPTED. Then use the dashboard’s test button for a field to push a sample notification.

06

Do you need code at all?

Not always. Automation tools such as n8n and Make can host the callback URL for you, which is enough for low volume, though you still do the Page subscription and access steps yourself. Our comparison of n8n alternatives for social media covers where those tools stop. For Instagram accounts, the same model applies with a different login setup; see Instagram webhooks for the token and host differences.

Frequently asked questions

What is the verify token in a Facebook webhook?

It is any string you choose and type in the Verify Token field of the App Dashboard. Meta sends it back as hub.verify_token in the verification request, and your endpoint compares it before returning hub.challenge. It is not an access token and it does not sign events; the app secret does that.

Are Facebook webhooks free?

Meta’s webhook docs list no per-event fee. What you pay for is the server that receives the notifications, plus the App Review work to get Advanced Access for the permissions behind each field.

Can I get webhooks for Facebook Groups?

Partly. The page object has a group_feed field that reports comments people leave on posts your Page published inside your business’s Facebook Group, so you can send a private reply. There is no webhook for everything posted in a Group, and the Groups API for publishing was removed in Graph API v19.0.

Why do I get Facebook webhook events only from my own account?

Your app is in development mode or only has Standard Access. In that state Meta delivers events only from people with a role on the app. Publish the app and get Advanced Access through App Review to receive events from everyone.

What is the difference between Facebook webhooks and Meta webhooks?

They are the same product. Meta Webhooks is the current name and covers Facebook Pages, Messenger, Instagram and WhatsApp; “Facebook webhooks” usually means the page object subscriptions described here.

Build it with PostGate

One API for every social platform your customers care about — sandboxed, documented, and ready today.

Start building Read the docs