Skip to main content

Facebook Lead

Webhook 

Facebook Lead allows you to receive a webhook whenever a person submits one of your Facebook Lead Ads forms (event "lead"), with the person's answers.

It is sent for a Facebook Pages connection (facebook_type 3), to the URL you set with Set Webhook for that connection. Delivery, retries and duplicates are explained on the Webhook Events page.

The content of the lead. Meta's webhook carries only the IDs of a lead. So for every lead we fetch the lead from Facebook and send it to you in lead, with the answers of the form, and add leadFetched:

leadFetchedMeaning
truelead holds the lead's content: the answers (fieldData and fields), createdTime, isOrganic and disclaimerResponses.
falseWe could not fetch the lead, so lead is null. The IDs in the event (leadgenId, formId, adId, adgroupId) are valid: you can fetch the lead again later with Get Lead and the leadgenId.

You don't need Get Lead to receive your leads: it stays available as an optional re-fetch.

  • When Facebook fails for a moment (a timeout, too many requests), we try again for a few minutes before we send the lead with leadFetched false. So a lead event can reach you a few minutes later than usual.
  • When the problem will not pass by itself — for example, the connection's access expired (onboard it again) or the permission to read leads is missing — the lead is sent at once with leadFetched false.
Lead answers are personal data

The answers (names, email addresses, phone numbers …) are personal data of the person who filled in the form. We keep them with the event in our history for one year, and in our service logs for 30 days, so we can recover a lead for you if your server missed it. Store and protect them on your side accordingly.

Settings:

SettingValue
URLYour URL — set it with Set Webhook
MethodJSON via POST

With every lead event, you will get some of the following:

{
"event": "lead",
"action": "created",
"eventId": "fbw_a3f6c9e2b5d81047f0c3e6b9a2d5f817",
"platform": "facebook",
"from": "463745743546345",
"facebook_type": 3,
"pageId": "104857362910483",
"leadgenId": "1293847560192837",
"formId": "918273645501928",
"adId": "120211938475610290",
"adgroupId": "120211938475610288",
"author": null,
"fromSelf": false,
"text": null,
"timestamp": 1795611000,
"lead": {
"createdTime": 1795611000,
"isOrganic": false,
"fieldData": [
{ "name": "full_name", "values": ["Dana Cohen"] },
{ "name": "email", "values": ["dana@example.com"] },
{ "name": "phone_number", "values": ["+972501234567"] },
{ "name": "preferred_contact_time", "values": ["morning", "evening"] }
],
"fields": {
"full_name": "Dana Cohen",
"email": "dana@example.com",
"phone_number": "+972501234567",
"preferred_contact_time": "morning"
},
"disclaimerResponses": [
{ "checkbox_key": "marketing_consent", "is_checked": "1" }
]
},
"leadFetched": true
}

Response explained​

ParameterDescription / Example
event"lead" always, for lead webhooks.
action"created" always.
eventIdThe unique ID of this event (fbw_ and 32 characters). The same lead always comes with the same eventId, so use it to ignore an event you already received.
platform"facebook" always.
fromThe ID of your connection — the from you use to call our API.
facebook_type3 always (Facebook Pages).
pageIdYour Facebook Page ID.
leadgenIdThe lead ID. Use it with Get Lead.
formIdThe ID of the Lead Ads form, or null when Facebook does not send it.
adIdThe ID of the ad the lead came from, or null (for example, an organic lead).
adgroupIdThe ID of the ad group the lead came from, or null (for example, an organic lead).
authornull always: the person's details are in the answers.
fromSelffalse always.
textnull always.
timestampWhen the form was submitted, as Facebook reports it (Unix time in seconds, UTC).
leadThe lead's content (see below), or null when leadFetched is false.
leadFetchedtrue — lead holds the content. false — we could not fetch it: lead is null and the IDs are valid.

lead​

ParameterDescription / Example
createdTimeWhen the form was submitted (Unix time in seconds, UTC), or null when Facebook does not say.
isOrganictrue — the lead came from organic reach. false — it came from an ad. null when Facebook does not say.
fieldDataThe answers exactly as Facebook returns them: one name and values for each question. name is the question's key as Facebook sends it (for example full_name, email, phone_number, or the key of your own question). values is a list of texts: a multiple-choice question can have several.
fieldsThe same answers as a simple list of name: value, with the first value of each question (null when it has none). For a question with several values, read fieldData. When two questions have the same name, fields has the first one. A question whose name can't be a key (an empty name, a name longer than 1,000 bytes, or a name that starts and ends with __) is only in fieldData.
disclaimerResponsesThe optional check boxes of your form's custom disclaimer, as Facebook returns them (checkbox_key, is_checked). null when the form has none.

Webhook payload

​

Your response​

Received. Answer with any 2xx status (200, 201, 204 …) — we wait up to 5 seconds to connect and up to 15 seconds for your answer. The body of your answer is ignored.