X lead generation form: name up to 255 characters, purpose 1000

X's Ads API lead generation docs cap a form name at 1 to 255 characters and its purpose at 1 to 1000. Validate copy variants before you create the form.

4 min readSume
All posts

X's lead generation documentation gives a form name of 1 to 255 characters and a purpose of 1 to 1000 characters, and requires an https:// privacy policy URL. If you draft those fields in a Sume bulk run, validate lengths and the URL scheme in code, since a schema shapes keys but not length.

Field limits

Limits from X's lead generation documentation (read 2026-10-05)
FieldRule
Form name1 to 255 characters
Purpose1 to 1000 characters
Privacy policy URLMust be https://

A validator for generated copy

Run it over every finished queue item. The page does not give limits for card titles or CTAs, so none are checked here.

def check(form: dict) -> list[str]:
    errs = []
    if not 1 <= len(form.get("name", "")) <= 255:
        errs.append("name must be 1-255 characters")
    if not 1 <= len(form.get("purpose", "")) <= 1000:
        errs.append("purpose must be 1-1000 characters")
    if not form.get("privacy_policy_url", "").startswith("https://"):
        errs.append("privacy policy URL must start with https://")
    return errs

print(check({"name": "Demo request", "purpose": "Get a demo.", "privacy_policy_url": "https://example.com/privacy"}))
print(check({"name": "", "purpose": "x" * 1001, "privacy_policy_url": "http://example.com"}))

Next step

Resubmit only failing items; a failed or canceled item keeps its index in the queue receipt.

Sources

Related posts

More in Use cases

All Use cases posts

Written by Sume