Send Facebook and Instagram leads to a WhatsApp inbox
Pipe Facebook and Instagram Lead Ads form fills into a WhatsApp inbox in Deskwoot.
Connect a Facebook Page that runs Lead Ads to a Deskwoot WhatsApp inbox. Every form fill on Facebook or Instagram lands as a fresh conversation in your dashboard, with the full lead-form data attached, and a pre-approved WhatsApp Template Message goes out the moment Meta delivers the webhook so the customer's 24-hour reply window opens immediately.
What you need before connecting
- A Facebook Page that owns the Lead Ads.
- A Meta App with the Lead Ads webhook subscribed at the App level.
- A Page Access Token with these permissions:
pages_show_list,pages_read_engagement,pages_manage_metadata,leads_retrieval. Get a long-lived one (60 days) so you don't have to refresh weekly. - The Meta App Secret (Settings, Basic, App Secret in your Meta App).
- A WhatsApp Cloud API inbox already set up in Deskwoot.
- At least one approved WhatsApp Message Template in Meta Business Manager. Templates can have variables (the
{{1}},{{2}}, ... placeholders), and our settings UI lets you map those variables to the lead's first name, your account name, a static string, or any field on the lead form.
Connect the Page
- Go to Settings, Integrations, Meta Lead Ads in Deskwoot.
- Paste the Page ID, the long-lived Page Access Token, and the App Secret.
- Pick the WhatsApp Cloud API inbox where conversations should land.
- Type your approved welcome template name and language code (e.g.
lead_welcome+en_US). - Click Connect Page.
We round-trip your Page Access Token against the Graph API to confirm the Page exists, then call POST /<page_id>/subscribed_apps?subscribed_fields=leadgen on Meta's end so the Page actually starts delivering leadgen webhooks. Without that per-Page opt-in, the App-level subscription alone delivers nothing. We do this for you.
Configure the webhook in your Meta App
After connecting, click Configure on the connected Page card. Two values appear:
- Callback URL like
https://deskwoot.com/api/webhooks/meta-leadgen/<your-slug> - Verify token, a per-Page random string
Paste both into your Meta App Dashboard, Webhooks, Page, Edit Subscription. Each connected Page gets its own slug and verify token so a leak on one Page never authorizes a webhook against another Page.
Discover lead-form fields
Click Discover fields in the configure panel. We call Graph /<page_id>/leadgen_forms?fields=questions and pull every question key from every active form on this Page. Those keys become the dropdown options in the Field-Mapping and Template-Variable pickers below.
Field mapping
Tell us which Meta lead-form question maps to which Deskwoot contact field. Defaults are sensible:
email,EMAIL, or whatever your form calls it, maps to Email. Email drives contact identity (we find-or-create by email first, falling back to phone).full_namemaps to Full namephone_numbermaps to Phone, normalised to digits-only before being stored as the WhatsApp ID.
You can add custom mappings for Company or Job title if your form has those questions.
Template variables
WhatsApp templates use {{1}}, {{2}}, ... placeholders in the body. The variable picker lets you fill each one with:
- Lead first name, derived from the
full_namemapping - Account name, your Deskwoot account display name
- Static text, a literal string
- Lead form field, any field key we discovered above
Add as many variable rows as your template expects, in order. Zero rows is valid for templates without variables.
What happens when a lead fills out the form
- Meta delivers a leadgen webhook to your slug-scoped URL with HMAC
x-hub-signature-256. - We verify the signature against your App Secret and skip the lead silently if it doesn't match.
- We claim the lead in a
MetaLeadAdLeadrow withUNIQUE(accountId, leadgenId). Duplicate webhook deliveries (Meta retries up to 7 times over 5 days) lose the race here, never producing a duplicate conversation. - We fetch the full lead via Graph
GET /<leadgen_id>. - We find-or-create the contact, mapping the form fields per your config.
- We open a fresh conversation in your WhatsApp inbox with the full form data on
customAttributes.metaLeadAd. - We send the welcome template via WhatsApp Cloud API. The message lands on the lead's phone, opens the 24-hour reply window, and your agent (or Fynn if it's the assignee) takes it from there.
Disconnect
Click Disconnect on the Page card. We call Meta DELETE /<page_id>/subscribed_apps to stop further webhook delivery, then drop the local row. Even if Meta returns an error (token expired, Page deleted), we still drop the local row so you're never stuck with a config you can't remove.