GenPages

Ask the AI builder to design a campaign's page. Returns a run id.

The builder writes its result straight onto the campaign, so once the run finishes, pages/design returns the new HTML and newly generated pages use it. Generation spends credits; with none left the request fails with 402.

By default the builder edits the campaign's existing design. Pass replace: true to have it start from a blank page instead.

post/api/external/v1/pages/generate

Request body

workspace_idinteger required

The workspace the campaign belongs to.

campaign_idinteger required

The campaign to design.

promptstring required

What to build or change.

replaceboolean nullable

Start from a blank page instead of editing the current design.

Example request

{
  "workspace_id": 55,
  "campaign_id": 231,
  "prompt": "A landing page for fintech CTOs, with a hero, three benefits, and a demo CTA."
}

Response

run_idstring
statusstring
campaign_idinteger

Example response

{
  "run_id": "run_01H…",
  "status": "queued",
  "campaign_id": 231
}

Changes