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.
Authorization
bearerAuth API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
Path Parameters
Zernio lead id, or the Meta leadgenId (then accountId is required).
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
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.updateLead({ path: { id: 'abc123', }, body: { status: 'new', },});console.log(data);{ "status": "string", "lead": { "id": "string", "leadgenId": "string", "formId": "string", "formName": "string", "accountId": "string", "adId": "string", "adsetId": "string", "campaignId": "string", "isOrganic": true, "createdTime": "string", "fields": { "property1": "string", "property2": "string" }, "fieldData": [ {} ], "status": "new", "statusChangedAt": "2019-08-24T14:15:22Z", "value": 0, "currency": "string", "contactId": "string", "firstContactedAt": "2019-08-24T14:15:22Z" }}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.
Delete a test lead
Deletes the test lead on a Meta lead form so you can submit a new one (Meta allows only one at a time). Removes a test lead created for the form (DELETE /{leadgen_id}), so a new one can be submitted: Meta keeps one test lead per form and refuses a second until the first is gone. The same test lead appears in Meta's Lead Ads Testing Tool. Meta only deletes test leads; a real lead is refused.