API Reference
Facebook LoginGETLogin dialog
Lead Ads

Create a lead form

POST/v27.0/{page_id}/leadgen_forms
Base URL: https://meta-ads.mimicr.dev · provider: https://graph.facebook.com

Creates a lead form on the Page. Needs a Page access token with pages_manage_ads.

Authorization

Bearer token in the Authorization: Bearer <token> header. See Authentication.

Path parameters

page_idstringrequired

ID of the Page.

Example: "100539998049709"

Body

application/x-www-form-urlencoded
namestringrequired

Name of the form.

questionsobject[]required

Questions (JSON array).

Show child attributes
typestring

FULL_NAME, FIRST_NAME, LAST_NAME, EMAIL, PHONE, CUSTOM, DATE_TIME, ID_CPF, STORE_LOOKUP, CITY, STATE, ZIP, …

keystring

Field name in field_data.

labelstring

Question text; required for CUSTOM.

optionsobject[]

Choices {value, key}.

privacy_policyobject

{url, link_text}. Required in Mimicr.

Show child attributes
urlstring
link_textstring
follow_up_action_urlstring

URL after submission.

localestring

Locale of the form (pt_BR).

32 values
AR_ARCS_CZDA_DKDE_DEEL_GREN_GBEN_USES_ESES_LAFI_FIFR_FRHE_ILHI_INHU_HUID_IDIT_ITJA_JPKO_KRNB_NONL_NLPL_PLPT_BRPT_PTRO_RORU_RUSV_SETH_THTR_TRVI_VNZH_CNZH_HKZH_TW
block_display_for_non_targeted_viewerboolean

Stored.

is_optimized_for_qualityboolean

Stored.

thank_you_pageobject

Stored.

tracking_parametersobject

Stored.

phone_otp_verification_typestring

v27.0: NOT_ENABLED, OTP_REQUIRED or OTP_OPTIONAL.

NOT_ENABLEDOTP_REQUIREDOTP_OPTIONAL

Responses

200OK.
idstringrequired

ID of the new object.

400Error in the Graph envelope: 210 a Page access token is required, 100 invalid question.
errorobjectrequired
Show child attributes
messagestringrequired

Description of the error.

Example: "(#100) The parameter special_ad_categories is required"
typestringrequired

OAuthException for most codes (the Marketing API uses it for validation too), GraphMethodException for unknown objects, FacebookApiException for transient errors. In Mimicr, routes outside the integration core answer MimicrNotSimulated with HTTP 501.

Example: "OAuthException"
codeintegerrequired

Error code (100 invalid parameter, 190 invalid token, 200 permission, 2635 deprecated version, 613/17/80004 rate limits, …).

Example: 100
error_subcodeinteger

Error subcode with more detail (1885272 budget too low, 463 token expired, …).

Example: 1885272
is_transientboolean

Whether retrying the same request may succeed. Present on every Marketing API error; true for codes 1 and 2.

error_user_titlestring

Title of the error, to show to people.

error_user_msgstring

Message of the error, to show to people.

error_dataobject

Extra data. blame_field_specs lists the params that caused a validation error.

Show child attributes
blame_field_specsstring[][]
fbtrace_idstringrequired

Internal support identifier of the request.

Example: "AbCdEf12345"