# Create page lead form

POST https://services.leadconnectorhq.com/ad-publishing/facebook/page/{pageId}/forms

Create a lead gen form. With `isDraft: true` the form is stored locally and returned as a draft; without it the form is published to Facebook and the Meta record is returned. The two responses share almost no fields. Publishing enforces at least one question and a complete `thankYouPage` (title, body, buttonText) where a draft save enforces neither. Pass `draftFormId` when publishing an existing draft to have it deleted afterwards — either the bare id or the `draft_`-prefixed form is accepted, and cleanup failures are logged rather than surfaced.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `adPublishing.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `pageId` | string | Yes | Facebook page identifier |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "v4"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/ad-publishing/facebook/page/{pageId}/forms": {
      "post": {
        "summary": "Create page lead form",
        "operationId": "createPageLeadForm",
        "description": "Create a lead gen form. With `isDraft: true` the form is stored locally and returned as a draft; without it the form is published to Facebook and the Meta record is returned. The two responses share almost no fields. Publishing enforces at least one question and a complete `thankYouPage` (title, body, buttonText) where a draft save enforces neither. Pass `draftFormId` when publishing an existing draft to have it deleted afterwards — either the bare id or the `draft_`-prefixed form is accepted, and cleanup failures are logged rather than surfaced.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v4"
              ]
            }
          },
          {
            "name": "pageId",
            "required": true,
            "in": "path",
            "description": "Facebook page identifier",
            "schema": {
              "example": "103456789012345",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLeadFormDTO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The stored draft when `isDraft` is set, otherwise the form as published to Facebook",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePageLeadFormResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerErrorDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "adPublishing.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "CreateLeadFormDTO": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Lead form type",
            "example": "MORE_VOLUME",
            "enum": [
              "MORE_VOLUME",
              "HIGHER_INTENT"
            ]
          },
          "name": {
            "type": "string",
            "description": "Lead form name",
            "example": "Contact Form"
          },
          "locationId": {
            "type": "string",
            "description": "Location identifier",
            "example": "loc_abc123"
          },
          "greetingCard": {
            "description": "Greeting card config",
            "example": {
              "title": "Welcome!",
              "style": "LIST_STYLE",
              "content": [
                "Learn more about our services"
              ]
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Greeting card title",
                    "example": "Welcome!"
                  },
                  "style": {
                    "type": "string",
                    "description": "Greeting card style",
                    "example": "LIST_STYLE",
                    "enum": [
                      "LIST_STYLE",
                      "PARAGRAPH_STYLE"
                    ]
                  },
                  "content": {
                    "description": "Greeting card content",
                    "example": [
                      "Learn more about our services"
                    ],
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "title",
                  "style",
                  "content"
                ],
                "title": "GreetingCard"
              }
            ]
          },
          "questions": {
            "description": "List of questions displayed on the lead form. Required (non-empty) when `isDraft` is false or omitted; optional for drafts.",
            "example": [
              {
                "key": "full_name",
                "type": "FULL_NAME"
              },
              {
                "key": "email_address",
                "type": "EMAIL"
              },
              {
                "key": "preferred_time",
                "type": "CUSTOM",
                "options": [
                  {
                    "key": "morning",
                    "value": "Morning"
                  },
                  {
                    "key": "evening",
                    "value": "Evening"
                  }
                ]
              },
              {
                "key": "are_you_interested",
                "label": "Are you interested?",
                "type": "CUSTOM",
                "options": [
                  {
                    "value": "Yes"
                  },
                  {
                    "value": "No"
                  }
                ]
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "description": "Question label text shown to the user",
                  "example": "What is your name?"
                },
                "key": {
                  "type": "string",
                  "description": "Question key",
                  "example": "name"
                },
                "type": {
                  "type": "string",
                  "description": "Question input type — use a prefilled type for standard fields or CUSTOM for freeform questions",
                  "example": "CUSTOM",
                  "enum": [
                    "CUSTOM",
                    "CITY",
                    "COMPANY_NAME",
                    "COUNTRY",
                    "DOB",
                    "EMAIL",
                    "GENDER",
                    "FIRST_NAME",
                    "FULL_NAME",
                    "JOB_TITLE",
                    "LAST_NAME",
                    "MARITIAL_STATUS",
                    "WHATSAPP_NUMBER",
                    "EDUCATION_LEVEL",
                    "WEBSITE",
                    "PHONE",
                    "PHONE_OTP",
                    "POST_CODE",
                    "PROVINCE",
                    "RELATIONSHIP_STATUS",
                    "STATE",
                    "STREET_ADDRESS",
                    "ZIP",
                    "WORK_EMAIL",
                    "MILITARY_STATUS",
                    "WORK_PHONE_NUMBER",
                    "LOCAL_DEALER",
                    "SLIDER",
                    "STORE_LOOKUP",
                    "STORE_LOOKUP_WITH_TYPEAHEAD",
                    "DATE_TIME",
                    "ID_CPF",
                    "ID_AR_DNI",
                    "ID_CL_RUT",
                    "ID_CO_CC",
                    "ID_EC_CI",
                    "ID_PE_DNI",
                    "ID_MX_RFC",
                    "JOIN_CODE",
                    "USER_PROVIDED_PHONE_NUMBER",
                    "FACEBOOK_LEAD_ID",
                    "EMAIL_ALIAS",
                    "MESSENGER",
                    "VIN",
                    "LICENSE_PLATE",
                    "THREAD_LINK",
                    "ADDRESS_LINE_TWO",
                    "SHORT_ANSWER"
                  ]
                },
                "options": {
                  "description": "Answer options for multiple-choice questions (only applies to CUSTOM type)",
                  "example": [
                    {
                      "value": "Yes"
                    },
                    {
                      "value": "No"
                    }
                  ],
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string",
                        "description": "Option key",
                        "example": "option 1"
                      },
                      "value": {
                        "type": "string",
                        "description": "Option value",
                        "example": "Option 1"
                      }
                    },
                    "required": [
                      "key",
                      "value"
                    ],
                    "title": "FormQuestionOption"
                  }
                }
              },
              "required": [
                "key",
                "type"
              ],
              "title": "FormQuestion"
            }
          },
          "questionPageHeadline": {
            "type": "string",
            "description": "Question page headline",
            "example": "Tell us about yourself"
          },
          "privacyPolicyLink": {
            "type": "string",
            "description": "Privacy policy URL. Required when `isDraft` is false or omitted; optional for drafts.",
            "example": "https://example.com/privacy"
          },
          "privacyPolicyText": {
            "type": "string",
            "description": "Privacy policy text",
            "example": "We respect your privacy"
          },
          "customDisclaimer": {
            "description": "Custom disclaimer config",
            "example": {
              "title": "Terms & Conditions",
              "body": "By submitting...",
              "checkboxes": [
                {
                  "isRequired": true,
                  "text": "I agree",
                  "key": "terms"
                }
              ]
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Disclaimer title",
                    "example": "Terms & Conditions"
                  },
                  "body": {
                    "type": "string",
                    "description": "Disclaimer body text",
                    "example": "By submitting..."
                  },
                  "checkboxes": {
                    "description": "Consent checkboxes the user must agree to before submitting the form",
                    "example": [
                      {
                        "isRequired": true,
                        "text": "I agree to the Terms & Conditions",
                        "key": "terms_checkbox"
                      },
                      {
                        "isRequired": false,
                        "text": "I would like to receive marketing emails",
                        "key": "marketing_optin"
                      }
                    ],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "isRequired": {
                          "type": "boolean",
                          "description": "Checkbox required flag",
                          "example": true
                        },
                        "text": {
                          "type": "string",
                          "description": "Checkbox text label",
                          "example": "I agree to terms"
                        },
                        "key": {
                          "type": "string",
                          "description": "Checkbox unique key",
                          "example": "terms_checkbox"
                        }
                      },
                      "required": [
                        "isRequired",
                        "text",
                        "key"
                      ],
                      "title": "CustomDisclaimerCheckbox"
                    }
                  }
                },
                "required": [
                  "title",
                  "body"
                ],
                "title": "CustomDisclaimer"
              }
            ]
          },
          "thankYouPage": {
            "description": "Thank you page config. Required when `isDraft` is false or omitted; optional for drafts.",
            "example": {
              "title": "Thank You!",
              "body": "We will contact you soon",
              "buttonText": "Visit Website",
              "buttonType": "VIEW_WEBSITE",
              "buttonLink": "https://example.com"
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Thank you page title",
                    "example": "Thank You!"
                  },
                  "body": {
                    "type": "string",
                    "description": "Thank you page body",
                    "example": "We will contact you soon"
                  },
                  "buttonText": {
                    "type": "string",
                    "description": "Button text label",
                    "example": "Visit Website"
                  },
                  "buttonType": {
                    "type": "string",
                    "description": "Thank-you-page button action. `VIEW_WEBSITE` and `DOWNLOAD` use `buttonLink`; `CALL_BUSINESS` uses the business phone number.",
                    "example": "VIEW_WEBSITE",
                    "enum": [
                      "VIEW_WEBSITE",
                      "CALL_BUSINESS",
                      "DOWNLOAD"
                    ]
                  },
                  "buttonLink": {
                    "type": "string",
                    "description": "Button destination link",
                    "example": "https://example.com"
                  },
                  "businessPhone": {
                    "type": "string",
                    "description": "Business phone number",
                    "example": "+1234567890"
                  },
                  "countryCode": {
                    "type": "string",
                    "description": "Phone country code",
                    "example": "US"
                  }
                },
                "required": [
                  "title",
                  "body",
                  "buttonText",
                  "buttonType"
                ],
                "title": "ThankYouPage"
              }
            ]
          },
          "isDraft": {
            "type": "boolean",
            "description": "If the form is a draft, set to true",
            "example": true
          },
          "draftFormId": {
            "type": "string",
            "description": "Draft form ID",
            "example": "1234567890"
          },
          "locale": {
            "type": "string",
            "description": "Locale",
            "example": "EN_US"
          }
        },
        "required": [
          "type",
          "name",
          "locationId",
          "questions",
          "privacyPolicyLink",
          "thankYouPage"
        ],
        "title": "CreateLeadFormDTO"
      },
      "CreatePageLeadFormResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Draft id, unprefixed. The listing endpoint reports this same draft as `draft_<id>`.",
                "example": "6a866661867e604d24f5a21c"
              },
              "isDraft": {
                "type": "boolean",
                "description": "Always true on this branch",
                "example": true
              },
              "name": {
                "type": "string",
                "description": "Form name",
                "example": "Untitled form 20 Aug 26, 07:57 AM"
              },
              "locationId": {
                "type": "string",
                "description": "Owning location",
                "example": "fRMewNQIxSyZ5R4nQyit"
              },
              "pageId": {
                "type": "string",
                "description": "Page the draft will publish to",
                "example": "196684453527082"
              },
              "type": {
                "type": "string",
                "description": "Lead form objective",
                "enum": [
                  "MORE_VOLUME",
                  "HIGHER_INTENT"
                ],
                "example": "MORE_VOLUME"
              },
              "locale": {
                "type": "string",
                "description": "Form locale, upper-cased as stored",
                "example": "EN_US"
              },
              "createdAt": {
                "type": "string",
                "description": "Creation time, ISO-8601",
                "example": "2026-08-20T02:28:49.477Z"
              },
              "updatedAt": {
                "type": "string",
                "description": "Last modification time, ISO-8601. Equal to `createdAt` on a fresh draft.",
                "example": "2026-08-20T02:28:49.477Z"
              },
              "greetingCard": {
                "description": "Intro card",
                "example": {
                  "title": "Hi there, good to see you here!",
                  "style": "LIST_STYLE",
                  "content": [
                    "Ready to learn more? Just a few quick details in the form below."
                  ],
                  "_id": "6a7d9fa9d4e1daea36a9585f"
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "Greeting headline",
                        "example": "Hi there, good to see you here!"
                      },
                      "style": {
                        "type": "string",
                        "description": "Layout of the greeting body",
                        "enum": [
                          "LIST_STYLE",
                          "PARAGRAPH_STYLE"
                        ],
                        "example": "LIST_STYLE"
                      },
                      "content": {
                        "description": "Body lines. Rendered as a paragraph or as bullets depending on `style`.",
                        "example": [
                          "Ready to learn more? Just a few quick details in the form below."
                        ],
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "_id": {
                        "type": "string",
                        "description": "Mongo subdocument id. Internal — do not depend on it.",
                        "example": "6a7d9fa9d4e1daea36a9585f"
                      }
                    },
                    "required": [
                      "title",
                      "style",
                      "content"
                    ],
                    "title": "FacebookDraftLeadFormGreetingCardDTO"
                  }
                ]
              },
              "questions": {
                "description": "Questions as stored. Each carries a Mongo `_id`, and so does every entry in its `options`.",
                "example": [
                  {
                    "key": "full_name",
                    "type": "FULL_NAME",
                    "label": "What is your name?",
                    "options": [
                      {
                        "key": "Option 1",
                        "value": "Option 1"
                      }
                    ],
                    "_id": "6a7d9fa9d4e1daea36a95860"
                  }
                ],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Field key the answer will be delivered under",
                      "example": "full_name"
                    },
                    "type": {
                      "type": "string",
                      "description": "Question type",
                      "example": "FULL_NAME"
                    },
                    "label": {
                      "type": "string",
                      "description": "Question text. Absent on prefilled questions that have not been given a custom label.",
                      "example": "What is your name?"
                    },
                    "options": {
                      "description": "Choices. Always present on a draft, empty for anything that is not multiple choice.",
                      "example": [
                        {
                          "key": "Option 1",
                          "value": "Option 1"
                        }
                      ],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string",
                            "description": "Option key",
                            "example": "Option 1"
                          },
                          "value": {
                            "type": "string",
                            "description": "Option display value",
                            "example": "Option 1"
                          }
                        },
                        "required": [
                          "key",
                          "value"
                        ],
                        "title": "FacebookLeadFormQuestionOptionDTO"
                      }
                    },
                    "_id": {
                      "type": "string",
                      "description": "Mongo subdocument id. Internal — do not depend on it.",
                      "example": "6a7d9fa9d4e1daea36a95860"
                    }
                  },
                  "required": [
                    "key",
                    "type",
                    "options"
                  ],
                  "title": "FacebookDraftLeadFormQuestionDTO"
                }
              },
              "questionPageHeadline": {
                "type": "string",
                "description": "Headline above the questions",
                "example": "We'll use your information to send you our weekly newsletters."
              },
              "privacyPolicyLink": {
                "type": "string",
                "description": "Privacy policy URL",
                "example": "https://www.privacypolicy.com"
              },
              "privacyPolicyText": {
                "type": "string",
                "description": "Privacy policy link text",
                "example": "Link text"
              },
              "customDisclaimer": {
                "description": "Custom disclaimer block",
                "example": {
                  "title": "Terms and conditions",
                  "body": "By submitting you agree to our terms.",
                  "checkboxes": [
                    {
                      "key": "consent_marketing",
                      "text": "I agree to receive marketing emails",
                      "isRequired": true
                    }
                  ]
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "Disclaimer heading",
                        "example": "Terms and conditions"
                      },
                      "body": {
                        "type": "string",
                        "description": "Disclaimer body copy",
                        "example": "By submitting you agree to our terms."
                      },
                      "checkboxes": {
                        "description": "Consent checkboxes shown under the disclaimer",
                        "example": [
                          {
                            "key": "consent_marketing",
                            "text": "I agree to receive marketing emails",
                            "isRequired": true
                          }
                        ],
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string",
                              "description": "Checkbox key",
                              "example": "consent_marketing"
                            },
                            "text": {
                              "type": "string",
                              "description": "Checkbox text",
                              "example": "I agree to receive marketing emails"
                            },
                            "isRequired": {
                              "type": "boolean",
                              "description": "Whether the user must tick this box to submit",
                              "example": true
                            }
                          },
                          "required": [
                            "key",
                            "text",
                            "isRequired"
                          ],
                          "title": "FacebookDraftLeadFormDisclaimerCheckboxDTO"
                        }
                      }
                    },
                    "required": [
                      "title",
                      "body"
                    ],
                    "title": "FacebookDraftLeadFormDisclaimerDTO"
                  }
                ]
              },
              "thankYouPage": {
                "description": "Confirmation screen",
                "example": {
                  "title": "Thank you, you are all set!",
                  "body": "You can visit our website or call us.",
                  "buttonText": "View website",
                  "buttonType": "VIEW_WEBSITE",
                  "buttonLink": "",
                  "businessPhone": "5551234567",
                  "countryCode": "+1"
                },
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "Thank-you headline",
                        "example": "Thank you, you are all set!"
                      },
                      "body": {
                        "type": "string",
                        "description": "Thank-you body copy",
                        "example": "You can visit our website or call us."
                      },
                      "buttonText": {
                        "type": "string",
                        "description": "Call-to-action button label",
                        "example": "View website"
                      },
                      "buttonType": {
                        "type": "string",
                        "description": "Button action. `VIEW_WEBSITE` and `DOWNLOAD` use `buttonLink`; `CALL_BUSINESS` uses the phone number.",
                        "enum": [
                          "VIEW_WEBSITE",
                          "CALL_BUSINESS",
                          "DOWNLOAD"
                        ],
                        "example": "VIEW_WEBSITE"
                      },
                      "buttonLink": {
                        "type": "string",
                        "description": "Destination URL. Empty string when the button does not link out.",
                        "example": ""
                      },
                      "businessPhone": {
                        "type": "string",
                        "description": "Phone number dialled by a CALL_BUSINESS button",
                        "example": "5551234567"
                      },
                      "countryCode": {
                        "type": "string",
                        "description": "Country code for `businessPhone`",
                        "example": "+1"
                      }
                    },
                    "required": [
                      "title",
                      "body",
                      "buttonText",
                      "buttonType"
                    ],
                    "title": "FacebookDraftLeadFormThankYouPageDTO"
                  }
                ]
              }
            },
            "required": [
              "id",
              "isDraft",
              "name",
              "locationId",
              "pageId",
              "locale",
              "createdAt",
              "updatedAt"
            ],
            "title": "FacebookCreatedDraftLeadFormDTO"
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Facebook lead form id",
                "example": "1058780283190888"
              },
              "name": {
                "type": "string",
                "description": "Form name",
                "example": "Untitled form 20 Aug 26, 07:57 AM"
              },
              "locale": {
                "type": "string",
                "description": "Locale, lower-cased by Meta. The draft stored it upper-cased.",
                "example": "en_US"
              },
              "status": {
                "type": "string",
                "description": "Form status on creation",
                "example": "ACTIVE"
              },
              "createdTime": {
                "type": "string",
                "description": "Creation time in the Facebook timestamp format, not the ISO-8601 a draft returns",
                "example": "2026-08-20T02:29:14+0000"
              },
              "questions": {
                "description": "Questions as Meta stored them, each with a Facebook question id and a resolved label",
                "example": [
                  {
                    "id": "1751700749315902",
                    "key": "full_name",
                    "label": "What is your name?",
                    "type": "CUSTOM",
                    "options": [
                      {
                        "key": "Option 1",
                        "value": "Option 1"
                      }
                    ]
                  }
                ],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Facebook question id",
                      "example": "1751700749315902"
                    },
                    "key": {
                      "type": "string",
                      "description": "Field key the answer is delivered under. Prefilled question types use a fixed key (`full_name`, `email`, `phone`); `CUSTOM` questions get a key derived from the label.",
                      "example": "full_name"
                    },
                    "label": {
                      "type": "string",
                      "description": "Question text shown to the user",
                      "example": "What is your name?"
                    },
                    "type": {
                      "type": "string",
                      "description": "Question type. `CUSTOM` is a free-text or multiple-choice question authored on the form; every other value is a Facebook prefilled field.",
                      "example": "CUSTOM"
                    },
                    "options": {
                      "description": "Choices, present only on multiple-choice questions",
                      "example": [
                        {
                          "key": "Option 1",
                          "value": "Option 1"
                        }
                      ],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string",
                            "description": "Option key",
                            "example": "Option 1"
                          },
                          "value": {
                            "type": "string",
                            "description": "Option display value",
                            "example": "Option 1"
                          }
                        },
                        "required": [
                          "key",
                          "value"
                        ],
                        "title": "FacebookLeadFormQuestionOptionDTO"
                      }
                    }
                  },
                  "required": [
                    "id",
                    "key",
                    "label",
                    "type"
                  ],
                  "title": "FacebookPublishedLeadFormQuestionDTO"
                }
              }
            },
            "required": [
              "id",
              "name",
              "locale",
              "status",
              "createdTime",
              "questions"
            ],
            "title": "FacebookCreatedLeadFormDTO"
          }
        ]
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      },
      "InternalServerErrorDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "description": "HTTP status code for an unexpected server error",
            "example": 500
          },
          "message": {
            "type": "string",
            "description": "Error message describing the server failure",
            "example": "Internal Server Error"
          }
        },
        "title": "InternalServerErrorDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X POST 'https://services.leadconnectorhq.com/ad-publishing/facebook/page/<pageId>/forms' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v4' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "type": "MORE_VOLUME",
  "name": "Contact Form",
  "locationId": "loc_abc123",
  "greetingCard": {
    "title": "Welcome!",
    "style": "LIST_STYLE",
    "content": [
      "Learn more about our services"
    ]
  },
  "questions": [
    {
      "key": "full_name",
      "type": "FULL_NAME"
    },
    {
      "key": "email_address",
      "type": "EMAIL"
    },
    {
      "key": "preferred_time",
      "type": "CUSTOM",
      "options": [
        {
          "key": "morning",
          "value": "Morning"
        },
        {
          "key": "evening",
          "value": "Evening"
        }
      ]
    },
    {
      "key": "are_you_interested",
      "label": "Are you interested?",
      "type": "CUSTOM",
      "options": [
        {
          "value": "Yes"
        },
        {
          "value": "No"
        }
      ]
    }
  ],
  "questionPageHeadline": "Tell us about yourself",
  "privacyPolicyLink": "https://example.com/privacy",
  "privacyPolicyText": "We respect your privacy",
  "customDisclaimer": {
    "title": "Terms & Conditions",
    "body": "By submitting...",
    "checkboxes": [
      {
        "isRequired": true,
        "text": "I agree",
        "key": "terms"
      }
    ]
  },
  "thankYouPage": {
    "title": "Thank You!",
    "body": "We will contact you soon",
    "buttonText": "Visit Website",
    "buttonType": "VIEW_WEBSITE",
    "buttonLink": "https://example.com"
  },
  "isDraft": true,
  "draftFormId": "1234567890",
  "locale": "EN_US"
}'
```

**Node.js**

```javascript
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v4',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "type": "MORE_VOLUME",
      "name": "Contact Form",
      "locationId": "loc_abc123",
      "greetingCard": {
        "title": "Welcome!",
        "style": "LIST_STYLE",
        "content": [
          "Learn more about our services"
        ]
      },
      "questions": [
        {
          "key": "full_name",
          "type": "FULL_NAME"
        },
        {
          "key": "email_address",
          "type": "EMAIL"
        },
        {
          "key": "preferred_time",
          "type": "CUSTOM",
          "options": [
            {
              "key": "morning",
              "value": "Morning"
            },
            {
              "key": "evening",
              "value": "Evening"
            }
          ]
        },
        {
          "key": "are_you_interested",
          "label": "Are you interested?",
          "type": "CUSTOM",
          "options": [
            {
              "value": "Yes"
            },
            {
              "value": "No"
            }
          ]
        }
      ],
      "questionPageHeadline": "Tell us about yourself",
      "privacyPolicyLink": "https://example.com/privacy",
      "privacyPolicyText": "We respect your privacy",
      "customDisclaimer": {
        "title": "Terms & Conditions",
        "body": "By submitting...",
        "checkboxes": [
          {
            "isRequired": true,
            "text": "I agree",
            "key": "terms"
          }
        ]
      },
      "thankYouPage": {
        "title": "Thank You!",
        "body": "We will contact you soon",
        "buttonText": "Visit Website",
        "buttonType": "VIEW_WEBSITE",
        "buttonLink": "https://example.com"
      },
      "isDraft": true,
      "draftFormId": "1234567890",
      "locale": "EN_US"
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/facebook/page/<pageId>/forms', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/ad-publishing/facebook/page/{pageId}/forms"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v4"
}

payload = {
    "type": "MORE_VOLUME",
    "name": "Contact Form",
    "locationId": "loc_abc123",
    "greetingCard": {
        "title": "Welcome!",
        "style": "LIST_STYLE",
        "content": [
            "Learn more about our services"
        ]
    },
    "questions": [
        {
            "key": "full_name",
            "type": "FULL_NAME"
        },
        {
            "key": "email_address",
            "type": "EMAIL"
        },
        {
            "key": "preferred_time",
            "type": "CUSTOM",
            "options": [
                {
                    "key": "morning",
                    "value": "Morning"
                },
                {
                    "key": "evening",
                    "value": "Evening"
                }
            ]
        },
        {
            "key": "are_you_interested",
            "label": "Are you interested?",
            "type": "CUSTOM",
            "options": [
                {
                    "value": "Yes"
                },
                {
                    "value": "No"
                }
            ]
        }
    ],
    "questionPageHeadline": "Tell us about yourself",
    "privacyPolicyLink": "https://example.com/privacy",
    "privacyPolicyText": "We respect your privacy",
    "customDisclaimer": {
        "title": "Terms & Conditions",
        "body": "By submitting...",
        "checkboxes": [
            {
                "isRequired": true,
                "text": "I agree",
                "key": "terms"
            }
        ]
    },
    "thankYouPage": {
        "title": "Thank You!",
        "body": "We will contact you soon",
        "buttonText": "Visit Website",
        "buttonType": "VIEW_WEBSITE",
        "buttonLink": "https://example.com"
    },
    "isDraft": true,
    "draftFormId": "1234567890",
    "locale": "EN_US"
}

response = requests.post(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/ad-publishing/facebook/page/<pageId>/forms',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v4',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "type": "MORE_VOLUME",
  "name": "Contact Form",
  "locationId": "loc_abc123",
  "greetingCard": {
    "title": "Welcome!",
    "style": "LIST_STYLE",
    "content": [
      "Learn more about our services"
    ]
  },
  "questions": [
    {
      "key": "full_name",
      "type": "FULL_NAME"
    },
    {
      "key": "email_address",
      "type": "EMAIL"
    },
    {
      "key": "preferred_time",
      "type": "CUSTOM",
      "options": [
        {
          "key": "morning",
          "value": "Morning"
        },
        {
          "key": "evening",
          "value": "Evening"
        }
      ]
    },
    {
      "key": "are_you_interested",
      "label": "Are you interested?",
      "type": "CUSTOM",
      "options": [
        {
          "value": "Yes"
        },
        {
          "value": "No"
        }
      ]
    }
  ],
  "questionPageHeadline": "Tell us about yourself",
  "privacyPolicyLink": "https://example.com/privacy",
  "privacyPolicyText": "We respect your privacy",
  "customDisclaimer": {
    "title": "Terms & Conditions",
    "body": "By submitting...",
    "checkboxes": [
      {
        "isRequired": true,
        "text": "I agree",
        "key": "terms"
      }
    ]
  },
  "thankYouPage": {
    "title": "Thank You!",
    "body": "We will contact you soon",
    "buttonText": "Visit Website",
    "buttonType": "VIEW_WEBSITE",
    "buttonLink": "https://example.com"
  },
  "isDraft": true,
  "draftFormId": "1234567890",
  "locale": "EN_US"
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .post("https://services.leadconnectorhq.com/ad-publishing/facebook/page/<pageId>/forms")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v4")
  .header("Content-Type", "application/json")
  .body("{\"type\":\"MORE_VOLUME\",\"name\":\"Contact Form\",\"locationId\":\"loc_abc123\",\"greetingCard\":{\"title\":\"Welcome!\",\"style\":\"LIST_STYLE\",\"content\":[\"Learn more about our services\"]},\"questions\":[{\"key\":\"full_name\",\"type\":\"FULL_NAME\"},{\"key\":\"email_address\",\"type\":\"EMAIL\"},{\"key\":\"preferred_time\",\"type\":\"CUSTOM\",\"options\":[{\"key\":\"morning\",\"value\":\"Morning\"},{\"key\":\"evening\",\"value\":\"Evening\"}]},{\"key\":\"are_you_interested\",\"label\":\"Are you interested?\",\"type\":\"CUSTOM\",\"options\":[{\"value\":\"Yes\"},{\"value\":\"No\"}]}],\"questionPageHeadline\":\"Tell us about yourself\",\"privacyPolicyLink\":\"https://example.com/privacy\",\"privacyPolicyText\":\"We respect your privacy\",\"customDisclaimer\":{\"title\":\"Terms & Conditions\",\"body\":\"By submitting...\",\"checkboxes\":[{\"isRequired\":true,\"text\":\"I agree\",\"key\":\"terms\"}]},\"thankYouPage\":{\"title\":\"Thank You!\",\"body\":\"We will contact you soon\",\"buttonText\":\"Visit Website\",\"buttonType\":\"VIEW_WEBSITE\",\"buttonLink\":\"https://example.com\"},\"isDraft\":true,\"draftFormId\":\"1234567890\",\"locale\":\"EN_US\"}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/ad-publishing/facebook/page/<pageId>/forms"
  payload := strings.NewReader(`{
  "type": "MORE_VOLUME",
  "name": "Contact Form",
  "locationId": "loc_abc123",
  "greetingCard": {
    "title": "Welcome!",
    "style": "LIST_STYLE",
    "content": [
      "Learn more about our services"
    ]
  },
  "questions": [
    {
      "key": "full_name",
      "type": "FULL_NAME"
    },
    {
      "key": "email_address",
      "type": "EMAIL"
    },
    {
      "key": "preferred_time",
      "type": "CUSTOM",
      "options": [
        {
          "key": "morning",
          "value": "Morning"
        },
        {
          "key": "evening",
          "value": "Evening"
        }
      ]
    },
    {
      "key": "are_you_interested",
      "label": "Are you interested?",
      "type": "CUSTOM",
      "options": [
        {
          "value": "Yes"
        },
        {
          "value": "No"
        }
      ]
    }
  ],
  "questionPageHeadline": "Tell us about yourself",
  "privacyPolicyLink": "https://example.com/privacy",
  "privacyPolicyText": "We respect your privacy",
  "customDisclaimer": {
    "title": "Terms & Conditions",
    "body": "By submitting...",
    "checkboxes": [
      {
        "isRequired": true,
        "text": "I agree",
        "key": "terms"
      }
    ]
  },
  "thankYouPage": {
    "title": "Thank You!",
    "body": "We will contact you soon",
    "buttonText": "Visit Website",
    "buttonType": "VIEW_WEBSITE",
    "buttonLink": "https://example.com"
  },
  "isDraft": true,
  "draftFormId": "1234567890",
  "locale": "EN_US"
}`)
  req, _ := http.NewRequest("POST", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v4")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/ad-publishing/facebook/page/<pageId>/forms")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v4"
request["Content-Type"] = "application/json"
request.body = '{
  "type": "MORE_VOLUME",
  "name": "Contact Form",
  "locationId": "loc_abc123",
  "greetingCard": {
    "title": "Welcome!",
    "style": "LIST_STYLE",
    "content": [
      "Learn more about our services"
    ]
  },
  "questions": [
    {
      "key": "full_name",
      "type": "FULL_NAME"
    },
    {
      "key": "email_address",
      "type": "EMAIL"
    },
    {
      "key": "preferred_time",
      "type": "CUSTOM",
      "options": [
        {
          "key": "morning",
          "value": "Morning"
        },
        {
          "key": "evening",
          "value": "Evening"
        }
      ]
    },
    {
      "key": "are_you_interested",
      "label": "Are you interested?",
      "type": "CUSTOM",
      "options": [
        {
          "value": "Yes"
        },
        {
          "value": "No"
        }
      ]
    }
  ],
  "questionPageHeadline": "Tell us about yourself",
  "privacyPolicyLink": "https://example.com/privacy",
  "privacyPolicyText": "We respect your privacy",
  "customDisclaimer": {
    "title": "Terms & Conditions",
    "body": "By submitting...",
    "checkboxes": [
      {
        "isRequired": true,
        "text": "I agree",
        "key": "terms"
      }
    ]
  },
  "thankYouPage": {
    "title": "Thank You!",
    "body": "We will contact you soon",
    "buttonText": "Visit Website",
    "buttonType": "VIEW_WEBSITE",
    "buttonLink": "https://example.com"
  },
  "isDraft": true,
  "draftFormId": "1234567890",
  "locale": "EN_US"
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v4"
}

$body = '{
  "type": "MORE_VOLUME",
  "name": "Contact Form",
  "locationId": "loc_abc123",
  "greetingCard": {
    "title": "Welcome!",
    "style": "LIST_STYLE",
    "content": [
      "Learn more about our services"
    ]
  },
  "questions": [
    {
      "key": "full_name",
      "type": "FULL_NAME"
    },
    {
      "key": "email_address",
      "type": "EMAIL"
    },
    {
      "key": "preferred_time",
      "type": "CUSTOM",
      "options": [
        {
          "key": "morning",
          "value": "Morning"
        },
        {
          "key": "evening",
          "value": "Evening"
        }
      ]
    },
    {
      "key": "are_you_interested",
      "label": "Are you interested?",
      "type": "CUSTOM",
      "options": [
        {
          "value": "Yes"
        },
        {
          "value": "No"
        }
      ]
    }
  ],
  "questionPageHeadline": "Tell us about yourself",
  "privacyPolicyLink": "https://example.com/privacy",
  "privacyPolicyText": "We respect your privacy",
  "customDisclaimer": {
    "title": "Terms & Conditions",
    "body": "By submitting...",
    "checkboxes": [
      {
        "isRequired": true,
        "text": "I agree",
        "key": "terms"
      }
    ]
  },
  "thankYouPage": {
    "title": "Thank You!",
    "body": "We will contact you soon",
    "buttonText": "Visit Website",
    "buttonType": "VIEW_WEBSITE",
    "buttonLink": "https://example.com"
  },
  "isDraft": true,
  "draftFormId": "1234567890",
  "locale": "EN_US"
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/ad-publishing/facebook/page/<pageId>/forms' -Method 'POST' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
