OverviewProductsPlatformsAPI ReferenceResources
Lead Gen

Create a test lead

POSThttps://zernio.com/api/v1/ads/lead-forms/{formId}/test-leads

Submits a test lead to a Meta lead form so you can check your lead retrieval without running ads.

Submits a test lead against the form (POST /{form-id}/test_leads) to exercise retrieval without waiting for real ad impressions. Meta allows one test lead per form at a time.

PlatformsMeta

Authentication

AuthorizationBearer tokenRequired

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

Path parameters

formIdstringRequired

Body

application/json

What every request needs

accountIdstringRequired
fieldDataarray of objectRequired
namestringRequired
valuesarray of stringsRequired

Responses

Success· the request worked

Errors· the request failed

Create a lead form

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. ### 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).

Get a lead form

Shows a lead form in full, including its questions and thank-you page. Returns the full form, including the thank-you page, so a form can be diffed against what was created. Meta forms are scoped to the Page the accountId manages: a form on any other Page is a 404, never a read.

POST/v1/ads/lead-forms/{formId}/test-leads
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.leadgen.createTestLead({  path: {    formId: 'form_abc123',  },  body: {    accountId: 'account_abc123',    fieldData: [      {        name: 'Example',        values: [          'string',        ],      },    ],  },});console.log(data);
{  "status": "string",  "testLead": {    "id": "string"  }}
OpenAPI specification
Was this page helpful?