← All skills
Ads API

meta-leadform-preflight

Meta lead-form preflight

Preflight checks for pushing Instant Form lead ads via API, including the misleading error 1892181 whose real cause is usually a missing token scope.

What it does

Creating Instant Form (lead gen) ads through the Marketing API fails with error 1892181, whose message says the Page has not accepted the Lead Ads Terms of Service. That message misleads: in practice the ToS is often long accepted and the real cause is the access token, not the Page.

The trap: leadgen_tos_accepted reads as false when the token lacks the pages_manage_ads scope, so the field you would naturally check to diagnose the error is corrupted by the same root cause that produced the error. This skill runs the checks in an order that cannot be fooled by that.

Quick start

Terminal
git clone https://github.com/PierreNicolasMarquez/pierce-skills.git
cp -r pierce-skills/skills/meta-leadform-preflight ~/.claude/skills/

Then in Claude Code: "run the meta-leadform-preflight skill before I push lead ads".

The full SKILL.md, with the exact API calls, lives in the pierce-skills repo. MIT-licensed, runs on your token, never phones home.

How it works

Three checks, in an order that must not be reordered, then a single verdict.

  1. 1

    Token scopes first

    Read the token's permissions and require both ads_management and pages_manage_ads with status granted. If pages_manage_ads is missing: stop. Every downstream ToS read is untrustworthy until the token is regenerated, so the skill never proceeds to step 3 and reports a false ToS failure.

  2. 2

    Find a mirror-able source ad and derive the Page

    The safest way to create a lead ad programmatically is to mirror an existing live lead ad: copy its creative structure, swap only what you need. The skill lists ads in the target campaign and reads page_id from a source ad's object_story_spec. That page, not any page you assume, is the one whose ToS matters. If the campaign holds no usable lead ad, mirroring is unavailable and a from-scratch creative, with its heavier review surface, would be required.

  3. 3

    Only now read the Page's ToS state

    Fetch leadgen_tos_accepted on that page. Because step 1 guaranteed pages_manage_ads, a false here is now a real false. The fix is one click: a Page admin accepts at facebook.com/ads/leadgen/tos.

  4. 4

    Report exactly one verdict

    ENABLED (scopes granted, source ad found, ToS accepted), BLOCKED token (missing scopes; fix by regenerating the System User token in Business Manager with pages_manage_ads, then re-run), BLOCKED no source ad (scopes fine, nothing to mirror), or BLOCKED ToS (scopes fine, leadgen_tos_accepted is false).

Caveats

  • If you go on to create ads: create new lead ads PAUSED, always. A human flips them live in Ads Manager after eyeballing the preview. Automated creation and automated activation are different risk classes; never bundle them.

  • Mirror, don't invent: copy the source ad's object_story_spec and swap only the image hash or the one field you mean to change. Everything you don't touch keeps its review status and its proven settings.

Related skills

The managed version

Pierce runs this every week on your accounts, and every action it takes is approved by you in Slack.