openapi: 3.1.0 info: title: Meta Marketing API - Lead Ads description: | Graph API endpoints for managing Facebook and Instagram lead generation forms, retrieving captured leads, downloading bulk lead exports, and configuring leadgen webhooks. Authentication uses a Page access token (OAuth 2.0 bearer) with the leads_retrieval, pages_show_list, and pages_manage_ads permissions granted by a Page admin. version: "v22.0" contact: name: Meta for Developers url: https://developers.facebook.com/docs/marketing-api/guides/lead-ads/ servers: - url: https://graph.facebook.com/v22.0 description: Meta Graph API paths: /{page-id}/leadgen_forms: parameters: - $ref: '#/components/parameters/PageId' get: summary: List lead generation forms on a Page operationId: listLeadGenForms parameters: - $ref: '#/components/parameters/Fields' responses: "200": description: Forms collection content: application/json: schema: { $ref: '#/components/schemas/GraphCollection' } post: summary: Create a lead generation form on a Page operationId: createLeadGenForm requestBody: required: true content: application/json: schema: type: object properties: name: { type: string } questions: type: array items: type: object privacy_policy: type: object follow_up_action_url: { type: string } locale: { type: string } responses: "200": description: Form created content: application/json: schema: type: object properties: id: { type: string } /{form-id}: parameters: - name: form-id in: path required: true schema: { type: string } get: summary: Get a lead generation form operationId: getLeadGenForm parameters: - $ref: '#/components/parameters/Fields' responses: "200": description: Form /{form-id}/leads: parameters: - name: form-id in: path required: true schema: { type: string } - $ref: '#/components/parameters/Fields' - name: filtering in: query schema: { type: string } description: JSON-encoded filter list, e.g. by time_created. get: summary: List leads captured by a form operationId: listLeadsForForm responses: "200": description: Leads collection content: application/json: schema: { $ref: '#/components/schemas/GraphCollection' } /{lead-id}: parameters: - name: lead-id in: path required: true schema: { type: string } get: summary: Get a single lead operationId: getLead parameters: - $ref: '#/components/parameters/Fields' responses: "200": description: Lead record content: application/json: schema: { $ref: '#/components/schemas/Lead' } /{ad-id}/leads: parameters: - name: ad-id in: path required: true schema: { type: string } get: summary: List leads for an ad operationId: listLeadsForAd parameters: - $ref: '#/components/parameters/Fields' responses: "200": description: Leads collection /{form-id}/bulk_leads: parameters: - name: form-id in: path required: true schema: { type: string } get: summary: Bulk download leads for a form operationId: bulkDownloadLeads parameters: - name: from_date in: query schema: { type: string, format: date } - name: to_date in: query schema: { type: string, format: date } responses: "200": description: Bulk leads payload /{app-id}/subscriptions: parameters: - name: app-id in: path required: true schema: { type: string } post: summary: Subscribe an app to leadgen webhook events operationId: subscribeAppWebhook requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object required: [object, callback_url, fields, verify_token] properties: object: type: string enum: [page] callback_url: { type: string, format: uri } fields: type: string description: Comma-separated, must include "leadgen". verify_token: { type: string } responses: "200": description: Subscription confirmed /{page-id}/subscribed_apps: parameters: - $ref: '#/components/parameters/PageId' post: summary: Subscribe an app to a Page for leadgen webhooks operationId: pageSubscribedApps requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: subscribed_fields: type: string description: Comma-separated; include "leadgen". responses: "200": description: Page subscribed components: parameters: PageId: name: page-id in: path required: true schema: { type: string } description: Facebook Page ID Fields: name: fields in: query schema: { type: string } description: Comma-separated list of fields to return. schemas: GraphCollection: type: object properties: data: type: array items: { type: object } paging: type: object properties: cursors: type: object properties: before: { type: string } after: { type: string } next: { type: string } previous: { type: string } Lead: type: object properties: id: { type: string } created_time: { type: string, format: date-time } ad_id: { type: string } form_id: { type: string } field_data: type: array items: type: object properties: name: { type: string } values: type: array items: { type: string } securitySchemes: PageAccessToken: type: oauth2 description: | Page access token obtained via Facebook Login / Meta Business Login with leads_retrieval, pages_show_list, and pages_manage_ads permissions. flows: authorizationCode: authorizationUrl: https://www.facebook.com/v22.0/dialog/oauth tokenUrl: https://graph.facebook.com/v22.0/oauth/access_token scopes: leads_retrieval: Read leads from lead ad forms pages_show_list: List Pages the user manages pages_manage_ads: Manage ads associated with a Page security: - PageAccessToken: [leads_retrieval, pages_show_list, pages_manage_ads]