{"openapi":"3.1.1","info":{"title":"Landing Page API","version":"0.1.0","summary":"Landing pages for Google Search ad groups: accounts, clients, pages, publishing and leads.","description":"Build one message-matched landing page per Google Search ad group, publish it, and collect its leads.\n\n**Hosts.** Every /api route is on https://app.landingpage.sh. Live pages and the lead form post are on https://landingpage.sh. Once a client's own domain is live, its pages are at https://<domain>/<slug> and their form posts to /_lead there.\n\n**Auth.** Call the API with one of your agency's API keys: Authorization: Bearer lp_... (made in the dashboard: Account, AI assistant access). A key acts as the agency, with the same clients, accounts, pages, leads, limits and read-only rule as a person signed in, 120 requests a minute per key, and its changes are recorded as the assistant. The dashboard itself uses a session cookie (lp_session) after an email sign-in link. POST /api/ingest takes a script key in x-agency-key instead (the Google Ads script carries it; each agency has its own). Another account's ids answer 404.\n\n**MCP.** The same calls are tools on the MCP server at https://app.landingpage.sh/mcp (streamable HTTP, JSON-RPC, the same Bearer key). publish_pages publishes only with confirm: true. Guides for agents: https://landingpage.sh/skill.md and https://landingpage.sh/llms-full.txt.\n\n**Envelope.** Every JSON answer is `{ \"ok\": true, \"data\": ... }` or `{ \"ok\": false, \"error\": { \"code\", \"message\", \"fix\" } }`. code is SNAKE_CASE; fix says what to do next.\n\n**Limits.** Request bodies: 256 KB for /api writes, 8 MB for POST /api/ingest, 32 KB for the lead form. Bigger bodies get 413 PAYLOAD_TOO_LARGE.\n\n**Schemas** are generated from the server's own validation. Some checks can't be written in JSON Schema and are still enforced (400 with a plain fix): no em or en dashes in page copy, up to 5 comma-separated lead emails, https-only web addresses, phone numbers with 10 to 15 digits, no repeated extra form fields. Hand-written spots are listed in x-schema-notes.","contact":{"name":"Landing Page support","email":"hello@landingpage.sh"}},"externalDocs":{"description":"Plain-Markdown overview for AI assistants","url":"https://landingpage.sh/llms.txt"},"servers":[{"url":"https://app.landingpage.sh","description":"Dashboard and API host"}],"security":[{"apiKey":[]},{"session":[]}],"tags":[{"name":"Accounts","description":"Google Ads accounts, read by the script. Nothing is ever changed in an account."},{"name":"Clients","description":"The businesses you run ads for, with their facts, offer, tracking and lead delivery."},{"name":"Pages","description":"Build, check, edit, preview and publish pages, then export the Editor CSV."},{"name":"Text and versions","description":"Change page text by block id, as drafts. Every change is kept as a version and can be restored. Nothing here publishes."},{"name":"Domains","description":"Each client's pages on its own domain, so its ads show its own name. One DNS record per client."},{"name":"Leads","description":"Leads sent from live pages."},{"name":"Live pages","description":"Public routes on the public host."},{"name":"Account","description":"Sign-in by email link, who is signed in, usage against the plan, the script key and API keys for AI assistants."}],"paths":{"/api/script":{"get":{"operationId":"getGoogleAdsScript","summary":"Get the Google Ads script","description":"The read-only script to paste into a Google Ads account (Tools, Scripts). Its key and API address are built in, so treat it like a password. Never cached. An agency's own key is derived on the server, so every answer carries the same key; keyIncluded is false (and the script empty) only when a new key must be made first.","tags":["Accounts"],"responses":{"200":{"description":"The script.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/ScriptData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SESSION_ONLY: an API key can't read the script (it carries the script key); copy it in the dashboard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"SCRIPT_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"SCRIPT_KEYS_OFF: script keys aren't switched on yet.; KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/ingest":{"post":{"operationId":"ingestAccount","summary":"Send an account export (the Google Ads script does this)","description":"Stores the account as its latest export. For clients with autoRebuild on, pages whose ads changed are rebuilt as drafts (autoRebuilt says how many), each page at most once a day and never a draft edited by hand. Nothing is published.","tags":["Accounts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestBody"}}}},"responses":{"200":{"description":"What was stored.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/IngestData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_EXPORT: the export failed validation; message lists the fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: the x-agency-key header is missing or wrong.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"ACCOUNT_INACTIVE: the account the key belongs to is read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"ACCOUNT_CLAIMED: this Google Ads account belongs to another Landing Page account; nothing was saved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE, EXPORT_TOO_LARGE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"SCRIPT_KEYS_OFF: script keys aren't switched on yet, so this key can't be checked.; KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"ingestKey":[]}]}},"/api/accounts":{"get":{"operationId":"listAccounts","summary":"List connected Google Ads accounts","tags":["Accounts"],"responses":{"200":{"description":"Every account the script has sent.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/AccountSummary"}}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/accounts/{customerId}":{"get":{"operationId":"getAccount","summary":"Get one account export","tags":["Accounts"],"parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"string"},"description":"Google Ads customer ID, with or without dashes."}],"responses":{"200":{"description":"Campaigns, ad groups, keywords, ads, assets, conversion actions and search terms.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/AccountExport"}},"required":["ok","data"]}}}},"400":{"description":"BAD_CUSTOMER_ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"ACCOUNT_NOT_FOUND: the script has not sent this account yet.. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/clients":{"get":{"operationId":"listClients","summary":"List clients","tags":["Clients"],"responses":{"200":{"description":"Every client with its page counts.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/ClientListItem"}}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createClient","summary":"Add a client","tags":["Clients"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClientBody"}}}},"responses":{"201":{"description":"The new client.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/Client"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, BAD_CLIENT, UNKNOWN_ACCOUNT, ACCOUNT_NOT_FOUND (the account is not this account's)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"CLIENT_LIMIT: at most 50 clients","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only. SESSION_ONLY: an API key can't set tracking.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"HANDLE_TAKEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/clients/{id}":{"get":{"operationId":"getClient","summary":"Get a client, its pages and ad changes","description":"Each page says whether its ads changed since it was built (adsChanged) or its ad group stopped running (adGroupGone); adSync has the totals and the new ad groups with no page.","tags":["Clients"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"responses":{"200":{"description":"The client, a summary of each page and the ad sync totals.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/ClientDetail"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateClient","summary":"Update facts, offer, tracking, lead delivery or auto rebuild","description":"Where leads go (leadEmail, leadWebhookUrl), tracking and the facts check (facts.factsCheck) are changed only by a person signed in to the dashboard: an API key that sends a different value gets 403 SESSION_ONLY. So are a saved phone (facts.phone), booking link (facts.bookingUrl) and websiteUrl: an API key may fill in an empty one, but changing or clearing a saved one gets 403 SESSION_ONLY. Sending the saved value again is fine (a phone with the same digits, an address written another way).","tags":["Clients"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchClientBody"}}}},"responses":{"200":{"description":"The saved client.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/Client"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, BAD_CLIENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only. SESSION_ONLY: an API key can't change where leads go, tracking, the facts check, or a saved phone, booking link or website.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"callbacks":{"newLead":{"{$request.body#/leadWebhookUrl}":{"$ref":"#/components/pathItems/NewLead"}}}}},"/api/clients/{id}/import-site":{"post":{"operationId":"importClientSite","summary":"Suggest facts from the client website (not saved)","description":"url defaults to the client websiteUrl.","tags":["Clients"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportSiteBody"}}}},"responses":{"200":{"description":"What was found.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/ImportSiteData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, BAD_IMPORT, BAD_URL, OWN_SITE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: an account reads at most 10 websites an hour; RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"IMPORT_FAILED: the site could not be read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/quick-start":{"post":{"operationId":"quickStart","summary":"New client and page from its website","description":"Reads up to 5 pages of the website with the built-in reader. Facts are kept only when the pages show them; anything missing shows on the page as [ADD: ...] and blocks publishing, and every claim read from the site waits in client.factsCheck until it is confirmed with POST /api/clients/{id}/facts-check. Then it makes the client in your account, with one page that has no ad group, and starts its build. Limits are checked before anything is read or made. Poll GET /api/pages/{id} until it is draft or failed. Fill each [ADD: ...] with PATCH /api/clients/{id} (facts) or PATCH /api/pages/{id}/blocks, then publish. One at a time per account, at most 20 a day. A 429 or 503 after the client and page were made names them in error.clientId and error.pageId; build the page again with POST /api/pages/{id}/rebuild.","tags":["Clients"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuickStartBody"},"example":{"website":"example.com","service":"Drain cleaning","town":"Fresno"}}}},"responses":{"202":{"description":"The client and page ids, and what the website gave.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/QuickStartData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, BAD_QUICK_START, BAD_URL (not a public web address), OWN_SITE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"CLIENT_LIMIT: at most 50 clients; PAGE_LIMIT: no free page slots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"QUICK_START_RUNNING: the last quick start page is still being written; HANDLE_TAKEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"BUILD_LIMIT: no builds left this month; BUILD_RATE: too many builds in the last hour; RATE_LIMITED: 20 quick starts in a day. Checked before anything is read or made.; RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"QUEUE_FAILED: the client and its page are kept (error.clientId, error.pageId); KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/pages/{id}/rebuild":{"post":{"operationId":"rebuildPage","summary":"Rebuild a page","description":"A page with no ad group (made by quick start) is written again from the client's facts, for example after its build failed. A page that follows an ad group is written again from the latest Google Ads data. Same limits as any build, counted once. Calling it again while the build is queued answers the same 202 and starts nothing more. Poll GET /api/pages/{id} until it is draft or failed.","tags":["Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Page ID."}],"responses":{"202":{"description":"The page is being built (again).","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/RebuildPageData"}},"required":["ok","data"]}}}},"400":{"description":"MISSING_FACTS, NO_ACCOUNT, UNKNOWN_AD_GROUPS (a page that follows an ad group)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PAGE_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"QUICK_START_RUNNING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"BUILD_LIMIT, BUILD_RATE; RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"QUEUE_FAILED (error.clientId, error.pageId); KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/clients/{id}/facts-check":{"post":{"operationId":"checkFacts","summary":"Confirm imported facts","description":"A signed-in person only: an API key gets 403 SESSION_ONLY (ask the person to check it in the dashboard). Needed before any page of the client goes live when client.factsCheck.status is needed (after quick start or a website import). Show the items to the person and ask. Each id in remove leaves the facts (a price leaves its option without the price), and page text that repeated it becomes [ADD: ...], saved as a draft with the History reason \"Checked what we found\". Then the check is done. Nothing is republished: livePageIds are the pages live as they are that still show what was removed; they change when you publish them again. Removed claims stay off every later save, build and restore.","tags":["Clients"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactsCheckBody"},"example":{"remove":[],"confirmed":["hours-565984d6"]}}}},"responses":{"200":{"description":"The client after the check, the pages whose text changed, and the live pages that still show what was removed.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/FactsCheckData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, BAD_FACTS_CHECK (an id not in factsCheck.items, or confirmed missing)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"CHECK_CHANGED: \"We found more on the website. Check the new items.\"; NOT_READY: the client changed a moment ago","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/clients/{id}/build":{"post":{"operationId":"buildPages","summary":"Build one page per ad group, or rebuild changed ones","description":"Agencies: new pages need free page slots and every build counts against the monthly builds; when only some fit, the ad groups with the most clicks go first and skipped lists the rest. Without a body: every enabled ad group in enabled Search campaigns, leaving live pages alone. changedOnly: only pages whose ads changed plus new ad groups (an empty list when nothing changed). Pages start as generating; poll GET /api/pages/{id} or GET /api/clients/{id} until each is draft or failed. A live page keeps serving its last published version until you publish again.","tags":["Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildBody"}}}},"responses":{"202":{"description":"The pages being built.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/BuildData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, INVALID_BODY, MISSING_FACTS (fix lists the facts to add), NO_ACCOUNT, NO_AD_GROUPS, UNKNOWN_AD_GROUPS (an adGroupIds entry is not a Search ad group in the latest data)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"PAGE_LIMIT: no free page slots for a new page (fix: add more pages)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"BUILD_LIMIT: no builds left this month; BUILD_RATE: too many builds in the last hour (wait a few minutes); RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"QUEUE_FAILED; KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/pages/{id}":{"get":{"operationId":"getPage","summary":"Get a page","tags":["Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Page ID."}],"responses":{"200":{"description":"The page, with its content and flags.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/Page"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PAGE_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updatePageContent","summary":"Replace a page's content","description":"Saves as a draft. Facts on the page are refreshed from today's facts, and anything removed in Check what we found is taken out again ([ADD: ...]); scrubbed lists it.","tags":["Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Page ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchPageBody"}}}},"responses":{"200":{"description":"The saved page, with scrubbed.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/PageEditData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, INVALID_CONTENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PAGE_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"PAGE_GENERATING, SLUG_TAKEN, NOT_READY (a rebuild started while saving; nothing was saved)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/pages/{id}/preview":{"get":{"operationId":"previewPage","summary":"Preview a page as HTML","description":"Preview mode: a thin Preview banner, no tracking, and the form cannot be sent.","tags":["Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Page ID."}],"responses":{"200":{"description":"The whole HTML document.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/PreviewData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PAGE_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"PAGE_GENERATING, NO_CONTENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/pages/{id}/blocks":{"get":{"operationId":"getPageBlocks","summary":"Read a page's text blocks by id","description":"Every text that can change (title tag, meta description, headline, subhead, offer line, benefits, problems, reasons, steps, FAQ), each with its limits and rule, plus the facts on the page that are locked.","tags":["Text and versions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Page ID."}],"responses":{"200":{"description":"The blocks and the locked facts.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/BlocksData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PAGE_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"NOT_READY: the page is still being written, or its build failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"editPageBlocks","summary":"Change text blocks by id (saved as a draft)","description":"Saves the changes as a draft and a new version, and reruns every check: \"Must fix: \" flags still block publishing. Facts on the page, the hero price included, are refreshed from today's facts, and anything removed in Check what we found is taken out again (scrubbed lists it). A published page goes back to draft and keeps serving its last published version until you publish again. Nothing is published here.","tags":["Text and versions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Page ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockEditBody"},"example":{"changes":{"hero.headline":"20 Yard Dumpster Rental in Merced","hero.subhead":"Drop-off in Merced and nearby towns. Starting at $299."},"note":"Shorter headline"}}}},"responses":{"200":{"description":"The saved page and its new version.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/BlockEditData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, INVALID_BODY, BLOCK_LOCKED (fix names the fact to change), UNKNOWN_BLOCK, INVALID_BLOCKS (blockers has one line per block), INVALID_CONTENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PAGE_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"NOT_READY: the page is being written, or a rebuild started while saving (nothing was saved).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/pages/{id}/versions":{"get":{"operationId":"listPageVersions","summary":"List a page's versions, newest first","tags":["Text and versions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Page ID."}],"responses":{"200":{"description":"Who changed what, when and why.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/PageVersionSummary"}}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PAGE_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/pages/{id}/versions/{n}":{"get":{"operationId":"getPageVersion","summary":"Get one version with its content","tags":["Text and versions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Page ID."},{"name":"n","in":"path","required":true,"schema":{"type":"string"},"description":"Version number (1, 2, 3...), from GET /api/pages/{id}/versions."}],"responses":{"200":{"description":"The version and the content it saved.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/VersionData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PAGE_NOT_FOUND, VERSION_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/pages/{id}/versions/{n}/restore":{"post":{"operationId":"restorePageVersion","summary":"Restore a version as a new draft","description":"Saves that version's text as a new draft and a new version; history is never rewritten. Prices, reviews, the hero price and other facts come from today's facts, so an old price never comes back; text that names an old price or phone is flagged. Every check runs again. Nothing is published here.","tags":["Text and versions"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Page ID."},{"name":"n","in":"path","required":true,"schema":{"type":"string"},"description":"Version number (1, 2, 3...), from GET /api/pages/{id}/versions."}],"responses":{"200":{"description":"The page as a draft, and the version the restore made.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/RestoreData"}},"required":["ok","data"]}}}},"400":{"description":"INVALID_CONTENT: this version no longer fits the facts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PAGE_NOT_FOUND, VERSION_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"NOT_READY: the page is being written, or a rebuild started while saving (nothing was saved).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/clients/{id}/publish":{"post":{"operationId":"publishPages","summary":"Publish pages (they go live)","description":"Without pageIds: every draft. Blocked when the client has no lead email, a page is not a draft with content, any [ADD: ...] text is left, or a page has a \"Must fix: \" flag. With versions (page id to its newest version, as liveVersions from the facts check gives them), a page that changed since is left out and listed in skipped.","tags":["Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishBody"}}}},"responses":{"200":{"description":"The live addresses.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/PublishData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, INVALID_BODY, PUBLISH_BLOCKED (message lists every blocker)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"PUBLISH_CONFLICT; CHECK_FACTS: \"Check what we found on the website before this goes live.\" (client.factsCheck is needed: POST /api/clients/{id}/facts-check first)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"RENDER_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/clients/{id}/leads":{"get":{"operationId":"listLeads","summary":"List leads, newest first (up to 200)","tags":["Leads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"responses":{"200":{"description":"The leads.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/clients/{id}/editor-csv":{"get":{"operationId":"getEditorCsv","summary":"Download the Google Ads Editor CSV","description":"One row per enabled keyword in the ad group of each published page, with the page as its final URL. Once the client's domain is live, final URLs are https://<domain>/<slug>; before that they are the landingpage.sh/p/ addresses (connect the domain first: ads show the domain of their final URL). The x-final-url-domain header names the domain used, or none. Import it in Google Ads Editor; nothing changes in the account until you do.","tags":["Pages"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"responses":{"200":{"description":"A CSV attachment.","headers":{"content-disposition":{"schema":{"type":"string"},"description":"attachment; filename=\"<handle>-editor-import.csv\""}},"content":{"text/csv":{"schema":{"type":"string"},"example":"Campaign,Ad group,Keyword,Criterion Type,Final URL\r\n"}}},"400":{"description":"NO_ACCOUNT, NOTHING_PUBLISHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/clients/{id}/domain":{"get":{"operationId":"getClientDomain","summary":"Get the client's own domain and the DNS record to add","description":"Every client's pages can live on a domain of its own (go.theirdomain.com), so its ads show its own name. enabled is false until domains are switched on for this server. record is the one CNAME to add at the client's DNS host, pointing at pages.landingpage.sh.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"responses":{"200":{"description":"The domain (or null), the CNAME target and whether domains are on.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/DomainData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"setClientDomain","summary":"Connect the client's domain (or replace it)","description":"A subdomain of the client's site (go.theirdomain.com) or of a domain bought for the ads (www.example.com). Root domains and names that look like ours are refused: use www. and forward the root to it. Saved as waiting_dns; add the record, then check. One domain per client; a new one replaces the old one, which stops serving at once. An API key may connect a domain only while the client has none: replacing one is 403 SESSION_ONLY (the person changes it in the dashboard). An address that was connected here before by someone else (or is left over on our side) also needs proof: proof is a TXT record to add next to the CNAME, and it must be found before the address goes live. A claim that never goes live is released after 7 days.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutDomainBody"},"example":{"hostname":"go.theirdomain.com"}}}},"responses":{"200":{"description":"The domain, waiting for its DNS record.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/ClientDomain"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, BAD_DOMAIN (message says why, e.g. \"Use go.yourdomain.com or www.yourdomain.com\")","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only. SESSION_ONLY: an API key can't replace a client's domain.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"DOMAIN_TAKEN: another client already uses it (whose is never said).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"DOMAIN_CHANGES_LIMIT: too many changes for this client in an hour.; RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"DOMAIN_FAILED: the domain service did not answer; nothing changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"DOMAINS_OFF: client domains aren't switched on for this server yet.; KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"DOMAIN_PENDING: the domain service took too long. The address is saved; check it in a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"removeClientDomain","summary":"Remove the client's domain","description":"Pages go back to their landingpage.sh/p/ addresses at once. Ads still pointing at the domain stop reaching the pages, so change them first. A person signed in to the dashboard only: an API key gets 403 SESSION_ONLY.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"responses":{"200":{"description":"No domain any more.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/DomainData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only. SESSION_ONLY: an API key can't remove a client's domain.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND, DOMAIN_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"DOMAIN_FAILED: the domain service did not answer; nothing changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"DOMAINS_OFF; KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/clients/{id}/domain/check":{"post":{"operationId":"checkClientDomain","summary":"Check the domain again (DNS record, then the security certificate)","description":"status goes waiting_dns (the records aren't there yet), then securing (the certificate is being issued, usually a few minutes), then live (pages are served there, landingpage.sh/p/ addresses answer 301 to it, liveUrl and the Editor CSV use it). With proof, it stays waiting_dns until the TXT record is found. A live domain stays live while its certificate renews. problem carries one plain line. At most one check every 15 seconds per client.","tags":["Domains"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Client ID."}],"responses":{"200":{"description":"The domain with its new status.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/ClientDomain"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE: refunded or suspended accounts are read-only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"CLIENT_NOT_FOUND, DOMAIN_NOT_FOUND. Another account's ids answer 404, as if they did not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"410":{"description":"DOMAIN_EXPIRED: it waited 7 days without going live, so it was released.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"CHECK_TOO_SOON; RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"DOMAIN_FAILED: the domain service did not answer; the status is unchanged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"DOMAINS_OFF; KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/auth/link":{"post":{"operationId":"requestSignInLink","summary":"Email a sign-in link","description":"Always answers sent: true, whether or not the email has an account. If it does, a link that works once for 15 minutes is emailed. At most 5 links per email and 20 requests per device an hour.","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthLinkBody"}}}},"responses":{"200":{"description":"Sent (or nothing to send).","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/AuthLinkData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, BAD_EMAIL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many requests from this device","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]}},"/api/auth/logout":{"post":{"operationId":"signOut","summary":"Sign out this browser","tags":["Account"],"responses":{"200":{"description":"The session is gone and the cookie cleared.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/LogoutData"}},"required":["ok","data"]}}}},"403":{"description":"BAD_ORIGIN: only the dashboard can sign out a session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[]}},"/api/me":{"get":{"operationId":"getMe","summary":"Who is signed in, with usage against the plan","tags":["Account"],"responses":{"200":{"description":"The signed-in agency, with its usage and the link to add pages.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/MeData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/agency/ingest-key/rotate":{"post":{"operationId":"rotateScriptKey","summary":"Make a new Google Ads script key","description":"The old key stops working at once. Answers the script with the new key built in; GET /api/script returns the same script from then on.","tags":["Account"],"responses":{"200":{"description":"The script with the new key.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/ScriptData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (no API key or lp_session session cookie, or the session ended); BAD_KEY: the API key is unknown or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"BAD_ORIGIN, ACCOUNT_INACTIVE; SESSION_ONLY: an API key can't make a new script key (rotate it in the dashboard)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: over 120 requests a minute with one API key (Retry-After says when to try again)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"SCRIPT_KEYS_OFF: script keys aren't switched on yet.; KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/agency/api-keys":{"get":{"operationId":"listApiKeys","summary":"List the agency's API keys for AI assistants","description":"Active keys, newest first: name, last 4 characters, when made and when last used. The keys themselves are never shown again.","tags":["Account"],"responses":{"200":{"description":"The keys.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeySummary"}}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (the lp_session session cookie is missing or ended).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SESSION_ONLY: an API key can't make, list or revoke keys","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"session":[]}]},"post":{"operationId":"createApiKey","summary":"Make an API key for an AI assistant (shown once)","description":"The key acts as the agency, exactly like its session: same clients, limits and read-only rule, changes recorded as the assistant. At most 10 active keys; 120 requests a minute per key.","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyBody"}}}},"responses":{"201":{"description":"The new key, in this answer only.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/NewApiKeyData"}},"required":["ok","data"]}}}},"400":{"description":"BAD_JSON, INVALID_BODY","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"UNAUTHORIZED: not signed in (the lp_session session cookie is missing or ended).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SESSION_ONLY: an API key can't make, list or revoke keys; BAD_ORIGIN: a signed-in write must come from the dashboard; ACCOUNT_INACTIVE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"KEY_LIMIT: 10 active keys already (revoke one first)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over the limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"session":[]}]}},"/api/agency/api-keys/{id}":{"delete":{"operationId":"revokeApiKey","summary":"Revoke an API key (it stops at once)","description":"Works on read-only accounts too: it only takes access away.","tags":["Account"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"API key ID (from the list, never the key itself)."}],"responses":{"200":{"description":"Revoked.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/RevokeApiKeyData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (the lp_session session cookie is missing or ended).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SESSION_ONLY: an API key can't make, list or revoke keys; BAD_ORIGIN: a signed-in write must come from the dashboard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"KEY_NOT_FOUND: no active key with this id for this account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"session":[]}]}},"/api/agency/purchases/{sessionId}":{"get":{"operationId":"getPurchase","summary":"Check a purchase after paying (pages added, or still on their way)","description":"The dashboard asks this after the payment page sends the buyer back. added: the pages are on this account; a pack counts from pageAllowanceBefore to pageAllowanceAfter. pending: not added yet (ask again every 2 seconds; they are added either way and an email follows). not_yours: anything that is not this account's, with no details. Only a complete, paid \"+50 pages\" checkout made for this account in the last 48 hours adds pages here (older ones are added by the payment notice). At most 30 checks a minute.","tags":["Account"],"parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"},"description":"The checkout session ID (cs_...) the payment page put in the address after paying."}],"responses":{"200":{"description":"What this purchase is to the signed-in account.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/PurchaseData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (the lp_session session cookie is missing or ended).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SESSION_ONLY: only a person signed in to the dashboard can check purchases (not an API key).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"PURCHASE_NOT_FOUND: the ID is not a checkout, or no such checkout exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"RATE_LIMITED: too many checks in the last minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"session":[]}]}},"/api/agency/welcome":{"get":{"operationId":"getWelcome","summary":"The first welcome, shown once to a new account","description":"show is true until the welcome is closed, for an active account with no pages yet. foundingNumber is the number stored when the account's paid license made it (null for comp accounts).","tags":["Account"],"responses":{"200":{"description":"Whether to show the welcome, and the founding number.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/WelcomeData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (the lp_session session cookie is missing or ended).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SESSION_ONLY: only a person signed in to the dashboard sees the welcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"session":[]}]},"post":{"operationId":"closeWelcome","summary":"Close the first welcome (it never shows again)","tags":["Account"],"responses":{"200":{"description":"When it was first closed.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/WelcomedData"}},"required":["ok","data"]}}}},"401":{"description":"UNAUTHORIZED: not signed in (the lp_session session cookie is missing or ended).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"SESSION_ONLY, BAD_ORIGIN, ACCOUNT_INACTIVE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"KEYS_MISCONFIGURED: the server keys are not set up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"session":[]}]}},"/p/{handle}/{slug}":{"servers":[{"url":"https://landingpage.sh","description":"Public host (live pages)"}],"get":{"operationId":"getLivePage","summary":"A live landing page","description":"On the public host. Keeps serving the last published version while edits put the page back to draft.","tags":["Live pages"],"parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string"},"description":"The client handle (from its name)."},{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The page slug."}],"responses":{"200":{"description":"The page.","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"No live page at this address.","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/p/{handle}/_lead":{"servers":[{"url":"https://landingpage.sh","description":"Public host (live pages)"}],"post":{"operationId":"submitLead","summary":"Send a lead (the live page form)","description":"On the public host. The lead is saved first, then emailed and, when the client has a webhook, forwarded (see the newLead webhook). With header x-requested-with: fetch the answer is JSON; without it, the thank-you page. Errors follow the same rule: JSON with the header, a short HTML page without it.","tags":["Live pages"],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/LeadForm"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/LeadForm"}},"application/json":{"schema":{"$ref":"#/components/schemas/LeadForm"}}}},"parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string"},"description":"The client handle (from its name)."},{"name":"x-requested-with","in":"header","required":false,"schema":{"type":"string","enum":["fetch"]},"description":"Send it to get JSON instead of HTML."}],"responses":{"200":{"description":"Saved (or a repeat of a lead already saved, which sends nothing).","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/LeadFetchData"}},"required":["ok","data"]}},"text/html":{"schema":{"type":"string","description":"The thank-you page (no fetch header)."}}}},"400":{"description":"BAD_REQUEST: the form could not be read or the phone is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"text/html":{"schema":{"type":"string"}}}},"404":{"description":"NOT_FOUND: no client with this handle.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"text/html":{"schema":{"type":"string"}}}},"413":{"description":"PAYLOAD_TOO_LARGE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"text/html":{"schema":{"type":"string"}}}},"429":{"description":"RATE_LIMITED: too many leads from one visitor in a short time.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"text/html":{"schema":{"type":"string"}}}},"503":{"description":"SAVE_FAILED: the lead could not be saved; the message gives the business phone.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"text/html":{"schema":{"type":"string"}}}}},"security":[]}}},"webhooks":{"newLead":{"$ref":"#/components/pathItems/NewLead"}},"components":{"securitySchemes":{"ingestKey":{"type":"apiKey","in":"header","name":"x-agency-key","description":"A script key, built into the Google Ads script (each agency has its own). POST /api/ingest only."},"session":{"type":"apiKey","in":"cookie","name":"lp_session","description":"An agency session, set by the sign-in link. Only for the dashboard: writes must come with the dashboard Origin."},"apiKey":{"type":"http","scheme":"bearer","description":"An agency API key (lp_...), for its AI assistant: Authorization: Bearer <key>. Made in the dashboard (Account, AI assistant access), shown once, revocable. Acts as the agency, like its session, with no Origin rule. 120 requests a minute per key."}},"schemas":{"ApiError":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z][A-Z0-9_]*$","description":"SNAKE_CASE code, stable across releases (for example MISSING_FACTS)."},"message":{"type":"string","description":"What went wrong, in plain words."},"fix":{"type":"string","description":"What to do next."},"blockers":{"type":"array","items":{"type":"string"},"description":"One plain line per problem, when there are several (PUBLISH_BLOCKED, INVALID_BLOCKS, BLOCK_LOCKED, UNKNOWN_BLOCK)."},"clientId":{"type":"string"},"pageId":{"type":"string"}},"required":["code","message","fix"],"additionalProperties":false,"description":"Every error has this shape, so a caller can recover on its own."},"AccountSummary":{"type":"object","properties":{"customerId":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string"},"lastIngestAt":{"type":"string","format":"date-time"},"counts":{"type":"object","properties":{"campaigns":{"type":"integer","minimum":0,"maximum":9007199254740991},"searchAdGroups":{"type":"integer","minimum":0,"maximum":9007199254740991},"keywords":{"type":"integer","minimum":0,"maximum":9007199254740991},"conversionActions":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["campaigns","searchAdGroups","keywords","conversionActions"],"additionalProperties":false},"checks":{"$ref":"#/components/schemas/ScriptChecks"}},"required":["customerId","name","lastIngestAt","counts","checks"],"additionalProperties":false},"AccountExport":{"type":"object","properties":{"customerId":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string","minLength":1},"currency":{"type":"string"},"timeZone":{"type":"string"},"exportedAt":{"type":"string","format":"date-time"},"scriptVersion":{"type":"string"},"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}},"adGroups":{"type":"array","items":{"$ref":"#/components/schemas/AdGroup"}},"keywords":{"type":"array","items":{"$ref":"#/components/schemas/Keyword"}},"ads":{"type":"array","items":{"$ref":"#/components/schemas/Ad"}},"assets":{"type":"array","items":{"$ref":"#/components/schemas/Asset"}},"conversionActions":{"type":"array","items":{"$ref":"#/components/schemas/ConversionAction"}},"searchTerms":{"type":"array","items":{"$ref":"#/components/schemas/SearchTerm"}},"checks":{"$ref":"#/components/schemas/ScriptChecks"}},"required":["customerId","name","currency","timeZone","exportedAt","scriptVersion","campaigns","adGroups","keywords","ads","assets","conversionActions","searchTerms","checks"],"additionalProperties":false},"Campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string"},"channelType":{"type":"string","minLength":1},"status":{"type":"string","enum":["ENABLED","PAUSED","REMOVED","UNKNOWN"]},"locations":{"type":"array","items":{"type":"string"}}},"required":["id","name","channelType","status","locations"],"additionalProperties":false},"AdGroup":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d+$"},"campaignId":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string"},"status":{"type":"string","enum":["ENABLED","PAUSED","REMOVED","UNKNOWN"]}},"required":["id","campaignId","name","status"],"additionalProperties":false},"Keyword":{"type":"object","properties":{"adGroupId":{"type":"string","pattern":"^\\d+$"},"criterionId":{"type":"string","pattern":"^\\d+$"},"text":{"type":"string","minLength":1},"matchType":{"type":"string","enum":["EXACT","PHRASE","BROAD"]},"status":{"type":"string","enum":["ENABLED","PAUSED","REMOVED","UNKNOWN"]},"finalUrl":{"type":["string","null"]},"clicks30d":{"type":"integer","minimum":0,"maximum":9007199254740991},"impressions30d":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["adGroupId","criterionId","text","matchType","status","finalUrl","clicks30d","impressions30d"],"additionalProperties":false},"Ad":{"type":"object","properties":{"adGroupId":{"type":"string","pattern":"^\\d+$"},"id":{"type":"string","pattern":"^\\d+$"},"type":{"type":"string"},"headlines":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"finalUrls":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["ENABLED","PAUSED","REMOVED","UNKNOWN"]}},"required":["adGroupId","id","type","headlines","descriptions","finalUrls","status"],"additionalProperties":false},"Asset":{"type":"object","properties":{"level":{"type":"string","enum":["account","campaign","ad_group"]},"parentId":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"kind":{"type":"string","enum":["callout","sitelink","structured_snippet","call"]},"text":{"type":"string"}},"required":["level","parentId","kind","text"],"additionalProperties":false},"ConversionAction":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string"},"category":{"type":"string"},"type":{"type":"string"},"status":{"type":"string","enum":["ENABLED","PAUSED","REMOVED","UNKNOWN"]},"conversionId":{"type":["string","null"]},"conversionLabel":{"type":["string","null"]}},"required":["id","name","category","type","status","conversionId","conversionLabel"],"additionalProperties":false},"SearchTerm":{"type":"object","properties":{"adGroupId":{"type":"string","pattern":"^\\d+$"},"term":{"type":"string"},"clicks30d":{"type":"integer","minimum":0,"maximum":9007199254740991},"impressions30d":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["adGroupId","term","clicks30d","impressions30d"],"additionalProperties":false},"ScriptChecks":{"type":"object","properties":{"tagSnippetsReadable":{"type":["boolean","null"]},"keywordUrlSettable":{"type":["boolean","null"]},"isPreview":{"type":"boolean"},"notes":{"type":"array","items":{"type":"string"}}},"required":["tagSnippetsReadable","keywordUrlSettable","isPreview","notes"],"additionalProperties":false},"Client":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":"string"},"name":{"type":"string"},"adAccountId":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}],"description":"Google Ads customer ID (digits) of an account the script has sent."},"websiteUrl":{"type":["string","null"]},"leadEmail":{"type":["string","null"],"description":"Up to 5 email addresses, comma separated. Every lead is emailed to each one. \"\" or null clears it."},"leadWebhookUrl":{"type":["string","null"],"description":"https address that gets every lead as JSON (see the newLead webhook). Only in the API; never shown on pages."},"facts":{"$ref":"#/components/schemas/ClientFacts"},"offer":{"$ref":"#/components/schemas/Offer"},"tracking":{"$ref":"#/components/schemas/Tracking"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"autoRebuild":{"type":"boolean","description":"When the Google Ads script sends changed ads, the matching pages are rebuilt as drafts: each page at most once a day, and drafts edited by hand are skipped. Nothing is published until you publish."},"factsCheck":{"$ref":"#/components/schemas/FactsCheck"}},"required":["id","handle","name","adAccountId","websiteUrl","leadEmail","leadWebhookUrl","facts","offer","tracking","createdAt","updatedAt","autoRebuild"],"additionalProperties":false,"description":"A business you run ads for. Its live pages are at /p/{handle}/{slug} on the public host."},"ClientListItem":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":"string"},"name":{"type":"string"},"adAccountId":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"websiteUrl":{"type":["string","null"]},"leadEmail":{"type":["string","null"]},"leadWebhookUrl":{"type":["string","null"]},"facts":{"$ref":"#/components/schemas/ClientFacts"},"offer":{"$ref":"#/components/schemas/Offer"},"tracking":{"$ref":"#/components/schemas/Tracking"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"autoRebuild":{"type":"boolean"},"factsCheck":{"$ref":"#/components/schemas/FactsCheck"},"pageCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"publishedCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","handle","name","adAccountId","websiteUrl","leadEmail","leadWebhookUrl","facts","offer","tracking","createdAt","updatedAt","autoRebuild","pageCount","publishedCount"],"additionalProperties":false},"ClientDetail":{"type":"object","properties":{"client":{"$ref":"#/components/schemas/Client"},"pages":{"type":"array","items":{"$ref":"#/components/schemas/PageSummary"}},"adSync":{"$ref":"#/components/schemas/AdSync"}},"required":["client","pages","adSync"],"additionalProperties":false},"ClientFacts":{"type":"object","properties":{"businessName":{"type":"string","maxLength":120},"phone":{"type":"string","maxLength":25,"description":"Phone number with 10 to 15 digits, like (209) 555-0142."},"address":{"type":"string","maxLength":200},"serviceAreaBusiness":{"type":"boolean"},"services":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"cities":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"hours":{"type":"string","maxLength":200},"licenseNo":{"type":"string","maxLength":60},"brandColor":{"type":"string","maxLength":7},"logoUrl":{"type":"string","maxLength":500},"reviews":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/Review"},"description":"Only real reviews the business confirmed."},"options":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/Option"}},"fees":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/Fee"}},"promises":{"maxItems":6,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"rating":{"$ref":"#/components/schemas/Rating"},"bookingUrl":{"type":"string","maxLength":500,"description":"https address for online booking."},"privacyUrl":{"type":"string","maxLength":500,"description":"https address of the business's own privacy policy. Every form on its pages links to it; without one they link to a short generated notice. An API key may fill an empty one; changing or clearing a saved one gets 403 SESSION_ONLY."},"timeZone":{"type":"string","maxLength":60}},"additionalProperties":false,"description":"Real facts about the business. Pages only show what is here; a missing fact becomes a visible [ADD: ...] placeholder. Building pages needs businessName, phone, at least one service and at least one city."},"Review":{"type":"object","properties":{"author":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":1000},"source":{"type":"string","enum":["google","website","other"]},"rating":{"type":"number","minimum":1,"maximum":5},"url":{"type":"string","maxLength":500},"location":{"type":"string","maxLength":80}},"required":["author","text","source"],"additionalProperties":false},"Option":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"startingPrice":{"type":"string","maxLength":12},"includes":{"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"useFor":{"type":"string","maxLength":80}},"required":["name"],"additionalProperties":false},"Fee":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":40},"amount":{"type":"string","minLength":1,"maxLength":20},"note":{"type":"string","maxLength":100}},"required":["label","amount"],"additionalProperties":false},"Rating":{"type":"object","properties":{"value":{"type":"number","minimum":1,"maximum":5},"count":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string","maxLength":500},"checkedAt":{"type":"string","maxLength":40}},"required":["value","count"],"additionalProperties":false},"Offer":{"type":"object","properties":{"offerLine":{"type":"string","maxLength":60},"priceMode":{"type":"string","enum":["from","call"]},"priceText":{"type":"string","maxLength":60}},"additionalProperties":false},"Tracking":{"type":"object","properties":{"conversionId":{"type":"string","maxLength":100,"description":"Like AW-123456789."},"formLabel":{"type":"string","maxLength":100},"callLabel":{"type":"string","maxLength":100},"gtmId":{"type":"string","maxLength":100,"description":"Like GTM-ABC1234."}},"additionalProperties":false,"description":"Google Ads conversion tracking for live pages."},"PageStatus":{"type":"string","enum":["generating","draft","published","failed"]},"Page":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"adGroupId":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"adGroupName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"slug":{"type":"string"},"status":{"$ref":"#/components/schemas/PageStatus"},"content":{"anyOf":[{"$ref":"#/components/schemas/PageContent"},{"type":"null"}]},"flags":{"type":"array","items":{"type":"string"},"description":"Copy-check warnings, or why the build failed, in plain words. A flag starting with \"Must fix: \" blocks publishing."},"liveUrl":{"type":["string","null"],"description":"Set while the page is published."},"publishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"firstGclidAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"adFingerprint":{"type":["string","null"]}},"required":["id","clientId","adGroupId","adGroupName","campaignName","slug","status","content","flags","liveUrl","publishedAt","firstGclidAt","createdAt","updatedAt","adFingerprint"],"additionalProperties":false,"description":"One landing page for one ad group."},"PageSummary":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"status":{"$ref":"#/components/schemas/PageStatus"},"adGroupId":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"adGroupName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"flags":{"type":"array","items":{"type":"string"}},"liveUrl":{"type":["string","null"],"description":"Set while the page is published. A page being rebuilt or waiting as a draft keeps serving its last published version at the same address."},"publishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"firstGclidAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"adsChanged":{"type":"boolean","description":"The ads of this ad group changed since the page was built. Rebuild it with POST /api/clients/{id}/build and changedOnly. Pages built before ad sync are never marked."},"adGroupGone":{"type":"boolean","description":"The ad group is paused or removed in Google Ads, or its campaign is not an enabled Search campaign. It is never rebuilt automatically."}},"required":["id","slug","status","adGroupId","adGroupName","campaignName","flags","liveUrl","publishedAt","firstGclidAt","adsChanged","adGroupGone"],"additionalProperties":false,"description":"A page in a list. adsChanged and adGroupGone are worked out when read, against the latest ads the script sent."},"AdSync":{"type":"object","properties":{"changed":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Pages whose ads changed since they were built."},"gone":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Pages whose ad group is paused or removed."},"newAdGroups":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Enabled Search ad groups with no page yet."},"lastIngestAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the script last sent the account; null when no account is linked or nothing has arrived yet."}},"required":["changed","gone","newAdGroups","lastIngestAt"],"additionalProperties":false,"description":"How the pages compare with the latest ads the script sent."},"PageContent":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":60,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"seo":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":155}},"required":["title","description"],"additionalProperties":false},"hero":{"type":"object","properties":{"areaLine":{"type":"string","minLength":1,"maxLength":60},"headline":{"type":"string","minLength":20,"maxLength":60},"subhead":{"type":"string","minLength":1,"maxLength":120},"offerLine":{"type":"string","maxLength":60},"price":{"type":"object","properties":{"mode":{"type":"string","enum":["from","call"]},"text":{"type":"string","maxLength":60}},"required":["mode"],"additionalProperties":false}},"required":["areaLine","headline","subhead"],"additionalProperties":false},"form":{"type":"object","properties":{"extraFields":{"maxItems":2,"type":"array","items":{"type":"string","enum":["service","date","message"]}}},"required":["extraFields"],"additionalProperties":false},"benefits":{"type":"array","prefixItems":[{"type":"string","minLength":1,"maxLength":40},{"type":"string","minLength":1,"maxLength":40},{"type":"string","minLength":1,"maxLength":40}],"items":false,"minItems":3,"maxItems":3},"reviews":{"type":"array","items":{"$ref":"#/components/schemas/Review"}},"faq":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":200},"a":{"type":"string","minLength":1,"maxLength":300}},"required":["q","a"],"additionalProperties":false}},"serviceArea":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"footer":{"type":"object","properties":{"businessName":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","minLength":1,"maxLength":40},"address":{"type":"string","maxLength":200},"licenseNo":{"type":"string","maxLength":60}},"required":["businessName","phone"],"additionalProperties":false},"sections":{"type":"object","properties":{"reviews":{"type":"boolean"},"faq":{"type":"boolean"},"options":{"type":"boolean"},"fees":{"type":"boolean"}},"required":["reviews","faq","options","fees"],"additionalProperties":false},"pain":{"minItems":3,"maxItems":3,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":220}},"required":["title","text"],"additionalProperties":false}},"why":{"minItems":3,"maxItems":4,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":160}},"required":["title","text"],"additionalProperties":false}},"steps":{"minItems":3,"maxItems":3,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":30},"text":{"type":"string","minLength":1,"maxLength":120}},"required":["title","text"],"additionalProperties":false}},"options":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/Option"}},"fees":{"maxItems":8,"type":"array","items":{"$ref":"#/components/schemas/Fee"}},"rating":{"$ref":"#/components/schemas/Rating"}},"required":["slug","seo","hero","form","benefits","reviews","faq","serviceArea","footer","sections","pain","why","steps","options","fees"],"additionalProperties":false,"description":"Everything a page says. Page copy may not contain em or en dashes. reviews, options, fees and rating are copied from the client facts."},"Lead":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"pageId":{"type":["string","null"]},"name":{"type":["string","null"]},"phone":{"type":"string"},"zip":{"type":["string","null"]},"message":{"type":["string","null"]},"extra":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"email, option, service, date, gbraid, wbraid, utm_*, landing_page and referrer, when the form sent them."},"gclid":{"type":["string","null"]},"emailStatus":{"type":"string","enum":["pending","sent","failed"]},"emailError":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"submissionId":{"type":["string","null"]},"formStatus":{"type":"string","const":"complete"},"webhookStatus":{"type":"string","enum":["none","pending","sent","failed"]},"webhookError":{"type":["string","null"]},"isTest":{"type":"boolean","description":"True for a test lead. Test leads are never emailed, forwarded or counted."},"consent":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"buttonLabel":{"type":"string"},"pageVersion":{"type":"integer","minimum":0,"maximum":9007199254740991},"at":{"type":"string"}},"required":["text","buttonLabel","pageVersion","at"],"additionalProperties":false},{"type":"null"}]}},"required":["id","clientId","pageId","name","phone","zip","message","extra","gclid","emailStatus","emailError","createdAt","submissionId","formStatus","webhookStatus","webhookError","isTest","consent"],"additionalProperties":false,"description":"One form submission from a live page."},"ScriptData":{"type":"object","properties":{"script":{"type":"string"},"keyIncluded":{"type":"boolean","description":"false when the key must be made first (none yet, or it has to be made again), so script is empty. POST /api/agency/ingest-key/rotate makes a new key and returns the script."},"keyHint":{"type":["string","null"],"description":"The last 4 characters of the key in use."}},"required":["script"],"additionalProperties":false,"description":"The script, with its key built in."},"IngestData":{"type":"object","properties":{"customerId":{"type":"string","pattern":"^\\d+$"},"adGroups":{"type":"integer","minimum":0,"maximum":9007199254740991},"keywords":{"type":"integer","minimum":0,"maximum":9007199254740991},"autoRebuilt":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Pages queued for a draft rebuild because their ads changed (clients with autoRebuild on). Each page at most once a day, each client at most as many a day as it has pages, and drafts edited by hand are skipped. 0 when none."}},"required":["customerId","adGroups","keywords","autoRebuilt"],"additionalProperties":false,"description":"What was stored."},"ImportSiteData":{"type":"object","properties":{"found":{"$ref":"#/components/schemas/ClientFacts"},"photos":{"type":"array","items":{"type":"string"}},"source":{"type":"string","enum":["crawler","reader","none"],"description":"\"crawler\" when the website import service read the site, \"reader\" when the built-in reader read it, \"none\" when nothing could be read (note says why)."},"note":{"type":"string","description":"With source \"none\": why the site could not be read, in plain words."}},"required":["found","photos","source"],"additionalProperties":false,"description":"Facts found on the client website, only what it shows. Nothing is saved: send what you keep with PATCH /api/clients/{id}."},"QuickStartData":{"type":"object","properties":{"clientId":{"type":"string"},"pageId":{"type":"string"},"imported":{"type":"object","properties":{"source":{"type":"string","enum":["crawler","reader","none"]},"found":{"type":"array","items":{"type":"string"}},"missing":{"type":"array","items":{"type":"string"}},"note":{"type":"string"}},"required":["source","found","missing"],"additionalProperties":false,"description":"What the website gave: found and missing are plain labels; note says why nothing was read (source \"none\")."}},"required":["clientId","pageId","imported"],"additionalProperties":false,"description":"The new client and page. The page is generating: poll GET /api/pages/{id} until it is draft or failed."},"RebuildPageData":{"type":"object","properties":{"clientId":{"type":"string"},"pageId":{"type":"string"}},"required":["clientId","pageId"],"additionalProperties":false},"FactsCheck":{"type":"object","properties":{"status":{"type":"string","enum":["needed","done"]},"items":{"type":"array","items":{"$ref":"#/components/schemas/FactsCheckItem"},"description":"While needed: what the website gave. When done: what was kept."},"checkedAt":{"type":"string"},"checkedBy":{"type":"string","enum":["owner","agency"],"description":"owner or agency."},"removed":{"type":"array","items":{"$ref":"#/components/schemas/RemovedClaim"},"description":"What the person took out. Any save, restore or build turns any of it on a page into [ADD: ...] again."}},"required":["status","items"],"additionalProperties":false,"description":"Check what we found: the claims read from the client website (reviews, prices, extra charges, hours, address, license, review score, phone, booking link, and the towns and the services as one item each). While status is needed, no page of the client can go live (409 CHECK_FACTS). Show the items to the person, then send POST /api/clients/{id}/facts-check."},"FactsCheckItem":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["review","price","hours","address","license","rating","phone","other"]},"label":{"type":"string"},"values":{"type":"array","items":{"type":"string"},"description":"Only on a grouped item (Towns served, Services): the imported values it stands for. Removing it takes these out of the facts."}},"required":["id","kind","label"],"additionalProperties":false,"description":"One claim from the website: id, kind and a plain label (\"Hours: Mon to Fri 7 AM to 6 PM\")."},"RemovedClaim":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["review","price","hours","address","license","rating","phone","other"]},"label":{"type":"string"},"text":{"type":"string"}},"required":["id","kind","label","text"],"additionalProperties":false},"ScrubbedClaim":{"type":"object","properties":{"label":{"type":"string"}},"required":["label"],"additionalProperties":false,"description":"A claim removed in Check what we found that a save took out again ([ADD: ...] on the page). Add it to the facts to use it."},"FactsCheckData":{"type":"object","properties":{"client":{"$ref":"#/components/schemas/Client"},"changedPageIds":{"type":"array","items":{"type":"string"},"description":"Pages whose text changed (saved as drafts)."},"livePageIds":{"type":"array","items":{"type":"string"},"description":"Pages that were live as they are and still show something removed. Nothing is republished: publish them again to take it off."},"liveVersions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"For each page in livePageIds, its newest version now. Send them as versions when publishing, so a page edited since is left out."}},"required":["client","changedPageIds","livePageIds","liveVersions"],"additionalProperties":false,"description":"The client after the check."},"BuildData":{"type":"object","properties":{"pages":{"type":"array","items":{"$ref":"#/components/schemas/PageSummary"}},"skipped":{"type":"array","items":{"$ref":"#/components/schemas/BuildSkip"},"description":"Agencies only, when a limit was reached: the ad groups left out. Without it, every ad group asked for was started."}},"required":["pages"],"additionalProperties":false,"description":"The pages being built."},"PreviewData":{"type":"object","properties":{"html":{"type":"string"}},"required":["html"],"additionalProperties":false},"PublishData":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"liveUrl":{"type":"string"}},"required":["id","slug","liveUrl"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string"}},"required":["id","reason"],"additionalProperties":false}}},"required":["pages"],"additionalProperties":false},"LeadFetchData":{"type":"object","properties":{"duplicate":{"type":"boolean"}},"required":["duplicate"],"additionalProperties":false},"LeadWebhookPayload":{"type":"object","properties":{"schema_version":{"type":"number","const":1},"submission_id":{"type":"string","description":"Stable per lead: use it to dedupe."},"form_status":{"type":"string"},"source":{"type":"string"},"page_url":{"type":"string"},"ad_group":{"type":"string"},"campaign":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"zip":{"type":"string"},"option":{"type":"string"},"message":{"type":"string"},"gclid":{"type":"string"},"gbraid":{"type":"string"},"wbraid":{"type":"string"},"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_term":{"type":"string"},"utm_content":{"type":"string"},"landing_page":{"type":"string"},"referrer":{"type":"string"},"submitted_at":{"type":"string","description":"ISO time the lead was saved."},"consent_text":{"type":"string"},"consent_button":{"type":"string"},"consent_page_version":{"type":"string"},"consent_at":{"type":"string"}},"required":["schema_version","submission_id","form_status","source","page_url","ad_group","campaign","name","phone","email","zip","option","message","gclid","gbraid","wbraid","utm_source","utm_medium","utm_campaign","utm_term","utm_content","landing_page","referrer","submitted_at","consent_text","consent_button","consent_page_version","consent_at"],"additionalProperties":false,"description":"Flat, so a CRM can map it. Every value is a string (\"\" when missing) except schema_version, the number 1."},"Block":{"type":"object","properties":{"id":{"type":"string","description":"Send it as a key of changes in PATCH /api/pages/{id}/blocks."},"label":{"type":"string","description":"Plain words, like Headline or FAQ 3 answer."},"group":{"type":"string","enum":["search","hero","benefits","pain","why","steps","faq"]},"text":{"type":"string"},"maxLength":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"minLength":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"rule":{"type":"string","description":"What the text must do, like Must include \"drain cleaning\". The checks run again on every save."},"optional":{"type":"boolean","description":"May be sent as \"\" to remove it (the offer line)."}},"required":["id","label","group","text","maxLength"],"additionalProperties":false,"description":"One piece of page text that can be changed by id. The id is its path in PageContent, like hero.headline, benefits.0 or faq.2.a."},"LockedBlock":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"factKey":{"type":"string","enum":["tracking","businessName","phone","address","serviceAreaBusiness","services","cities","hours","licenseNo","brandColor","logoUrl","reviews","options","fees","promises","rating","bookingUrl","timeZone","privacyUrl"],"description":"The field in the client facts to change (tracking: the page settings)."},"hint":{"type":"string"}},"required":["id","label","factKey","hint"],"additionalProperties":false,"description":"Text that comes from the client's facts and can't be changed here. Change the fact instead (PATCH /api/clients/{id} with facts), then save the page."},"BlocksData":{"type":"object","properties":{"blocks":{"type":"array","items":{"$ref":"#/components/schemas/Block"}},"locked":{"type":"array","items":{"$ref":"#/components/schemas/LockedBlock"}}},"required":["blocks","locked"],"additionalProperties":false,"description":"The text blocks of a page, and the facts on it that are locked."},"PageVersionSummary":{"type":"object","properties":{"n":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Counts up per page."},"reason":{"type":"string","description":"Plain words, like Built from ads, Edited headline, subhead or Restored version 4."},"actor":{"type":"string","enum":["ai","agency","assistant","owner"],"description":"ai: a build; agency: a person signed in to the dashboard; assistant: an AI assistant with one of the agency API keys (the key name is in reason); owner: the Landing Page team."},"changedBlocks":{"type":"array","items":{"type":"string"},"description":"Block ids whose text changed from the version before."},"createdAt":{"type":"string","format":"date-time"}},"required":["n","reason","actor","changedBlocks","createdAt"],"additionalProperties":false,"description":"One saved version of a page's content. Builds, rebuilds, edits and restores each make one. The newest 50 are kept, always with the live one."},"BlockEditData":{"type":"object","properties":{"page":{"$ref":"#/components/schemas/Page"},"version":{"anyOf":[{"$ref":"#/components/schemas/PageVersionSummary"},{"type":"null"}]},"scrubbed":{"type":"array","items":{"$ref":"#/components/schemas/ScrubbedClaim"}}},"required":["page","version","scrubbed"],"additionalProperties":false,"description":"The saved page with its new flags, the new version (null when nothing changed), and in scrubbed the claims removed in Check what we found that this save took out again."},"PageEditData":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"adGroupId":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"adGroupName":{"type":["string","null"]},"campaignName":{"type":["string","null"]},"slug":{"type":"string"},"status":{"$ref":"#/components/schemas/PageStatus"},"content":{"anyOf":[{"$ref":"#/components/schemas/PageContent"},{"type":"null"}]},"flags":{"type":"array","items":{"type":"string"}},"liveUrl":{"type":["string","null"]},"publishedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"firstGclidAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"adFingerprint":{"type":["string","null"]},"scrubbed":{"type":"array","items":{"$ref":"#/components/schemas/ScrubbedClaim"}}},"required":["id","clientId","adGroupId","adGroupName","campaignName","slug","status","content","flags","liveUrl","publishedAt","firstGclidAt","createdAt","updatedAt","adFingerprint","scrubbed"],"additionalProperties":false,"description":"The saved page, and in scrubbed the claims removed in Check what we found that this save took out again."},"VersionData":{"type":"object","properties":{"version":{"$ref":"#/components/schemas/PageVersionSummary"},"content":{"$ref":"#/components/schemas/PageContent"}},"required":["version","content"],"additionalProperties":false,"description":"One version with the whole content it saved."},"RestoreData":{"type":"object","properties":{"page":{"$ref":"#/components/schemas/Page"},"version":{"$ref":"#/components/schemas/PageVersionSummary"}},"required":["page","version"],"additionalProperties":false,"description":"The page, now a draft with the restored text, and the version the restore made."},"MeData":{"anyOf":[{"type":"object","properties":{"actor":{"type":"string","const":"owner"}},"required":["actor"],"additionalProperties":false},{"type":"object","properties":{"actor":{"type":"string","const":"agency"},"agency":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"status":{"type":"string","enum":["active","refunded","suspended"]}},"required":["id","name","email","status"],"additionalProperties":false},"usage":{"$ref":"#/components/schemas/AgencyUsage"},"packUrl":{"type":["string","null"]}},"required":["actor","agency","usage","packUrl"],"additionalProperties":false}],"description":"Who is signed in. An agency also gets its usage against its plan and the link to buy more pages."},"AgencyUsage":{"type":"object","properties":{"pages":{"type":"integer","minimum":0,"maximum":9007199254740991},"pageAllowance":{"type":"integer","minimum":0,"maximum":9007199254740991},"buildsThisMonth":{"type":"integer","minimum":0,"maximum":9007199254740991},"monthlyBuildAllowance":{"type":"integer","minimum":0,"maximum":9007199254740991},"clients":{"type":"integer","minimum":0,"maximum":9007199254740991},"clientLimit":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["pages","pageAllowance","buildsThisMonth","monthlyBuildAllowance","clients","clientLimit"],"additionalProperties":false,"description":"Pages (any page, draft or live) and AI builds this calendar month (UTC) against the plan; clients against the client limit. A license includes 100 pages and 100 builds a month; each pack adds 50 of each."},"BuildSkip":{"type":"object","properties":{"adGroupId":{"type":"string"},"adGroupName":{"type":"string"},"reason":{"type":"string","enum":["PAGE_LIMIT","BUILD_LIMIT","BUILD_RATE"],"description":"PAGE_LIMIT: no free page slots. BUILD_LIMIT: no builds left this month. BUILD_RATE: too many builds in the last hour."}},"required":["adGroupId","adGroupName","reason"],"additionalProperties":false,"description":"A Search ad group a build left out because a limit was reached. The ad groups with the most clicks go first."},"AuthLinkData":{"type":"object","properties":{"sent":{"type":"boolean","const":true}},"required":["sent"],"additionalProperties":false},"LogoutData":{"type":"object","properties":{"signedOut":{"type":"boolean","const":true}},"required":["signedOut"],"additionalProperties":false},"ApiKeySummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string","description":"The last 4 characters of the key."},"createdAt":{"type":"string","format":"date-time"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When it was last used (updated at most once a minute); null when never used."}},"required":["id","name","hint","createdAt","lastUsedAt"],"additionalProperties":false,"description":"One active API key. The key itself is never shown again after it is made."},"NewApiKeyData":{"type":"object","properties":{"key":{"type":"string","pattern":"^lp_[A-Za-z0-9]{43}$","description":"Send it as Authorization: Bearer <key>, on the API or the MCP endpoint."},"id":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string"}},"required":["key","id","name","hint"],"additionalProperties":false,"description":"The new key. This is the only answer that ever carries it: copy it now. Only a hash is kept."},"RevokeApiKeyData":{"type":"object","properties":{"id":{"type":"string"},"revoked":{"type":"boolean","const":true}},"required":["id","revoked"],"additionalProperties":false},"PurchaseData":{"type":"object","properties":{"kind":{"type":"string","enum":["pack","license"],"description":"pack: pages added to the account. license: the license that made the account."},"status":{"type":"string","enum":["added","pending","not_yours"],"description":"added: on this account. pending: not added yet, ask again in 2 seconds. not_yours: not this account's (no details)."},"pagesAdded":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"Pages this purchase added (0 while pending or not_yours)."},"pageAllowanceBefore":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The page allowance just before it was added (pending and not_yours: the account's current allowance)."},"pageAllowanceAfter":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The page allowance right after it was added."}},"required":["kind","status","pagesAdded","pageAllowanceBefore","pageAllowanceAfter"],"additionalProperties":false,"description":"A purchase as the signed-in account sees it."},"WelcomeData":{"type":"object","properties":{"show":{"type":"boolean","description":"true once: until the welcome is closed, for an active account with no pages yet."},"foundingNumber":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}],"description":"The number stored when the account's paid license made it (it never changes). null for comp accounts."}},"required":["show","foundingNumber"],"additionalProperties":false,"description":"The first welcome for a new account."},"WelcomedData":{"type":"object","properties":{"welcomedAt":{"type":"string","format":"date-time"}},"required":["welcomedAt"],"additionalProperties":false,"description":"The welcome is closed."},"ClientDomain":{"type":"object","properties":{"hostname":{"type":"string"},"status":{"type":"string","enum":["waiting_dns","securing","live","problem"]},"problem":{"type":["string","null"]},"liveAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"checkedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"record":{"type":"object","properties":{"type":{"type":"string","const":"CNAME"},"name":{"type":"string"},"value":{"type":"string","const":"pages.landingpage.sh"}},"required":["type","name","value"],"additionalProperties":false},"proof":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"TXT"},"name":{"type":"string"},"value":{"type":"string"},"found":{"type":"boolean"}},"required":["type","name","value","found"],"additionalProperties":false},{"type":"null"}]}},"required":["hostname","status","problem","liveAt","checkedAt","record","proof"],"additionalProperties":false},"DomainData":{"type":"object","properties":{"domain":{"anyOf":[{"$ref":"#/components/schemas/ClientDomain"},{"type":"null"}]},"cnameTarget":{"type":"string","const":"pages.landingpage.sh"},"enabled":{"type":"boolean"}},"required":["domain","cnameTarget","enabled"],"additionalProperties":false},"IngestBody":{"type":"object","properties":{"account":{"type":"object","properties":{"customerId":{"type":"string","pattern":"^[\\d-]+$"},"name":{"type":"string","minLength":1},"currency":{"type":"string"},"timeZone":{"type":"string"},"exportedAt":{"type":"string","format":"date-time"},"scriptVersion":{"type":"string"},"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string"},"channelType":{"type":"string","minLength":1},"status":{"type":"string"},"locations":{"type":"array","items":{"type":"string"}}},"required":["id","name","channelType","status","locations"]}},"adGroups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d+$"},"campaignId":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","campaignId","name","status"]}},"keywords":{"type":"array","items":{"type":"object","properties":{"adGroupId":{"type":"string","pattern":"^\\d+$"},"criterionId":{"type":"string","pattern":"^\\d+$"},"text":{"type":"string","minLength":1},"matchType":{"type":"string","enum":["EXACT","PHRASE","BROAD"]},"status":{"type":"string"},"finalUrl":{"type":["string","null"]},"clicks30d":{"type":"integer","minimum":0,"maximum":9007199254740991},"impressions30d":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["adGroupId","criterionId","text","matchType","status","finalUrl","clicks30d","impressions30d"]}},"ads":{"type":"array","items":{"type":"object","properties":{"adGroupId":{"type":"string","pattern":"^\\d+$"},"id":{"type":"string","pattern":"^\\d+$"},"type":{"type":"string"},"headlines":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"finalUrls":{"type":"array","items":{"type":"string"}},"status":{"type":"string"}},"required":["adGroupId","id","type","headlines","descriptions","finalUrls","status"]}},"assets":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["account","campaign","ad_group"]},"parentId":{"anyOf":[{"type":"string","pattern":"^\\d+$"},{"type":"null"}]},"kind":{"type":"string","enum":["callout","sitelink","structured_snippet","call"]},"text":{"type":"string"}},"required":["level","parentId","kind","text"]}},"conversionActions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string"},"category":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"conversionId":{"type":["string","null"]},"conversionLabel":{"type":["string","null"]}},"required":["id","name","category","type","status","conversionId","conversionLabel"]}},"searchTerms":{"type":"array","items":{"type":"object","properties":{"adGroupId":{"type":"string","pattern":"^\\d+$"},"term":{"type":"string"},"clicks30d":{"type":"integer","minimum":0,"maximum":9007199254740991},"impressions30d":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["adGroupId","term","clicks30d","impressions30d"]}},"checks":{"type":"object","properties":{"tagSnippetsReadable":{"type":["boolean","null"]},"keywordUrlSettable":{"type":["boolean","null"]},"isPreview":{"type":"boolean"},"notes":{"type":"array","items":{"type":"string"}}},"required":["tagSnippetsReadable","keywordUrlSettable","isPreview","notes"]}},"required":["customerId","name","currency","timeZone","exportedAt","scriptVersion","campaigns","adGroups","keywords","ads","assets","conversionActions","searchTerms","checks"]}},"required":["account"]},"CreateClientBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"adAccountId":{"anyOf":[{"type":"string","pattern":"^[\\d-]+$"},{"type":"null"}],"description":"Google Ads customer ID, with or without dashes. Must be an account the script has already sent."},"websiteUrl":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"leadEmail":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Up to 5 email addresses, comma separated. Every lead is emailed to each one. \"\" or null clears it."}},"required":["name"],"description":"A unique handle is made from the name."},"PatchClientBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"adAccountId":{"anyOf":[{"type":"string","pattern":"^[\\d-]+$"},{"type":"null"}],"description":"An account the script has already sent, or null to unlink."},"websiteUrl":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"leadEmail":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"description":"Up to 5 email addresses, comma separated. Every lead is emailed to each one. \"\" or null clears it."},"leadWebhookUrl":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"https address that gets every lead as JSON (see the newLead webhook). null clears it."},"facts":{"type":"object","properties":{"businessName":{"type":"string","maxLength":120},"phone":{"type":"string","maxLength":25},"address":{"type":"string","maxLength":200},"serviceAreaBusiness":{"type":"boolean"},"services":{"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"cities":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"hours":{"type":"string","maxLength":200},"licenseNo":{"type":"string","maxLength":60},"brandColor":{"type":"string","maxLength":7},"logoUrl":{"type":"string","maxLength":500},"reviews":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"author":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":1000},"source":{"type":"string","enum":["google","website","other"]},"rating":{"type":"number","minimum":1,"maximum":5},"url":{"type":"string","maxLength":500},"location":{"type":"string","maxLength":80}},"required":["author","text","source"]}},"options":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"startingPrice":{"type":"string","maxLength":12},"includes":{"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"useFor":{"type":"string","maxLength":80}},"required":["name"]}},"fees":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":40},"amount":{"type":"string","minLength":1,"maxLength":20},"note":{"type":"string","maxLength":100}},"required":["label","amount"]}},"promises":{"maxItems":6,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"rating":{"type":"object","properties":{"value":{"type":"number","minimum":1,"maximum":5},"count":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string","maxLength":500},"checkedAt":{"type":"string","maxLength":40}},"required":["value","count"]},"bookingUrl":{"type":"string","maxLength":500},"privacyUrl":{"type":"string","maxLength":500},"timeZone":{"type":"string","maxLength":60}}},"offer":{"type":"object","properties":{"offerLine":{"type":"string","maxLength":60},"priceMode":{"type":"string","enum":["from","call"]},"priceText":{"type":"string","maxLength":60}}},"tracking":{"type":"object","properties":{"conversionId":{"type":"string","maxLength":100},"formLabel":{"type":"string","maxLength":100},"callLabel":{"type":"string","maxLength":100},"gtmId":{"type":"string","maxLength":100}}},"autoRebuild":{"type":"boolean","description":"true: each script run rebuilds the pages whose ads changed, as drafts, each page at most once a day. Drafts edited by hand are skipped. It never publishes."}},"description":"Send only what changes. facts, offer and tracking are merged into what is saved, not replaced; \"\" clears a text field."},"ImportSiteBody":{"type":"object","properties":{"url":{"type":"string","maxLength":300}}},"BuildBody":{"type":"object","properties":{"adGroupIds":{"type":"array","items":{"type":"string","pattern":"^\\d+$"},"description":"Build only these ad groups, live ones included."},"changedOnly":{"type":"boolean","description":"Build only the pages whose ads changed and the new ad groups. Live pages go back to draft while the published version keeps serving."}},"description":"Send nothing to build every enabled Search ad group (live pages are left alone). adGroupIds wins when both are sent."},"PatchPageBody":{"type":"object","properties":{"content":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":60,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"seo":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","minLength":1,"maxLength":155}},"required":["title","description"]},"hero":{"type":"object","properties":{"areaLine":{"type":"string","minLength":1,"maxLength":60},"headline":{"type":"string","minLength":20,"maxLength":60},"subhead":{"type":"string","minLength":1,"maxLength":120},"offerLine":{"type":"string","maxLength":60},"price":{"type":"object","properties":{"mode":{"type":"string","enum":["from","call"]},"text":{"type":"string","maxLength":60}},"required":["mode"]}},"required":["areaLine","headline","subhead"]},"form":{"type":"object","properties":{"extraFields":{"maxItems":2,"type":"array","items":{"type":"string","enum":["service","date","message"]}}},"required":["extraFields"]},"benefits":{"type":"array","prefixItems":[{"type":"string","minLength":1,"maxLength":40},{"type":"string","minLength":1,"maxLength":40},{"type":"string","minLength":1,"maxLength":40}],"items":false,"minItems":3,"maxItems":3},"reviews":{"type":"array","items":{"type":"object","properties":{"author":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":1000},"source":{"type":"string","enum":["google","website","other"]},"rating":{"type":"number","minimum":1,"maximum":5},"url":{"type":"string","maxLength":500},"location":{"type":"string","maxLength":80}},"required":["author","text","source"]}},"faq":{"maxItems":5,"type":"array","items":{"type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":200},"a":{"type":"string","minLength":1,"maxLength":300}},"required":["q","a"]}},"serviceArea":{"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"footer":{"type":"object","properties":{"businessName":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","minLength":1,"maxLength":40},"address":{"type":"string","maxLength":200},"licenseNo":{"type":"string","maxLength":60}},"required":["businessName","phone"]},"sections":{"type":"object","properties":{"reviews":{"type":"boolean"},"faq":{"type":"boolean"},"options":{"type":"boolean"},"fees":{"type":"boolean"}},"required":["reviews","faq","options","fees"]},"pain":{"minItems":3,"maxItems":3,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":220}},"required":["title","text"]}},"why":{"minItems":3,"maxItems":4,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":40},"text":{"type":"string","minLength":1,"maxLength":160}},"required":["title","text"]}},"steps":{"minItems":3,"maxItems":3,"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":30},"text":{"type":"string","minLength":1,"maxLength":120}},"required":["title","text"]}},"options":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"startingPrice":{"type":"string","maxLength":12},"includes":{"maxItems":4,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"useFor":{"type":"string","maxLength":80}},"required":["name"]}},"fees":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":40},"amount":{"type":"string","minLength":1,"maxLength":20},"note":{"type":"string","maxLength":100}},"required":["label","amount"]}},"rating":{"type":"object","properties":{"value":{"type":"number","minimum":1,"maximum":5},"count":{"type":"integer","minimum":1,"maximum":9007199254740991},"url":{"type":"string","maxLength":500},"checkedAt":{"type":"string","maxLength":40}},"required":["value","count"]}},"required":["slug","seo","hero","form","benefits","reviews","faq","serviceArea","footer","sections","pain","why","steps","options","fees"]}},"required":["content"],"description":"The whole content. It is checked again and its flags recomputed; a published page goes back to draft until published again."},"PublishBody":{"type":"object","properties":{"pageIds":{"type":"array","items":{"type":"string","minLength":1}},"versions":{"type":"object","propertyNames":{"type":"string","minLength":1},"additionalProperties":{"type":"integer","minimum":0,"maximum":9007199254740991}}}},"LeadForm":{"type":"object","properties":{"name":{"type":"string"},"phone":{"type":"string","minLength":1,"description":"At least 10 digits."},"email":{"type":"string"},"zip":{"type":"string"},"option":{"type":"string"},"message":{"type":"string"},"service":{"type":"string"},"date":{"type":"string"},"page_id":{"type":"string"},"page_version":{"type":"string"},"submission_id":{"type":"string","description":"A UUID made in the browser. A repeat with the same phone is answered as a duplicate and sends nothing."},"gclid":{"type":"string"},"gbraid":{"type":"string"},"wbraid":{"type":"string"},"utm_source":{"type":"string"},"utm_medium":{"type":"string"},"utm_campaign":{"type":"string"},"utm_term":{"type":"string"},"utm_content":{"type":"string"},"landing_page":{"type":"string"},"referrer":{"type":"string"},"company_website":{"type":"string","description":"Leave empty. A filled value is answered as success and nothing is saved."}},"required":["phone"],"description":"The live page form. Only phone is required."},"BlockEditBody":{"type":"object","properties":{"changes":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":60},"additionalProperties":{"type":"string","maxLength":2000},"description":"Block id to new text. Read the ids with GET /api/pages/{id}/blocks."},"note":{"type":"string","maxLength":200,"description":"Why the change was made. It is added to the version reason."}},"required":["changes"],"description":"Text changes by block id, 1 to 60 at a time. Dashes become commas, extra spaces go, and an edit equal to the current text is not a change. Locked and unknown ids are errors, never ignored."},"AuthLinkBody":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":254}},"required":["email"],"description":"The email to send a sign-in link to."},"QuickStartBody":{"type":"object","properties":{"website":{"type":"string","minLength":1,"maxLength":300,"description":"Their own site, like example.com."},"service":{"type":"string","maxLength":60,"description":"The page is built around it. Default: the first service the site lists, else \"Main service\"."},"town":{"type":"string","maxLength":60,"description":"Put first in the towns served."},"name":{"type":"string","maxLength":80,"description":"The business name. Default: the name the site shows, else its host."}},"required":["website"],"description":"The client website, and optionally the main service, the main town and the business name."},"FactsCheckBody":{"type":"object","properties":{"remove":{"maxItems":200,"type":"array","items":{"type":"string","pattern":"^(review|price|incl|use|fee|hours|address|license|rating|phone|booking|towns|services)-[0-9a-f]{8}$"},"description":"Ids from client.factsCheck.items, at most 200. An empty list keeps everything."},"confirmed":{"maxItems":200,"type":"array","items":{"type":"string","pattern":"^(review|price|incl|use|fee|hours|address|license|rating|phone|booking|towns|services)-[0-9a-f]{8}$"},"description":"Every id the person was shown. If the list has more items now, the answer is 409 CHECK_CHANGED: show them the new items."}},"required":["remove","confirmed"],"description":"The ids of the items to take out, and the ids the person was shown."},"CreateApiKeyBody":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"description":"A name that says where the key is used, like \"Office assistant\"."},"PutDomainBody":{"type":"object","properties":{"hostname":{"type":"string","maxLength":300}},"required":["hostname"]},"ErrorResponse":{"type":"object","properties":{"ok":{"const":false},"error":{"$ref":"#/components/schemas/ApiError"}},"required":["ok","error"]}},"pathItems":{"NewLead":{"post":{"operationId":"newLead","summary":"A new lead, posted to the client leadWebhookUrl","description":"Sent once per lead, right after it is saved, as JSON with user-agent LandingPage.sh-LeadWebhook/1. Only a 2xx answer counts as delivered; redirects are not followed. Timeout 8 seconds, no retries. The result shows as webhookStatus and webhookError on the lead. Test leads are never forwarded.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadWebhookPayload"}}}},"responses":{"2XX":{"description":"Delivered."},"default":{"description":"Anything else (including a redirect or a timeout) marks the webhook as failed."}}}}}},"x-schema-notes":["customerId: written by hand. Sent as 123-456-7890 or digits; the server stores and returns digits only.","status: written by hand. The server accepts any string and stores statuses it does not know as UNKNOWN."]}