# Create lead form

POST https://services.leadconnectorhq.com/ad-publishing/linkedin/accounts/{accountId}/form

Create a new LinkedIn lead gen form for the ad account named in the path. v4 successor to POST /ad-publishing/linkedin/{accountId}/form, where the owning account moves out of the request body and into the URL.

## 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 |
|------|------|----------|-------------|
| `accountId` | string | Yes | Account identifier |

### Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `locationId` | string | Yes | Location identifier |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "v4"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/ad-publishing/linkedin/accounts/{accountId}/form": {
      "post": {
        "summary": "Create lead form",
        "operationId": "createLeadForm",
        "description": "Create a new LinkedIn lead gen form for the ad account named in the path. v4 successor to POST /ad-publishing/linkedin/{accountId}/form, where the owning account moves out of the request body and into the URL.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v4"
              ]
            }
          },
          {
            "name": "accountId",
            "required": true,
            "in": "path",
            "description": "Account identifier",
            "schema": {
              "example": "12345678",
              "type": "string"
            }
          },
          {
            "name": "locationId",
            "required": true,
            "in": "query",
            "description": "Location identifier",
            "schema": {
              "example": "HChooFuiyPpVYzeJ4HMe",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkedInCreateLeadFormV4BodyDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created lead form. Same shape as a list entry, minus `reviewInfo` until LinkedIn reviews it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkedInLeadFormDTO"
                }
              }
            }
          },
          "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": {
      "LinkedInCreateLeadFormV4BodyDTO": {
        "type": "object",
        "properties": {
          "creationLocale": {
            "description": "Creation locale",
            "example": {
              "country": "US",
              "language": "en"
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "country": {
                    "type": "string",
                    "description": "Country code",
                    "example": "US"
                  },
                  "language": {
                    "type": "string",
                    "description": "Language code",
                    "example": "en"
                  }
                },
                "required": [
                  "country",
                  "language"
                ],
                "title": "CreationLocaleDTO"
              }
            ]
          },
          "name": {
            "type": "string",
            "description": "Form name",
            "example": "Contact Us"
          },
          "state": {
            "type": "string",
            "description": "Form state",
            "enum": [
              "PUBLISHED"
            ],
            "example": "PUBLISHED"
          },
          "content": {
            "description": "Form content",
            "example": {
              "questions": [
                {
                  "name": "lastName",
                  "label": "Last name",
                  "responseRequired": true,
                  "predefinedField": "LAST_NAME"
                }
              ],
              "headline": {
                "localized": {
                  "en_US": "Get in touch"
                }
              },
              "postSubmissionInfo": {},
              "legalInfo": {}
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "questions": {
                    "description": "Form questions",
                    "example": [
                      {
                        "question": {
                          "localized": {
                            "en_US": "First name"
                          }
                        },
                        "name": "firstName",
                        "questionDetails": {
                          "textQuestionDetails": {}
                        }
                      }
                    ],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "description": "Question text",
                          "example": {
                            "localized": {
                              "en_US": "What is your first name?"
                            }
                          },
                          "allOf": [
                            {
                              "type": "object",
                              "properties": {
                                "localized": {
                                  "type": "object",
                                  "description": "Locale-keyed string map",
                                  "example": {
                                    "en_US": "Hello"
                                  }
                                }
                              },
                              "required": [
                                "localized"
                              ],
                              "title": "LocalizedStringDTO"
                            }
                          ]
                        },
                        "name": {
                          "type": "string",
                          "description": "Question field name",
                          "example": "firstName"
                        },
                        "questionDetails": {
                          "description": "Question type details",
                          "example": {
                            "textQuestionDetails": {}
                          },
                          "allOf": [
                            {
                              "type": "object",
                              "properties": {
                                "textQuestionDetails": {
                                  "type": "object",
                                  "description": "Text question details (empty object for text questions)",
                                  "example": {}
                                },
                                "multipleChoiceQuestionDetails": {
                                  "description": "Multiple choice question details",
                                  "example": {
                                    "options": [
                                      {
                                        "id": 1,
                                        "text": {
                                          "localized": {
                                            "en_US": "Yes"
                                          }
                                        }
                                      }
                                    ]
                                  },
                                  "allOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "options": {
                                          "description": "Choice options",
                                          "example": [
                                            {
                                              "id": 1,
                                              "text": {
                                                "localized": {
                                                  "en_US": "Yes"
                                                }
                                              }
                                            }
                                          ],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "number",
                                                "description": "Option ID",
                                                "example": 1
                                              },
                                              "text": {
                                                "description": "Option text",
                                                "example": {
                                                  "localized": {
                                                    "en_US": "Yes"
                                                  }
                                                },
                                                "allOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "localized": {
                                                        "type": "object",
                                                        "description": "Locale-keyed string map",
                                                        "example": {
                                                          "en_US": "Hello"
                                                        }
                                                      }
                                                    },
                                                    "required": [
                                                      "localized"
                                                    ],
                                                    "title": "LocalizedStringDTO"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "text"
                                            ],
                                            "title": "MultipleChoiceOptionDTO"
                                          }
                                        }
                                      },
                                      "required": [
                                        "options"
                                      ],
                                      "title": "MultipleChoiceQuestionDetailsDTO"
                                    }
                                  ]
                                }
                              },
                              "title": "QuestionDetailsDTO"
                            }
                          ]
                        },
                        "predefinedField": {
                          "type": "string",
                          "description": "Predefined field identifier",
                          "example": "FIRST_NAME"
                        }
                      },
                      "required": [
                        "question",
                        "name",
                        "questionDetails"
                      ],
                      "title": "LeadFormQuestionDTO"
                    }
                  },
                  "description": {
                    "description": "Form description",
                    "example": {
                      "localized": {
                        "en_US": "Fill out this quick form"
                      }
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "localized": {
                            "type": "object",
                            "description": "Locale-keyed string map",
                            "example": {
                              "en_US": "Hello"
                            }
                          }
                        },
                        "required": [
                          "localized"
                        ],
                        "title": "LocalizedStringDTO"
                      }
                    ]
                  },
                  "headline": {
                    "description": "Form headline",
                    "example": {
                      "localized": {
                        "en_US": "Get in touch"
                      }
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "localized": {
                            "type": "object",
                            "description": "Locale-keyed string map",
                            "example": {
                              "en_US": "Hello"
                            }
                          }
                        },
                        "required": [
                          "localized"
                        ],
                        "title": "LocalizedStringDTO"
                      }
                    ]
                  },
                  "postSubmissionInfo": {
                    "description": "Post-submission info",
                    "example": {
                      "message": {
                        "localized": {
                          "en_US": "Thank you!"
                        }
                      },
                      "callToAction": {
                        "callToActionTarget": {
                          "landingPageUrl": "https://example.com/thank-you"
                        },
                        "callToActionLabel": "LEARN_MORE"
                      }
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "message": {
                            "description": "Thank-you message",
                            "example": {
                              "localized": {
                                "en_US": "Thank you!"
                              }
                            },
                            "allOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "localized": {
                                    "type": "object",
                                    "description": "Locale-keyed string map",
                                    "example": {
                                      "en_US": "Hello"
                                    }
                                  }
                                },
                                "required": [
                                  "localized"
                                ],
                                "title": "LocalizedStringDTO"
                              }
                            ]
                          },
                          "callToAction": {
                            "description": "Post-submission call to action",
                            "example": {
                              "callToActionTarget": {
                                "landingPageUrl": "https://example.com/thank-you"
                              },
                              "callToActionLabel": "LEARN_MORE"
                            },
                            "allOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "callToActionTarget": {
                                    "description": "Call to action target",
                                    "example": {
                                      "landingPageUrl": "https://example.com/thank-you"
                                    },
                                    "allOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "landingPageUrl": {
                                            "type": "string",
                                            "description": "Landing page URL",
                                            "example": "https://example.com/thank-you"
                                          }
                                        },
                                        "required": [
                                          "landingPageUrl"
                                        ],
                                        "title": "PostSubmissionCallToActionTargetDTO"
                                      }
                                    ]
                                  },
                                  "callToActionLabel": {
                                    "type": "string",
                                    "description": "Call to action label",
                                    "enum": [
                                      "VISIT_COMPANY_WEBSITE",
                                      "DOWNLOAD_NOW",
                                      "TRY_NOW",
                                      "VIEW_NOW",
                                      "LEARN_MORE"
                                    ],
                                    "example": "LEARN_MORE"
                                  }
                                },
                                "required": [
                                  "callToActionTarget",
                                  "callToActionLabel"
                                ],
                                "title": "PostSubmissionCallToActionDTO"
                              }
                            ]
                          }
                        },
                        "required": [
                          "message",
                          "callToAction"
                        ],
                        "title": "PostSubmissionInfoDTO"
                      }
                    ]
                  },
                  "legalInfo": {
                    "description": "Legal information",
                    "example": {
                      "consents": [
                        {
                          "checkRequired": true,
                          "id": 1,
                          "consent": {
                            "localized": {
                              "en_US": "I agree"
                            }
                          }
                        }
                      ],
                      "privacyPolicyUrl": "https://example.com/privacy"
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "consents": {
                            "description": "Consent entries",
                            "example": [
                              {
                                "checkRequired": true,
                                "id": 1,
                                "consent": {
                                  "localized": {
                                    "en_US": "I agree to terms"
                                  }
                                }
                              }
                            ],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "checkRequired": {
                                  "type": "boolean",
                                  "description": "Whether consent checkbox is required",
                                  "example": true
                                },
                                "id": {
                                  "type": "number",
                                  "description": "Consent identifier",
                                  "example": 1
                                },
                                "consent": {
                                  "description": "Consent text",
                                  "example": {
                                    "localized": {
                                      "en_US": "I agree to receive marketing communications"
                                    }
                                  },
                                  "allOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "localized": {
                                          "type": "object",
                                          "description": "Locale-keyed string map",
                                          "example": {
                                            "en_US": "Hello"
                                          }
                                        }
                                      },
                                      "required": [
                                        "localized"
                                      ],
                                      "title": "LocalizedStringDTO"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "checkRequired",
                                "id",
                                "consent"
                              ],
                              "title": "ConsentDTO"
                            }
                          },
                          "privacyPolicyUrl": {
                            "type": "string",
                            "description": "Privacy policy URL",
                            "example": "https://example.com/privacy"
                          },
                          "legalDisclaimer": {
                            "description": "Legal disclaimer text",
                            "example": {
                              "localized": {
                                "en_US": "By submitting, you accept our Privacy Policy"
                              }
                            },
                            "allOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "localized": {
                                    "type": "object",
                                    "description": "Locale-keyed string map",
                                    "example": {
                                      "en_US": "Hello"
                                    }
                                  }
                                },
                                "required": [
                                  "localized"
                                ],
                                "title": "LocalizedStringDTO"
                              }
                            ]
                          }
                        },
                        "required": [
                          "consents",
                          "privacyPolicyUrl"
                        ],
                        "title": "LegalInfoDTO"
                      }
                    ]
                  }
                },
                "required": [
                  "questions",
                  "headline",
                  "postSubmissionInfo",
                  "legalInfo"
                ],
                "title": "LeadFormContentDTO"
              }
            ]
          },
          "hiddenFields": {
            "description": "Hidden fields",
            "example": [
              {
                "name": "utm_source",
                "value": "linkedin"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Field name",
                  "example": "utm_source"
                },
                "value": {
                  "type": "string",
                  "description": "Field value",
                  "example": "linkedin"
                }
              },
              "required": [
                "name",
                "value"
              ],
              "title": "HiddenFieldDTO"
            }
          }
        },
        "required": [
          "creationLocale",
          "name",
          "state",
          "content"
        ],
        "title": "LinkedInCreateLeadFormV4BodyDTO"
      },
      "LinkedInLeadFormDTO": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Form id. Returned as a number.",
            "example": 1025914010
          },
          "name": {
            "type": "string",
            "description": "Form name",
            "example": "Q3 demand generation form"
          },
          "state": {
            "type": "string",
            "description": "Form lifecycle state",
            "example": "PUBLISHED"
          },
          "versionId": {
            "type": "number",
            "description": "Version of the form definition",
            "example": 1
          },
          "created": {
            "type": "number",
            "description": "When the form was created, epoch milliseconds",
            "example": 1787056838757
          },
          "lastModified": {
            "type": "number",
            "description": "When the form was last modified, epoch milliseconds",
            "example": 1787057842322
          },
          "creationLocale": {
            "description": "Locale the form was authored in",
            "example": {
              "country": "US",
              "language": "en"
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "country": {
                    "type": "string",
                    "description": "Two-letter country code",
                    "example": "US"
                  },
                  "language": {
                    "type": "string",
                    "description": "Two-letter language code",
                    "example": "en"
                  }
                },
                "required": [
                  "country",
                  "language"
                ],
                "title": "LinkedInLocaleDTO"
              }
            ]
          },
          "owner": {
            "description": "Account that owns the form",
            "example": {
              "sponsoredAccount": "urn:li:sponsoredAccount:556129919"
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "sponsoredAccount": {
                    "type": "string",
                    "description": "Sponsored account URN that owns the form",
                    "example": "urn:li:sponsoredAccount:556129919"
                  }
                },
                "required": [
                  "sponsoredAccount"
                ],
                "title": "LinkedInFormOwnerDTO"
              }
            ]
          },
          "reviewInfo": {
            "description": "LinkedIn review outcome. Absent on a form that has just been created and not yet reviewed; present on reads.",
            "example": {
              "reviewStatus": "REJECTED",
              "rejectionReasons": [
                "MISSING_PRIVACY_POLICY",
                "NONFUNCTIONAL_SITE"
              ],
              "lastUpdated": 1787057842315
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "reviewStatus": {
                    "type": "string",
                    "description": "Review outcome",
                    "enum": [
                      "AUTO_APPROVED",
                      "NEEDS_REVIEW",
                      "REJECTED",
                      "APPROVED"
                    ],
                    "example": "REJECTED"
                  },
                  "rejectionReasons": {
                    "description": "Why the form was rejected. Empty array when it was not.",
                    "example": [
                      "MISSING_PRIVACY_POLICY",
                      "NONFUNCTIONAL_SITE"
                    ],
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "lastUpdated": {
                    "type": "number",
                    "description": "When the review last changed, epoch milliseconds",
                    "example": 1787057842315
                  }
                },
                "required": [
                  "reviewStatus",
                  "rejectionReasons",
                  "lastUpdated"
                ],
                "title": "LinkedInFormReviewInfoDTO"
              }
            ]
          },
          "hiddenFields": {
            "description": "Hidden fields submitted alongside the lead. Empty array when none.",
            "example": [
              {
                "name": "utm_source",
                "value": "linkedin"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Field name",
                  "example": "utm_source"
                },
                "value": {
                  "type": "string",
                  "description": "Field value submitted with the lead",
                  "example": "linkedin"
                }
              },
              "required": [
                "name",
                "value"
              ],
              "title": "LinkedInFormHiddenFieldDTO"
            }
          },
          "content": {
            "description": "Form definition",
            "example": {
              "headline": {
                "localized": {
                  "en_US": "Hi there, good to see you here!"
                }
              },
              "description": {
                "localized": {
                  "en_US": "Hi there, good to see you here!"
                }
              },
              "questions": [
                {
                  "questionId": 20711780444,
                  "question": {
                    "localized": {
                      "en_US": "Hi there, good to see you here!"
                    }
                  },
                  "name": "lastName",
                  "label": "Last name",
                  "responseRequired": true,
                  "responseEditable": true,
                  "predefinedField": "LAST_NAME",
                  "questionDetails": {
                    "textQuestionDetails": {
                      "maxResponseLength": 300
                    },
                    "multipleChoiceQuestionDetails": {
                      "options": [
                        {
                          "id": 0,
                          "label": "Option 1",
                          "text": {
                            "localized": {
                              "en_US": "Hi there, good to see you here!"
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              ],
              "postSubmissionInfo": {
                "message": {
                  "localized": {
                    "en_US": "Hi there, good to see you here!"
                  }
                },
                "callToAction": {
                  "callToActionLabel": "VISIT_COMPANY_WEBSITE",
                  "callToActionTarget": {
                    "landingPageUrl": "https://example.com"
                  }
                }
              },
              "legalInfo": {
                "legalInfoId": 2873998916,
                "privacyPolicyUrl": "https://example.com/privacy",
                "consents": [
                  {
                    "id": 1,
                    "label": "I agree to be contacted",
                    "checkRequired": true,
                    "consent": {
                      "localized": {
                        "en_US": "Hi there, good to see you here!"
                      }
                    }
                  }
                ],
                "legalDisclaimer": {
                  "localized": {
                    "en_US": "Hi there, good to see you here!"
                  }
                }
              }
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "headline": {
                    "description": "Localised form headline",
                    "example": {
                      "localized": {
                        "en_US": "Hi there, good to see you here!"
                      }
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "localized": {
                            "type": "object",
                            "description": "Text keyed by locale, e.g. `en_US`. Keys depend on the form locale.",
                            "additionalProperties": {
                              "type": "string"
                            },
                            "example": {
                              "en_US": "Hi there, good to see you here!"
                            }
                          }
                        },
                        "required": [
                          "localized"
                        ],
                        "title": "LinkedInLocalizedTextDTO"
                      }
                    ]
                  },
                  "description": {
                    "description": "Localised form description",
                    "example": {
                      "localized": {
                        "en_US": "Hi there, good to see you here!"
                      }
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "localized": {
                            "type": "object",
                            "description": "Text keyed by locale, e.g. `en_US`. Keys depend on the form locale.",
                            "additionalProperties": {
                              "type": "string"
                            },
                            "example": {
                              "en_US": "Hi there, good to see you here!"
                            }
                          }
                        },
                        "required": [
                          "localized"
                        ],
                        "title": "LinkedInLocalizedTextDTO"
                      }
                    ]
                  },
                  "questions": {
                    "description": "Form questions in display order",
                    "example": [
                      {
                        "questionId": 20711780444,
                        "question": {
                          "localized": {
                            "en_US": "Hi there, good to see you here!"
                          }
                        },
                        "name": "lastName",
                        "label": "Last name",
                        "responseRequired": true,
                        "responseEditable": true,
                        "predefinedField": "LAST_NAME",
                        "questionDetails": {
                          "textQuestionDetails": {
                            "maxResponseLength": 300
                          },
                          "multipleChoiceQuestionDetails": {
                            "options": [
                              {
                                "id": 0,
                                "label": "Option 1",
                                "text": {
                                  "localized": {
                                    "en_US": "Hi there, good to see you here!"
                                  }
                                }
                              }
                            ]
                          }
                        }
                      }
                    ],
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "questionId": {
                          "type": "number",
                          "description": "LinkedIn question id",
                          "example": 20711780444
                        },
                        "question": {
                          "description": "Localised question text",
                          "example": {
                            "localized": {
                              "en_US": "Hi there, good to see you here!"
                            }
                          },
                          "allOf": [
                            {
                              "type": "object",
                              "properties": {
                                "localized": {
                                  "type": "object",
                                  "description": "Text keyed by locale, e.g. `en_US`. Keys depend on the form locale.",
                                  "additionalProperties": {
                                    "type": "string"
                                  },
                                  "example": {
                                    "en_US": "Hi there, good to see you here!"
                                  }
                                }
                              },
                              "required": [
                                "localized"
                              ],
                              "title": "LinkedInLocalizedTextDTO"
                            }
                          ]
                        },
                        "name": {
                          "type": "string",
                          "description": "Machine name for the field",
                          "example": "lastName"
                        },
                        "label": {
                          "type": "string",
                          "description": "Label shown next to the field",
                          "example": "Last name"
                        },
                        "responseRequired": {
                          "type": "boolean",
                          "description": "Whether the member must answer",
                          "example": true
                        },
                        "responseEditable": {
                          "type": "boolean",
                          "description": "Whether the member can edit a prefilled answer",
                          "example": true
                        },
                        "predefinedField": {
                          "type": "string",
                          "description": "LinkedIn profile field the answer is prefilled from, e.g. `EMAIL`, `JOB_TITLE`. Absent for custom questions.",
                          "example": "LAST_NAME"
                        },
                        "questionDetails": {
                          "description": "Type-specific configuration",
                          "example": {
                            "textQuestionDetails": {
                              "maxResponseLength": 300
                            },
                            "multipleChoiceQuestionDetails": {
                              "options": [
                                {
                                  "id": 0,
                                  "label": "Option 1",
                                  "text": {
                                    "localized": {
                                      "en_US": "Hi there, good to see you here!"
                                    }
                                  }
                                }
                              ]
                            }
                          },
                          "allOf": [
                            {
                              "type": "object",
                              "properties": {
                                "textQuestionDetails": {
                                  "description": "Present for free-text questions",
                                  "example": {
                                    "maxResponseLength": 300
                                  },
                                  "allOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "maxResponseLength": {
                                          "type": "number",
                                          "description": "Maximum characters accepted",
                                          "example": 300
                                        }
                                      },
                                      "required": [
                                        "maxResponseLength"
                                      ],
                                      "title": "LinkedInFormTextQuestionDetailsDTO"
                                    }
                                  ]
                                },
                                "multipleChoiceQuestionDetails": {
                                  "description": "Present for multiple-choice questions",
                                  "example": {
                                    "options": [
                                      {
                                        "id": 0,
                                        "label": "Option 1",
                                        "text": {
                                          "localized": {
                                            "en_US": "Hi there, good to see you here!"
                                          }
                                        }
                                      }
                                    ]
                                  },
                                  "allOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "options": {
                                          "description": "Selectable options",
                                          "example": [
                                            {
                                              "id": 0,
                                              "label": "Option 1",
                                              "text": {
                                                "localized": {
                                                  "en_US": "Hi there, good to see you here!"
                                                }
                                              }
                                            }
                                          ],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "number",
                                                "description": "Zero-based option index",
                                                "example": 0
                                              },
                                              "label": {
                                                "type": "string",
                                                "description": "Option label",
                                                "example": "Option 1"
                                              },
                                              "text": {
                                                "description": "Localised option text",
                                                "example": {
                                                  "localized": {
                                                    "en_US": "Hi there, good to see you here!"
                                                  }
                                                },
                                                "allOf": [
                                                  {
                                                    "type": "object",
                                                    "properties": {
                                                      "localized": {
                                                        "type": "object",
                                                        "description": "Text keyed by locale, e.g. `en_US`. Keys depend on the form locale.",
                                                        "additionalProperties": {
                                                          "type": "string"
                                                        },
                                                        "example": {
                                                          "en_US": "Hi there, good to see you here!"
                                                        }
                                                      }
                                                    },
                                                    "required": [
                                                      "localized"
                                                    ],
                                                    "title": "LinkedInLocalizedTextDTO"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "label",
                                              "text"
                                            ],
                                            "title": "LinkedInFormChoiceOptionDTO"
                                          }
                                        }
                                      },
                                      "required": [
                                        "options"
                                      ],
                                      "title": "LinkedInFormMultipleChoiceDetailsDTO"
                                    }
                                  ]
                                }
                              },
                              "title": "LinkedInFormQuestionDetailsDTO"
                            }
                          ]
                        }
                      },
                      "required": [
                        "questionId",
                        "question",
                        "name",
                        "label",
                        "responseRequired",
                        "responseEditable",
                        "questionDetails"
                      ],
                      "title": "LinkedInFormQuestionDTO"
                    }
                  },
                  "postSubmissionInfo": {
                    "description": "What happens after submission",
                    "example": {
                      "message": {
                        "localized": {
                          "en_US": "Hi there, good to see you here!"
                        }
                      },
                      "callToAction": {
                        "callToActionLabel": "VISIT_COMPANY_WEBSITE",
                        "callToActionTarget": {
                          "landingPageUrl": "https://example.com"
                        }
                      }
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "message": {
                            "description": "Localised thank-you message",
                            "example": {
                              "localized": {
                                "en_US": "Hi there, good to see you here!"
                              }
                            },
                            "allOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "localized": {
                                    "type": "object",
                                    "description": "Text keyed by locale, e.g. `en_US`. Keys depend on the form locale.",
                                    "additionalProperties": {
                                      "type": "string"
                                    },
                                    "example": {
                                      "en_US": "Hi there, good to see you here!"
                                    }
                                  }
                                },
                                "required": [
                                  "localized"
                                ],
                                "title": "LinkedInLocalizedTextDTO"
                              }
                            ]
                          },
                          "callToAction": {
                            "description": "Follow-up action offered after submission",
                            "example": {
                              "callToActionLabel": "VISIT_COMPANY_WEBSITE",
                              "callToActionTarget": {
                                "landingPageUrl": "https://example.com"
                              }
                            },
                            "allOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "callToActionLabel": {
                                    "type": "string",
                                    "description": "Button label",
                                    "example": "VISIT_COMPANY_WEBSITE"
                                  },
                                  "callToActionTarget": {
                                    "description": "Button destination",
                                    "example": {
                                      "landingPageUrl": "https://example.com"
                                    },
                                    "allOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "landingPageUrl": {
                                            "type": "string",
                                            "description": "Where the member is sent after submitting",
                                            "example": "https://example.com"
                                          }
                                        },
                                        "required": [
                                          "landingPageUrl"
                                        ],
                                        "title": "LinkedInFormCallToActionTargetDTO"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "callToActionLabel",
                                  "callToActionTarget"
                                ],
                                "title": "LinkedInFormCallToActionDTO"
                              }
                            ]
                          }
                        },
                        "required": [
                          "message",
                          "callToAction"
                        ],
                        "title": "LinkedInFormPostSubmissionInfoDTO"
                      }
                    ]
                  },
                  "legalInfo": {
                    "description": "Privacy policy and consent configuration",
                    "example": {
                      "legalInfoId": 2873998916,
                      "privacyPolicyUrl": "https://example.com/privacy",
                      "consents": [
                        {
                          "id": 1,
                          "label": "I agree to be contacted",
                          "checkRequired": true,
                          "consent": {
                            "localized": {
                              "en_US": "Hi there, good to see you here!"
                            }
                          }
                        }
                      ],
                      "legalDisclaimer": {
                        "localized": {
                          "en_US": "Hi there, good to see you here!"
                        }
                      }
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "legalInfoId": {
                            "type": "number",
                            "description": "LinkedIn legal info id",
                            "example": 2873998916
                          },
                          "privacyPolicyUrl": {
                            "type": "string",
                            "description": "Privacy policy URL shown on the form",
                            "example": "https://example.com/privacy"
                          },
                          "consents": {
                            "description": "Custom consent checkboxes. Empty array when none.",
                            "example": [
                              {
                                "id": 1,
                                "label": "I agree to be contacted",
                                "checkRequired": true,
                                "consent": {
                                  "localized": {
                                    "en_US": "Hi there, good to see you here!"
                                  }
                                }
                              }
                            ],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "number",
                                  "description": "Consent id within the form",
                                  "example": 1
                                },
                                "label": {
                                  "type": "string",
                                  "description": "Consent label",
                                  "example": "I agree to be contacted"
                                },
                                "checkRequired": {
                                  "type": "boolean",
                                  "description": "Whether the member must tick the box to submit",
                                  "example": true
                                },
                                "consent": {
                                  "description": "Localised consent text",
                                  "example": {
                                    "localized": {
                                      "en_US": "Hi there, good to see you here!"
                                    }
                                  },
                                  "allOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "localized": {
                                          "type": "object",
                                          "description": "Text keyed by locale, e.g. `en_US`. Keys depend on the form locale.",
                                          "additionalProperties": {
                                            "type": "string"
                                          },
                                          "example": {
                                            "en_US": "Hi there, good to see you here!"
                                          }
                                        }
                                      },
                                      "required": [
                                        "localized"
                                      ],
                                      "title": "LinkedInLocalizedTextDTO"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "label",
                                "checkRequired",
                                "consent"
                              ],
                              "title": "LinkedInFormConsentDTO"
                            }
                          },
                          "legalDisclaimer": {
                            "description": "Optional legal disclaimer text",
                            "example": {
                              "localized": {
                                "en_US": "Hi there, good to see you here!"
                              }
                            },
                            "allOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "localized": {
                                    "type": "object",
                                    "description": "Text keyed by locale, e.g. `en_US`. Keys depend on the form locale.",
                                    "additionalProperties": {
                                      "type": "string"
                                    },
                                    "example": {
                                      "en_US": "Hi there, good to see you here!"
                                    }
                                  }
                                },
                                "required": [
                                  "localized"
                                ],
                                "title": "LinkedInLocalizedTextDTO"
                              }
                            ]
                          }
                        },
                        "required": [
                          "legalInfoId",
                          "privacyPolicyUrl",
                          "consents"
                        ],
                        "title": "LinkedInFormLegalInfoDTO"
                      }
                    ]
                  }
                },
                "required": [
                  "headline",
                  "questions",
                  "postSubmissionInfo",
                  "legalInfo"
                ],
                "title": "LinkedInFormContentDTO"
              }
            ]
          }
        },
        "title": "LinkedInLeadFormDTO"
      },
      "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/linkedin/accounts/<accountId>/form?locationId=<LOCATIONID>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v4' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "creationLocale": {
    "country": "US",
    "language": "en"
  },
  "name": "Contact Us",
  "state": "PUBLISHED",
  "content": {
    "questions": [
      {
        "name": "lastName",
        "label": "Last name",
        "responseRequired": true,
        "predefinedField": "LAST_NAME"
      }
    ],
    "headline": {
      "localized": {
        "en_US": "Get in touch"
      }
    },
    "postSubmissionInfo": {},
    "legalInfo": {}
  },
  "hiddenFields": [
    {
      "name": "utm_source",
      "value": "linkedin"
    }
  ]
}'
```

**Node.js**

```javascript
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v4',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "creationLocale": {
        "country": "US",
        "language": "en"
      },
      "name": "Contact Us",
      "state": "PUBLISHED",
      "content": {
        "questions": [
          {
            "name": "lastName",
            "label": "Last name",
            "responseRequired": true,
            "predefinedField": "LAST_NAME"
          }
        ],
        "headline": {
          "localized": {
            "en_US": "Get in touch"
          }
        },
        "postSubmissionInfo": {},
        "legalInfo": {}
      },
      "hiddenFields": [
        {
          "name": "utm_source",
          "value": "linkedin"
        }
      ]
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/linkedin/accounts/<accountId>/form?locationId=<LOCATIONID>', 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/linkedin/accounts/{accountId}/form"

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

params = {
    "locationId": "<LOCATIONID>"
}

payload = {
    "creationLocale": {
        "country": "US",
        "language": "en"
    },
    "name": "Contact Us",
    "state": "PUBLISHED",
    "content": {
        "questions": [
            {
                "name": "lastName",
                "label": "Last name",
                "responseRequired": true,
                "predefinedField": "LAST_NAME"
            }
        ],
        "headline": {
            "localized": {
                "en_US": "Get in touch"
            }
        },
        "postSubmissionInfo": {},
        "legalInfo": {}
    },
    "hiddenFields": [
        {
            "name": "utm_source",
            "value": "linkedin"
        }
    ]
}

response = requests.post(url, params=params, 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/linkedin/accounts/<accountId>/form?locationId=<LOCATIONID>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v4',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "creationLocale": {
    "country": "US",
    "language": "en"
  },
  "name": "Contact Us",
  "state": "PUBLISHED",
  "content": {
    "questions": [
      {
        "name": "lastName",
        "label": "Last name",
        "responseRequired": true,
        "predefinedField": "LAST_NAME"
      }
    ],
    "headline": {
      "localized": {
        "en_US": "Get in touch"
      }
    },
    "postSubmissionInfo": {},
    "legalInfo": {}
  },
  "hiddenFields": [
    {
      "name": "utm_source",
      "value": "linkedin"
    }
  ]
}',
]);

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

**Java**

```java
HttpResponse<String> response = Unirest
  .post("https://services.leadconnectorhq.com/ad-publishing/linkedin/accounts/<accountId>/form?locationId=<LOCATIONID>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v4")
  .header("Content-Type", "application/json")
  .body("{\"creationLocale\":{\"country\":\"US\",\"language\":\"en\"},\"name\":\"Contact Us\",\"state\":\"PUBLISHED\",\"content\":{\"questions\":[{\"name\":\"lastName\",\"label\":\"Last name\",\"responseRequired\":true,\"predefinedField\":\"LAST_NAME\"}],\"headline\":{\"localized\":{\"en_US\":\"Get in touch\"}},\"postSubmissionInfo\":{},\"legalInfo\":{}},\"hiddenFields\":[{\"name\":\"utm_source\",\"value\":\"linkedin\"}]}")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/ad-publishing/linkedin/accounts/<accountId>/form?locationId=<LOCATIONID>"
  payload := strings.NewReader(`{
  "creationLocale": {
    "country": "US",
    "language": "en"
  },
  "name": "Contact Us",
  "state": "PUBLISHED",
  "content": {
    "questions": [
      {
        "name": "lastName",
        "label": "Last name",
        "responseRequired": true,
        "predefinedField": "LAST_NAME"
      }
    ],
    "headline": {
      "localized": {
        "en_US": "Get in touch"
      }
    },
    "postSubmissionInfo": {},
    "legalInfo": {}
  },
  "hiddenFields": [
    {
      "name": "utm_source",
      "value": "linkedin"
    }
  ]
}`)
  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/linkedin/accounts/<accountId>/form?locationId=<LOCATIONID>")

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 = '{
  "creationLocale": {
    "country": "US",
    "language": "en"
  },
  "name": "Contact Us",
  "state": "PUBLISHED",
  "content": {
    "questions": [
      {
        "name": "lastName",
        "label": "Last name",
        "responseRequired": true,
        "predefinedField": "LAST_NAME"
      }
    ],
    "headline": {
      "localized": {
        "en_US": "Get in touch"
      }
    },
    "postSubmissionInfo": {},
    "legalInfo": {}
  },
  "hiddenFields": [
    {
      "name": "utm_source",
      "value": "linkedin"
    }
  ]
}'

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

**PowerShell**

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

$body = '{
  "creationLocale": {
    "country": "US",
    "language": "en"
  },
  "name": "Contact Us",
  "state": "PUBLISHED",
  "content": {
    "questions": [
      {
        "name": "lastName",
        "label": "Last name",
        "responseRequired": true,
        "predefinedField": "LAST_NAME"
      }
    ],
    "headline": {
      "localized": {
        "en_US": "Get in touch"
      }
    },
    "postSubmissionInfo": {},
    "legalInfo": {}
  },
  "hiddenFields": [
    {
      "name": "utm_source",
      "value": "linkedin"
    }
  ]
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/ad-publishing/linkedin/accounts/<accountId>/form?locationId=<LOCATIONID>' -Method 'POST' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
