Format of Instagram Graph API webhooks — DM messages, story replies, and mentions received by your profile
When you connect your Instagram profile in Timely.ai, the platform registers a webhook in the Facebook App associated with your Instagram Business account. Meta then sends events from that profile to Timely, which normalizes them and forwards them to your workspace webhooks.This page documents the raw format that Meta sends — useful for debugging and for those maintaining direct integrations.
To receive Instagram events via webhook, your Meta app must have:
instagram_basic, instagram_manage_messages, and pages_messaging permissions
A Facebook Page linked to the Instagram Business profile
The instagram field selected in webhook subscriptions
Timely.ai handles all this configuration automatically when you connect Instagram via the dashboard under Settings → Channels → Instagram. You only need this documentation if you are integrating directly with the Graph API.
Meta uses two different envelope formats for Instagram:
entry[].messaging — direct messages, story replies, reads, and reactions. Contains the messaging array with sender and recipient.
entry[].changes — mentions and comment updates. Contains the changes array with field and value.
Your handler needs to check which key is present before processing.
Node.js
app.post("/webhook/instagram", (req, res) => { const body = req.body; if (body.object !== "instagram") return res.sendStatus(404); for (const entry of body.entry) { if (entry.messaging) { for (const event of entry.messaging) { if (event.message) handleDM(event); if (event.reaction) handleReaction(event); } } if (entry.changes) { for (const change of entry.changes) { if (change.field === "mentions") handleMention(change.value); } } } res.sendStatus(200);});