OverviewPlatformsAPI ReferenceResources
Lead Gen

Create a lead form

POSThttps://zernio.com/api/v1/ads/lead-forms

Creates a lead form on a Facebook Page or LinkedIn Company Page to collect contact details from ads.

The form content goes inside platformSpecificData for both platforms (the shape is selected by the accountId's platform). Requires the Ads add-on.

NOT idempotent: a retry creates a second form.

PlatformsMetaLinkedIn

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Body

application/json

What every request needs

accountIdstringRequired
namestring, max 200Required
privacyPolicyUrlstring (uri)Required
Optional parameters11 fields
questionsDeprecatedarray of object

Deprecated (Meta legacy shape): use platformSpecificData.questions.

typestringRequired

EMAIL, PHONE, FULL_NAME, FIRST_NAME, LAST_NAME, CUSTOM, …

privacyPolicyLinkTextDeprecatedstring, max 70

Deprecated: use platformSpecificData.privacyPolicyLinkText.

followUpActionUrlDeprecatedstring (uri)

Deprecated: use platformSpecificData.followUpActionUrl.

localeDeprecatedstring

Deprecated: use platformSpecificData.locale.

thankYouTitleDeprecatedstring

Deprecated: use platformSpecificData.thankYouTitle.

thankYouBodyDeprecatedstring

Deprecated: use platformSpecificData.thankYouBody.

thankYouButtonTextDeprecatedstring

Deprecated: use platformSpecificData.thankYouButtonText.

thankYouButtonTypeDeprecatedstring

Deprecated: use platformSpecificData.thankYouButtonType.

thankYouWebsiteUrlDeprecatedstring (uri)

Deprecated: use platformSpecificData.thankYouWebsiteUrl.

isOptimizedForQualityDeprecatedboolean

Deprecated: use platformSpecificData.isOptimizedForQuality.

platformSpecificDataone of 2 objects

Form content; the shape is selected by the accountId's platform. Unknown fields are a 400 (strict-parsed).

Responses

Success· the request worked

Errors· the request failed

How it behaves

Meta

Created on the connected Facebook Page (POST /{page-id}/leadgen_forms). accountId may be:

  • the metaads ads connection (its Page comes from the Facebook account linked to the same profile)
  • an Instagram account (the Page its ads run under: its own linked Page, else the Facebook or business-login Meta ads account on the same profile)
  • the Facebook account itself

The old top-level Meta fields (questions, thankYou*, contextCard, …) are DEPRECATED but still accepted while platformSpecificData is absent. Mixing both shapes is a 400.

thankYouEnableMessenger, isPhoneSmsVerifyEnabled and customDisclaimer are accepted only inside platformSpecificData (top-level is a 400).

Meta prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both.

LinkedIn

Created on the ad account's Company Page. LinkedIn exposes only free-text and multiple-choice questions via API (prefilled-from-profile fields are Campaign Manager UI-only).

POST/v1/ads/lead-forms
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.leadgen.createLeadForm({  body: {    accountId: 'account_abc123',    name: 'Example',    privacyPolicyUrl: 'https://example.com',  },});console.log(data);
{  "status": "string",  "form": {    "id": "string",    "name": "string"  }}
OpenAPI specification
Was this page helpful?