---
title: "Ask the AI builder to design a campaign's page. Returns a run id."
method: POST
path: "/api/external/v1/pages/generate"
tags: ["GenPages"]
---

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

`POST /api/external/v1/pages/generate`

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.

## Request body

- object
  - `workspace_id` integer, required — The workspace the campaign belongs to.
  - `campaign_id` integer, required — The campaign to design.
  - `prompt` string, required — What to build or change.
  - `replace` boolean, nullable — Start from a blank page instead of editing the current design.

## Response `200`

- object
  - `run_id` string
  - `status` string
  - `campaign_id` integer

## Other responses

- `402`

## Changes

- **2026-08-17** `dd3f47f72f7a` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/genpage/apis/genpage-external-api-documentation/changes/api/external/v1/pages/generate/post.md)

---

[API](https://skmtc.dev/genpage/apis/genpage-external-api-documentation.md) · [All operations](https://skmtc.dev/genpage/apis/genpage-external-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/genpage/genpage-external-api-documentation/revisions/29a37db12acb/schema)
