Ads · Lead Gen

Create a lead form

Creates a lead form. Works with Meta Ads and LinkedIn Ads.

POSThttps://api.pozy.ai/v1/ads/lead-forms
Facebook and Instagram and LinkedIncreateLeadForm

Guide: Lead forms

Request

Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the ads resource group disabled get 403 resource_group_disabled. Authentication

Request body

application/json, required

  • accountIdstringrequired
  • namestringrequired

    Up to 200 characters.

  • questionsarray of objectdeprecated

    At least 1 item.

    • typestringrequired
    • keystring
    • labelstring
    • optionsarray of object
      2 child fields
      • keystring
      • valuestring
    • inline_contextstring
  • privacyPolicyUrlstring (URL)required
  • privacyPolicyLinkTextstringdeprecated

    Up to 70 characters.

  • followUpActionUrlstring (URL)deprecated
  • localestringdeprecated
  • thankYouTitlestringdeprecated
  • thankYouBodystringdeprecated
  • thankYouButtonTextstringdeprecated
  • thankYouButtonTypestringdeprecated
  • thankYouWebsiteUrlstring (URL)deprecated
  • isOptimizedForQualitybooleandeprecated
  • platformSpecificDataobject

    One of:

    MetaLeadFormPlatformData (18 fields)
    • questionsarray of objectrequired

      At least 1 item.

      5 child fields
      • typestringrequired
      • keystring
      • labelstring
      • optionsarray of object
        2 child fields
        • keystring
        • valuestring
      • inline_contextstring
    • privacyPolicyLinkTextstring

      Up to 70 characters.

    • followUpActionUrlstring (URL)
    • localestring
    • thankYouTitlestring
    • thankYouBodystring
    • thankYouButtonTextstring
    • thankYouButtonTypestring
    • businessPhoneNumberstring
    • countryCodestring

      Matches ^[A-Za-z]{2}$.

    • thankYouWebsiteUrlstring (URL)
    • thankYouEnableMessengerboolean

      Default false.

    • isOptimizedForQualityboolean
    • isPhoneSmsVerifyEnabledboolean

      Default false.

    • blockDisplayForNonTargetedViewerboolean
    • questionPageCustomHeadlinestring
    • contextCardobject
      5 child fields
      • titlestring
      • contentarray of string
      • stylestring

        One of LIST_STYLE, PARAGRAPH_STYLE.

      • buttonTextstring
      • coverPhotostring (URL)
    • customDisclaimerobject
      3 child fields
      • titlestringrequired
      • bodystringrequired
      • checkboxesarray of objectrequired

        At least 1 item.

        4 child fields
        • keystringrequired
        • textstringrequired
        • isRequiredboolean

          Default false.

        • isCheckedByDefaultboolean

          Default false.

    LinkedInLeadFormPlatformData (7 fields)
    • adAccountIdstringrequired
    • headlinestringrequired

      Up to 255 characters.

    • descriptionstringrequired

      Up to 1500 characters.

    • statestring

      One of DRAFT, PUBLISHED.

    • localeobject
      2 child fields
      • countrystring
      • languagestring
    • consentsarray of object
      2 child fields
      • descriptionstringrequired
      • requiredboolean

        Default false.

    • questionsarray of objectrequired

      At least 1 item.

      One of:

      Option 1 (6 fields)
      • kindstringrequired

        One of text.

      • namestringrequired
      • questionstringrequired
      • requiredboolean
      • responseEditableboolean
      • maxResponseLengthinteger
      Option 2 (6 fields)
      • kindstringrequired

        One of multipleChoice.

      • namestringrequired
      • questionstringrequired
      • requiredboolean
      • responseEditableboolean
      • choicesarray of objectrequired

        At least 1 item.

        2 child fields
        • idintegerrequired
        • textstringrequired

Example

curl -X POST "https://api.pozy.ai/v1/ads/lead-forms" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "name": "Acme",
  "privacyPolicyUrl": "https://pozy.ai/media/example-1.jpg"
}'

Response

200 on success

  • statusstring
  • formobject
    • idstring
    • namestring
200 response
{
  "status": "active",
  "form": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "name": "Acme"
  }
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Lead Gen