Zernio
APIFor you
Zernio
APIFor you
API Reference

Lead Gen

List leads for a single formGETList lead formsGETList submitted leadsGETCreate a lead formPOSTCreate a test leadPOSTGet a lead formGETUpdate a lead's statusPATCHDelete a test leadDELETEArchive a lead formDELETE
Dashboard
OverviewPlatformsAPI ReferenceResources
Lead Gen

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.


PlatformsMetaLinkedIn
GET
/v1/ads/lead-forms/{formId}

Authorization

bearerAuth
AuthorizationBearer <token>

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

In: header

Path Parameters

formId*string

Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).

Query Parameters

accountId*string

Connected Meta ads, facebook, instagram or linkedin ads account id (selects the platform). A Meta ads connection resolves its Page through the Facebook account linked to the same profile; an Instagram account uses the Page its ads run under (its own linked Page, else the Facebook or business-login Meta ads account on the same profile).

fields?string

Meta only. A Graph field selection passed through verbatim to GET /{form-id}, replacing the default projection, so fields Meta adds later are reachable without an API change. Field names, commas and {} expansion only; anything else (Graph field modifiers such as .limit(), or characters that could open another query parameter) is a 400. Ownership of the form is verified before the selection runs, so this cannot reach any Page but the one accountId manages. Unknown field names are rejected by Meta as a 400.

Lengthlength <= 2000

Response Body

application/json

application/json

application/json

import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.leadgen.getLeadForm({  path: {    formId: 'form_abc123',  },  query: {    accountId: 'account_abc123',  },});console.log(data);
{  "status": "string",  "form": {    "id": "string",    "name": "string",    "status": "string",    "locale": "string",    "created_time": "2019-08-24T14:15:22Z",    "page_id": "string",    "leads_count": 0,    "organic_leads_count": 0,    "expired_leads_count": 0,    "privacy_policy_url": "http://example.com",    "follow_up_action_url": "http://example.com",    "follow_up_action_text": "string",    "question_page_custom_headline": "string",    "is_optimized_for_quality": true,    "block_display_for_non_targeted_viewer": true,    "allow_organic_lead": true,    "tracking_parameters": [      {        "key": "string",        "value": "string"      }    ],    "legal_content": {      "id": "string",      "privacy_policy": {        "url": "http://example.com",        "link_text": "string"      },      "custom_disclaimer": {}    },    "context_card": {      "id": "string",      "title": "string",      "style": "LIST_STYLE",      "content": [        "string"      ],      "button_text": "string",      "cover_photo": {        "id": "string"      }    },    "thank_you_page": {      "id": "string",      "title": "string",      "body": "string",      "button_text": "string",      "button_type": "string",      "website_url": "http://example.com",      "enable_messenger": true,      "status": "string",      "lead_gen_use_case": "string",      "business_phone_number": "string",      "country_code": "string"    },    "questions": [      {        "id": "string",        "key": "string",        "label": "string",        "type": "string",        "inline_context": "string",        "options": [          {            "key": "string",            "value": "string"          }        ],        "conditional_questions_group_id": "string",        "conditional_questions_choices": [          {}        ],        "dependent_conditional_questions": [          {}        ]      }    ]  }}
Was this page helpful?

Create a test lead

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.

Update a lead's status

Sets the status of a Meta lead (and optionally its value) so you can track it from lead to sale. `{id}` is the Zernio lead id (`id` on `GET /v1/ads/leads`, `leadId` on `GET /v1/ads/lead-forms/{formId}/leads`) or the Meta `leadgenId` together with `accountId` in the body. Requires the Ads add-on.