advertising
Create a lead form
Creates a Lead Gen form on the connected Facebook Page (POST /{page-id}/leadgen_forms). NOT idempotent — a retry creates a second form. Prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both. Requires the Ads add-on.
AuthorizationBearer <token>
API key authentication - use your Zernio API key as a Bearer token
In: header
accountIdstring
namestring
Length
length <= 200questions
Items
1 <= itemsprivacyPolicyUrlstring
Format
uriprivacyPolicyLinkText?string
Length
length <= 70followUpActionUrl?string
Format
urilocale?string
thankYouTitle?string
thankYouBody?string
thankYouButtonText?string
thankYouButtonType?string
thankYouWebsiteUrl?string
Format
uriisOptimizedForQuality?boolean
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.ads.createLeadForm({ body: { accountId: 'account_abc123', name: 'Example', questions: [ { type: 'string', }, ], privacyPolicyUrl: 'https://example.com', },});console.log(data);{
"status": "success",
"form": {
"id": "string",
"name": "string"
}
}{
"error": "Unauthorized"
}Empty