API reference · version 1

Website generator API

Everything the dashboard does — orders, status, archives, balance — is available programmatically. The API is available to every account: you create a key in the dashboard.

Quick start#

From a key to downloaded archives in four requests. Create a key in the dashboard with the generations:read and generations:write permissions and put it in the API_KEY environment variable.

  1. Read the catalog

    The catalog returns the values an order is built from: languages, styles, countries, verticals. It needs no key.

    curl "https://api.pagegeneration.com/v1/catalog"
    const response = await fetch('https://api.pagegeneration.com/v1/catalog');
    const data = await response.json();
    import requests
    
    response = requests.get(
        "https://api.pagegeneration.com/v1/catalog",
        timeout=90,
    )
    data = response.json()
  2. Create an order

    A minimal order is a site count, a style, a language and a brief. Make up the Idempotency-Key yourself: a new one for every new order. Take the order id from the response.

    curl -X POST "https://api.pagegeneration.com/v1/generations" \
      -H "Authorization: Bearer $API_KEY" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "Content-Type: application/json" \
      -d '{
      "count": 40,
      "style": "random",
      "language": "de",
      "target": "html",
      "vertical_category": "finance",
      "shuffle_pages": true,
      "brief": {
        "geo": "DE",
        "forbidden_words": [
          "garantiert"
        ]
      }
    }'
    const response = await fetch('https://api.pagegeneration.com/v1/generations', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.API_KEY}`,
        'Idempotency-Key': crypto.randomUUID(),
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        count: 40,
        style: 'random',
        language: 'de',
        target: 'html',
        vertical_category: 'finance',
        shuffle_pages: true,
        brief: {
          geo: 'DE',
          forbidden_words: ['garantiert'],
        },
      }),
    });
    const data = await response.json();
    import os
    import uuid
    
    import requests
    
    response = requests.post(
        "https://api.pagegeneration.com/v1/generations",
        headers={
            "Authorization": f"Bearer {os.environ['API_KEY']}",
            "Idempotency-Key": str(uuid.uuid4()),
        },
        json={
            "count": 40,
            "style": "random",
            "language": "de",
            "target": "html",
            "vertical_category": "finance",
            "shuffle_pages": True,
            "brief": {
                "geo": "DE",
                "forbidden_words": ["garantiert"],
            },
        },
        timeout=90,
    )
    data = response.json()
    Response 202
    {
      "id": "7b0e6a52-3f1c-4a8e-9d2b-5c1f0e8a4d37",
      "status": "queued",
      "created_at": "2026-11-12T10:00:00.000Z",
      "requested_count": 40,
      "geo_country_code": "DE",
      "vertical_category": "finance",
      "ready_count": 0,
      "failed_count": 0,
      "progress": 0,
      "seed": "0d7c1b9a-5e42-4f38-a6c1-9b3e7f2d4a60",
      "artifact_available_until": null
    }
  3. Wait until it is done

    A request with wait=60 returns when the status changes, or after a minute. Repeat it until status becomes succeeded, failed or cancelled.

    curl "https://api.pagegeneration.com/v1/generations/$GENERATION_ID?wait=60" \
      -H "Authorization: Bearer $API_KEY"
    const response = await fetch(`https://api.pagegeneration.com/v1/generations/${process.env.GENERATION_ID}?wait=60`, {
      headers: {
        Authorization: `Bearer ${process.env.API_KEY}`,
      },
    });
    const data = await response.json();
    import os
    
    import requests
    
    response = requests.get(
        f"https://api.pagegeneration.com/v1/generations/{os.environ['GENERATION_ID']}",
        headers={
            "Authorization": f"Bearer {os.environ['API_KEY']}",
        },
        params={
            "wait": "60",
        },
        timeout=90,
    )
    data = response.json()
  4. Download the archives

    The site list returns artifact_url — a link to the archive of every finished site. The link is valid for an hour and needs no key: fetch it with a plain GET.

    curl "https://api.pagegeneration.com/v1/generations/$GENERATION_ID/sites" \
      -H "Authorization: Bearer $API_KEY"
    const response = await fetch(`https://api.pagegeneration.com/v1/generations/${process.env.GENERATION_ID}/sites`, {
      headers: {
        Authorization: `Bearer ${process.env.API_KEY}`,
      },
    });
    const data = await response.json();
    import os
    
    import requests
    
    response = requests.get(
        f"https://api.pagegeneration.com/v1/generations/{os.environ['GENERATION_ID']}/sites",
        headers={
            "Authorization": f"Bearer {os.environ['API_KEY']}",
        },
        timeout=90,
    )
    data = response.json()
    Response 200
    {
      "items": [
        {
          "id": "c41d9f7e-08a2-4b6d-b3e5-2a9f6c0d1e84",
          "index": 0,
          "status": "ready",
          "artifact_url": "https://api.pagegeneration.com/v1/downloads/dC83YjBlNmE1Mi4uLg.4f9a…",
          "preview_url": null,
          "domain": null,
          "failure_reason": null
        }
      ]
    }

Instead of polling you can subscribe to events — see the Webhooks section.

Base URL and version#

Base URL:
https://api.pagegeneration.com/v1

The version is in the path: /v1. HTTPS only.

Requests and responses are UTF-8 JSON, except archive downloads. A request body can be up to 100 KB. A larger one gets 413 payload_too_large. Times are ISO 8601 in UTC. Identifiers are opaque strings: don’t parse them. An identifier in the path that the service never issued is 404 not_found.

Generation is asynchronous: creating an order returns immediately, and completion is reported by a webhook or by polling the status. There is no synchronous mode.

The language of the message field in errors is set by the Accept-Language header: en, uk or ru, en by default. Error codes, field names and the catalog don’t depend on the language.

What stays fixed in version 1

These don’t change without a new version in the path:

  • endpoint paths and methods;
  • order and site status values;
  • the error envelope;
  • event names;
  • archive retention periods;
  • the behaviour of the idempotency key.

New optional fields, new catalog values and new events may appear without a version change: skip what you don’t recognise instead of failing.

Authentication and permissions#

Pass the key in a header: Authorization: Bearer gen_live_…. Header only — never in the request URL.

You create a key in the dashboard: Profile → Access keys. The API is available to every activated account.

  • A key’s value is shown once, at creation; after that the list shows only its prefix.
  • Permissions are chosen when the key is created. A request without the required permission gets 403 forbidden; a request with no key or a revoked key gets 401 unauthorized.
  • An account can have up to 20 active keys. Create a separate key for each integration and give it only the permissions it needs.
  • Reissuing changes the value at once: the old one stops working at the same moment. To rotate a key without downtime, create a second key, switch the integration over and revoke the first.
  • Resetting a password revokes all keys created by that person.
  • A key cannot create another key, change the password or the sign-in settings — a person does that in the dashboard.
  • Keep the key on your server. Don’t put it in a browser or a mobile app.
Key permissions
PermissionMeaningEndpoints
generations:readRead orders and saved settings, download archivesGET /generationsGET /generations/{generationId}GET /generations/{generationId}/sitesGET /generations/{generationId}/artifactGET /generation-presets
generations:writeCreate, cancel and delete orders, save settingsPOST /catalog/language-requestsPOST /generationsPOST /generations/{generationId}/cancelDELETE /generations/{generationId}POST /generation-presetsDELETE /generation-presets/{presetId}
billing:readRead the balanceGET /credits
billing:writeIssue invoices for creditsPOST /credits/top-up
webhooks:manageManage event subscriptionsGET /webhooksPOST /webhooksDELETE /webhooks/{webhookId}

Errors#

An error is a 4xx or 5xx status with a body in a single envelope. Your code should branch on code and details; message is written for a person and may change. Quote request_id when contacting support.

Error envelope
{
  "error": {
    "code": "capacity_exhausted",
    "message": "The catalog can produce 8 distinct sites with this setting.",
    "details": {
      "max_count": 8,
      "required_section_reuse_limit": 2
    },
    "request_id": "8f3a1c5e-2d47-4b90-a6e1-0c9d7b2f4a63"
  }
}
FieldDescription
codeA machine code from the table below
messageAn explanation in the Accept-Language language
detailsDetails that depend on the code; not every error has them
request_idRequest identifier; present in every error the service returns
Error codes
StatusCodeMeaning
400validation_failedThe request couldn’t be parsed or a field is out of range. message says what exactly is wrong; for broken or empty JSON the reason is in details.reason
401unauthorizedThe key is missing, invalid or revoked, or the account is disabled
402insufficient_creditsNot enough credits. details.required is how many are needed, details.available is how many there are
403forbiddenThe key lacks the required permission
403account_not_activatedThe account is not activated yet: the email is not confirmed or an administrator has not approved the account
404not_foundNo such endpoint or object in your account. Someone else’s object and a malformed identifier look the same as a missing one
409conflictThe current state doesn’t allow the action: for example, the order has already finished or the archive isn’t ready
409limit_reachedA limit on the number of objects has been reached: saved settings or subscriptions
413payload_too_largeThe request body is larger than 100 KB
422capacity_exhaustedThe catalog can’t produce that many distinct sites. details.max_count is the achievable number, details.required_section_reuse_limit is the reuse limit that would work, or null
422idempotency_key_reusedThe idempotency key was already used with a different request body
429rate_limitedToo many requests. Wait and try again
500internal_errorA failure on the service side. Try again later; for order creation, with the same Idempotency-Key
503service_pausedThe service is temporarily not accepting orders. Credits are untouched; try again later

A 429 response to exceeding the request rate may come without a JSON body and without `request_id`. Detect it by the status, not by parsing the body.

Idempotency#

Creating an order — POST /generations — requires an Idempotency-Key header: a string of 8 to 128 characters, for example a UUID or the order number in your system. Without it, or with a shorter or longer one, you get 400.

Repeating a request with the same key and the same body returns the stored first response: no second order is created and credits aren’t reserved twice. The response comes back as it was at creation time — read the current state by the order id.

The same key with a different body is 422 idempotency_key_reused. The parsed body is compared: whitespace and line breaks don’t matter, field order does. Repeat the request unchanged.

A key is remembered only together with a created order. After a refusal — 400, 402, 422, 503 — you can send the same key again, for example after topping up the balance.

Keys are scoped to the account. A key record is stored for at least 24 hours: during that time a repeat is guaranteed to return the first response. Then the record is deleted — within an hour after that — and a request with the same key creates a new order. Retry within 24 hours, and generate a new key for every new order.

Other endpoints don’t read the header. Cancelling, deleting and deactivating are safe to repeat; repeating the creation of an invoice, a subscription or saved settings creates one more object.

Rate limits and retries#

  • No more than 10 requests per second from one address. A short burst of up to 40 requests above that passes; beyond it you get 429.
  • A long poll is one request lasting up to 60 seconds: there is no need to poll more often.
  • On 429, pause for a second or more and increase the pause with every retry. The response may have no Retry-After header.
What to retry
SituationWhat to do
A timeout or a dropped connection while creating an orderRetry with the same Idempotency-Key and the same body
429Retry with a growing pause
500 internal_error, 503 service_pausedRetry later; for order creation, with the same key
402 insufficient_creditsTop up the balance and retry; you can keep the key
400, 401, 403, 404, 409, 413, 422Don’t retry unchanged: fix the request or the key, or wait for a different state

Order lifecycle#

An order goes from queued to one of three final statuses. A final status never changes.

Order statuses
StatusMeaning
queuedAccepted, credits reserved, waiting in the queue
runningSites are being built; ready_count grows
succeededFinished with at least one site ready. Compare ready_count with requested_count: some sites may have failed
failedFinished without a single ready site. All reserved credits are returned; the reason, if the service knows it, is in error
cancelledCancelled by you. Sites ready by that moment are paid for and available
Site statuses
StatusMeaning
queuedWaiting for its turn inside the order
planningStructure, pages and design are being chosen
writingCopy is being written
buildingFiles and the archive are being assembled
readyReady: the credit is charged and artifact_url is set
failedFailed: its credit is returned when the order finishes

When credits are charged

  • Creating an order reserves one credit for every ordered site: they move from available to reserved.
  • A credit is charged when a site is ready and its archive is stored.
  • When the order finishes — with any of the three statuses — credits for sites that never became ready go back to available.

Queue

  • Up to 2 orders of an account are in progress at once; the rest wait in queued and start on their own.
  • Sites of an order are built in parallel, up to 20 at a time, so ready_count grows in steps.
  • An order that couldn’t start within 72 hours is closed with status failed and its credits are returned; error.code is budget_hold_expired.

When an order is stalled

An unfinished order that isn’t moving gets a waiting_reason field. You can cancel such an order in both cases.

waiting_reasonMeaning
awaiting_startWaiting to start: credits are reserved but not charged; the order will start on its own
technical_delayA technical delay: finished sites can already be downloaded, credits for the rest aren’t charged; the order will continue on its own

The list of values may grow: show an unknown value as “waiting”.

Catalog#

The values an order is built from. Read the catalog before building an order: the lists keep growing.

GET/catalog#

Permission: no key

Everything a valid order is built from: block roles, styles, delivery technologies, languages, countries, prepared pages, verticals and request limits.

  • The response is cached for up to a minute, and order intake re-checks everything itself.
  • Titles and descriptions (title, description) are not translated and don’t depend on Accept-Language. In your own interface show your own names by the keys: role, style, country_code, key.
  • The lists grow: don’t hard-code them.
curl "https://api.pagegeneration.com/v1/catalog"
const response = await fetch('https://api.pagegeneration.com/v1/catalog');
const data = await response.json();
import requests

response = requests.get(
    "https://api.pagegeneration.com/v1/catalog",
    timeout=90,
)
data = response.json()

Response 200. The response body is the object Catalog.

Response 200
{
  "roles": [
    {
      "role": "faq",
      "title": "…",
      "description": "…",
      "repeatable": false,
      "always_present": false,
      "requires_items": true,
      "styles": [
        "restrained",
        "editorial"
      ]
    }
  ],
  "styles": [
    {
      "style": "restrained",
      "title": "…",
      "description": "…"
    },
    {
      "style": "random",
      "title": "…",
      "description": "…"
    }
  ],
  "targets": [
    {
      "target": "html",
      "title": "HTML"
    },
    {
      "target": "php",
      "title": "PHP"
    }
  ],
  "languages": [
    "de",
    "en",
    "pl"
  ],
  "countries": [
    {
      "country_code": "DE",
      "title": "…"
    },
    {
      "country_code": "random",
      "title": "…"
    }
  ],
  "pages": [
    {
      "path": "/pricing",
      "title": "…",
      "required_roles": [
        "pricing"
      ],
      "linked_paths": [],
      "always_present": false,
      "legal": false
    }
  ],
  "vertical_categories": [
    {
      "key": "finance",
      "topics": [
        "accounting services",
        "insurance agency",
        "tax consulting"
      ]
    }
  ],
  "default_pages": [
    {
      "path": "/",
      "roles": [
        "header",
        "hero",
        "contentText",
        "faq",
        "callToAction",
        "footer"
      ]
    }
  ],
  "default_pages_max_count": 20,
  "limits": {
    "max_sites_per_generation": 100,
    "max_pages_per_site": 20,
    "max_roles_per_page": 30,
    "max_brief_length": 2000,
    "max_directives_length": 1000,
    "max_generation_presets": 10
  }
}

POST/catalog/language-requests#

Permission: generations:write

Ask to add a language or a country that the catalog doesn’t have. Send at least one of the two; a code that is already in the catalog is rejected with 400. The response only means “passed on”: no date is promised.

  • No more than 3 requests per hour per account; beyond that — 429 rate_limited.
Request parameters
FieldTypeRulesDescription
language_codestring^[a-z]{2}$An ISO 639-1 language code that is not in the catalog’s languages
country_codestring^[A-Z]{2}$An ISO 3166-1 alpha-2 country code that is not in the catalog’s countries
commentstringup to 500 charactersA note in your own words
curl -X POST "https://api.pagegeneration.com/v1/catalog/language-requests" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "language_code": "nl",
  "country_code": "NL"
}'
const response = await fetch('https://api.pagegeneration.com/v1/catalog/language-requests', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    language_code: 'nl',
    country_code: 'NL',
  }),
});
import os

import requests

response = requests.post(
    "https://api.pagegeneration.com/v1/catalog/language-requests",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    json={
        "language_code": "nl",
        "country_code": "NL",
    },
    timeout=90,
)

Response 204. No body.

Errors: 400 validation_failed401 unauthorized403 forbidden429 rate_limited

ObjectCatalog#

FieldTypeRulesDescription
roles[]object[]always presentBlock roles. You name a role; the service picks the block variant
roles[].rolestringalways presentRole key — for the order’s pages[].roles
roles[].titlestringalways presentTitle
roles[].descriptionstringalways presentWhat the block does on a page
roles[].repeatablebooleanalways presentWhether the role can appear on a page more than once
roles[].always_presentbooleanalways presentThe block is always on the page: its chance is 100 only
roles[].requires_itemsbooleanalways presentThe block consists of repeating items: cards, questions, plans
roles[].stylesstring[]always presentStyles in which the role is available. The set of roles changes with the style
styles[]object[]always presentStyles. The last entry is random: the service picks the style
styles[].stylestringalways presentStyle key — for the order’s style
styles[].titlestringalways presentTitle
styles[].descriptionstringalways presentDescription
targets[]object[]always presentDelivery technologies
targets[].targetstringalways presenthtmlphpKey — for the order’s target
targets[].titlestringalways presentTitle
languagesstring[]always presentLanguage codes — for the order’s language
countries[]object[]always presentCountries. The last entry is random: the service picks a country for each site
countries[].country_codestringalways presentCountry code — for the order’s brief.geo
countries[].titlestringalways presentTitle
pages[]object[]always presentPrepared pages: an order can name only these
pages[].pathstringalways presentPath — for the order’s pages[].path
pages[].titlestringalways presentTitle
pages[].required_rolesstring[]always presentBlocks the page exists for: order intake inserts the missing ones itself
pages[].linked_pathsstring[]always presentPages that are added together with this one
pages[].always_presentbooleanalways presentEvery site has this page: it is added automatically and doesn’t count towards the page limit
pages[].legalbooleanalways presentA legal page
vertical_categories[]object[]always presentVerticals
vertical_categories[].keystringalways presentKey — for the order’s vertical_category
vertical_categories[].topicsstring[]always presentTopics of the vertical, in English
default_pages[]object[]always presentA starter page set with roles: you can send it as pages as is
default_pages[].pathstringalways presentPage path
default_pages[].rolesstring[]always presentBlock roles in order
default_pages_max_countintegeralways present0–20An estimate: how many distinct sites the starter set yields in one order
limits.max_sites_per_generationintegeralways presentSites per order
limits.max_pages_per_siteintegeralways presentPages per site
limits.max_roles_per_pageintegeralways presentBlocks per page
limits.max_brief_lengthintegeralways presentBrief length limit, characters
limits.max_directives_lengthintegeralways presentLength limit of brief.content_directives, characters
limits.max_generation_presetsintegeralways presentSaved settings per account

Orders#

Creating an order, its state, cancellation, sites and archives.

POST/generations#

Permission: generations:write

Create an order. The request is fully checked before any charge: shape, language and style from the catalog, variety capacity, balance. The 202 response comes immediately; the sites are built in the background.

  • Credits are reserved for the whole order, one per site. If there aren’t enough — 402 insufficient_credits, with required and available in details.
  • If the catalog can’t produce that many distinct sites — 422 capacity_exhausted: details.max_count is the achievable number, details.required_section_reuse_limit is the smallest section_reuse_limit that would pass, or null.
  • Per-site lists — domains, business_names, form_endpoints — follow the order of sites; null or a missing item means “no value”. verticals are dealt out in a cycle.
  • A privacy policy and terms of use are added to every site automatically and don’t count towards the page limit.
  • Unknown body fields are not stored. Control and invisible characters in strings are rejected with 400.
Request parameters
FieldTypeRulesDescription
Idempotency-Keyheaderstringrequired8–128The request retry key, see the Idempotency section
countintegerrequired1–100How many sites to make
stylestringrequiredup to 64 charactersA style from the catalog’s styles, or random — the service picks the style
languagestringrequiredSite language: a code from the catalog’s languages
briefobjectrequiredThe business description. The object is required, its fields are not: an empty object is fine
brief.geostringCountry: a code from the catalog’s countries, or random. It determines the company’s address, phone and legal form. Missing or unrecognised — the service picks a country for each site
brief.business_namestringup to 120 charactersCompany name, shared by all sites of the order
brief.verticalstringup to 200 charactersWhat the company does — the shared topic of the sites
brief.required_mentionsstring[]up to 30 itemsup to 200 charactersPhrases you want in the copy. The service requires each one to be included in the site language (a phrase in another language is translated) and re-checks the result. There is no guarantee: a phrase that is still missing after a retry is not added by the service itself
brief.forbidden_wordsstring[]up to 30 itemsup to 100 charactersWords and phrases that must not appear in the copy
brief.tone_of_voicestringup to 200 charactersTone of the copy, in your own words
brief.content_directivesstringup to 1000 charactersGuidance for the content of the copy. It doesn’t change the page set or the blocks
targetstringdefaulthtmlhtmlphpDelivery technology, one per order. php — pages as .php files; the site needs PHP hosting
vertical_categorystringup to 64 charactersA vertical key from the catalog’s vertical_categories, or random. It applies only to sites without their own topic: such a site gets a random topic of this vertical and its delivery. No field — a random vertical. An unknown key is 400
shuffle_pagesbooleandefaultfalsetrue — every site gets its own page set and its own order of middle blocks; the set comes from pages, or from the catalog when pages is absent. The home page is always there
pagesobject[]up to 20 itemsThe page set. Required unless shuffle_pages: true is set
pages[].pathstringrequiredA page path from the catalog’s pages
pages[].rolesstring[]requiredup to 30 itemsBlock roles in order: header first, footer last. A role with repeatable: false appears at most once
pages[].chancesinteger[]1–100up to 30 itemsThe chance of a block appearing, in percent; same length and order as roles. No field — all 100
section_reuse_limitintegerdefault1001–100How many sites of the order may get the same block variant. 1 — no repeats
verticals(string | null)[]up to 100 itemsup to 200 charactersTopics per site, dealt out in a cycle; null — the shared topic. vertical_category has no effect on a site with its own topic
business_names(string | null)[]up to 100 itemsup to 120 charactersNames in site order; null or a missing item — the shared name, and without it — one derived from the domain or chosen by the service
domains(string | null)[]up to 100 itemsup to 253 charactersDomains in site order, host name only: example.com. A site without a domain gets a placeholder in the .example zone
form_endpointstringup to 2048 charactersForm handler for all sites: an https://… URL, or the word php — a PHP handler in the site archive
form_endpoints(string | null)[]up to 100 itemsup to 2048 charactersForm handlers in site order; they take priority over the shared form_endpoint
seedstringup to 128 charactersThe order seed: the service’s random choices depend on it, for example the style for random. If omitted, the service generates one and returns it in the response
curl -X POST "https://api.pagegeneration.com/v1/generations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "count": 40,
  "style": "random",
  "language": "de",
  "target": "html",
  "vertical_category": "finance",
  "shuffle_pages": true,
  "brief": {
    "geo": "DE",
    "forbidden_words": [
      "garantiert"
    ]
  }
}'
const response = await fetch('https://api.pagegeneration.com/v1/generations', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    count: 40,
    style: 'random',
    language: 'de',
    target: 'html',
    vertical_category: 'finance',
    shuffle_pages: true,
    brief: {
      geo: 'DE',
      forbidden_words: ['garantiert'],
    },
  }),
});
const data = await response.json();
import os
import uuid

import requests

response = requests.post(
    "https://api.pagegeneration.com/v1/generations",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "count": 40,
        "style": "random",
        "language": "de",
        "target": "html",
        "vertical_category": "finance",
        "shuffle_pages": True,
        "brief": {
            "geo": "DE",
            "forbidden_words": ["garantiert"],
        },
    },
    timeout=90,
)
data = response.json()

Response 202. The response body is the object Order.

Response 202
{
  "id": "7b0e6a52-3f1c-4a8e-9d2b-5c1f0e8a4d37",
  "status": "queued",
  "created_at": "2026-11-12T10:00:00.000Z",
  "requested_count": 40,
  "geo_country_code": "DE",
  "vertical_category": "finance",
  "ready_count": 0,
  "failed_count": 0,
  "progress": 0,
  "seed": "0d7c1b9a-5e42-4f38-a6c1-9b3e7f2d4a60",
  "artifact_available_until": null
}

Errors: 400 validation_failed401 unauthorized402 insufficient_credits403 forbidden422 capacity_exhausted422 idempotency_key_reused503 service_paused

GET/generations#

Permission: generations:read

The account’s orders, newest first, page by page.

  • Next to items comes next_cursor: pass it as cursor to get the next page; null means there are no more pages.
  • An unknown status value isn’t rejected: the filter is simply not applied.
Request parameters
FieldTypeRulesDescription
statusin query stringstringqueuedrunningsucceededfailedcancelledOnly orders in this status
limitin query stringintegerdefault251–100Page size
cursorin query stringstringThe next_cursor value from the previous response; a broken one is 400
curl "https://api.pagegeneration.com/v1/generations?status=running&limit=50" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch('https://api.pagegeneration.com/v1/generations?status=running&limit=50', {
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
const data = await response.json();
import os

import requests

response = requests.get(
    "https://api.pagegeneration.com/v1/generations",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    params={
        "status": "running",
        "limit": "50",
    },
    timeout=90,
)
data = response.json()

Response 200. The response body is an object with an items array; each item is the object Order.

Response 200
{
  "items": [
    {
      "id": "7b0e6a52-3f1c-4a8e-9d2b-5c1f0e8a4d37",
      "status": "running",
      "created_at": "2026-11-12T10:00:00.000Z",
      "requested_count": 40,
      "geo_country_code": "DE",
      "vertical_category": "finance",
      "ready_count": 20,
      "failed_count": 0,
      "progress": 0.5,
      "seed": "0d7c1b9a-5e42-4f38-a6c1-9b3e7f2d4a60",
      "artifact_available_until": "2026-12-12T10:14:05.000Z"
    }
  ],
  "next_cursor": null
}

Errors: 400 validation_failed401 unauthorized403 forbidden

GET/generations/{generationId}#

Permission: generations:read

The state of an order. With the wait parameter the connection is held until the status changes or the time runs out — long polling for those who don’t need their own server for webhooks.

  • A wait response returns early only when status changes: growth of ready_count within running doesn’t wake it.
  • A wait value above 60 is treated as 60.
Request parameters
FieldTypeRulesDescription
generationIdin pathstringrequiredOrder identifier
waitin query stringinteger1–60How many seconds to wait for a status change
curl "https://api.pagegeneration.com/v1/generations/$GENERATION_ID?wait=60" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch(`https://api.pagegeneration.com/v1/generations/${process.env.GENERATION_ID}?wait=60`, {
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
const data = await response.json();
import os

import requests

response = requests.get(
    f"https://api.pagegeneration.com/v1/generations/{os.environ['GENERATION_ID']}",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    params={
        "wait": "60",
    },
    timeout=90,
)
data = response.json()

Response 200. The response body is the object Order.

Response 200
{
  "id": "7b0e6a52-3f1c-4a8e-9d2b-5c1f0e8a4d37",
  "status": "running",
  "created_at": "2026-11-12T10:00:00.000Z",
  "requested_count": 40,
  "geo_country_code": "DE",
  "vertical_category": "finance",
  "ready_count": 20,
  "failed_count": 0,
  "progress": 0.5,
  "seed": "0d7c1b9a-5e42-4f38-a6c1-9b3e7f2d4a60",
  "artifact_available_until": "2026-12-12T10:14:05.000Z"
}

Errors: 401 unauthorized403 forbidden404 not_found

POST/generations/{generationId}/cancel#

Permission: generations:write

Cancel an order in status queued or running. Finished sites stay paid for and available; credits for the rest are returned.

  • A site that is already being built at the moment of cancellation may still be finished.
  • An order that isn’t in your account is 404 not_found; one that has already finished or been cancelled is 409 conflict.
  • No Idempotency-Key is needed: repeating a cancellation is harmless.
Request parameters
FieldTypeRulesDescription
generationIdin pathstringrequiredOrder identifier
curl -X POST "https://api.pagegeneration.com/v1/generations/$GENERATION_ID/cancel" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch(`https://api.pagegeneration.com/v1/generations/${process.env.GENERATION_ID}/cancel`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
const data = await response.json();
import os

import requests

response = requests.post(
    f"https://api.pagegeneration.com/v1/generations/{os.environ['GENERATION_ID']}/cancel",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    timeout=90,
)
data = response.json()

Response 200. The response body is the object Order.

Response 200
{
  "id": "7b0e6a52-3f1c-4a8e-9d2b-5c1f0e8a4d37",
  "status": "cancelled",
  "created_at": "2026-11-12T10:00:00.000Z",
  "requested_count": 40,
  "geo_country_code": "DE",
  "vertical_category": "finance",
  "ready_count": 20,
  "failed_count": 0,
  "progress": 0.5,
  "seed": "0d7c1b9a-5e42-4f38-a6c1-9b3e7f2d4a60",
  "artifact_available_until": "2026-12-12T10:14:05.000Z"
}

Errors: 401 unauthorized403 forbidden404 not_found409 conflict

DELETE/generations/{generationId}#

Permission: generations:write

Delete the input data of a finished order — brief, domains, names — and the generated copy. Archives stay available until the end of their retention period.

  • Only for orders in status succeeded, failed or cancelled; otherwise 409 conflict. A cancelled order that is still finishing a site also answers 409 — try again later.
  • After deletion the order responses have no business_name, vertical_category and geo_country_code, and the sites’ domain is null.
  • The idempotency key record is kept: repeating the creation with the same key still returns the first response.
Request parameters
FieldTypeRulesDescription
generationIdin pathstringrequiredOrder identifier
curl -X DELETE "https://api.pagegeneration.com/v1/generations/$GENERATION_ID" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch(`https://api.pagegeneration.com/v1/generations/${process.env.GENERATION_ID}`, {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
import os

import requests

response = requests.delete(
    f"https://api.pagegeneration.com/v1/generations/{os.environ['GENERATION_ID']}",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    timeout=90,
)

Response 204. No body.

Errors: 401 unauthorized403 forbidden404 not_found409 conflict

GET/generations/{generationId}/sites#

Permission: generations:read

The sites of an order in order, with the state of each and a link to its archive.

  • artifact_url is signed anew on every call and is valid for an hour. If the link has expired, request the list again.
Request parameters
FieldTypeRulesDescription
generationIdin pathstringrequiredOrder identifier
curl "https://api.pagegeneration.com/v1/generations/$GENERATION_ID/sites" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch(`https://api.pagegeneration.com/v1/generations/${process.env.GENERATION_ID}/sites`, {
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
const data = await response.json();
import os

import requests

response = requests.get(
    f"https://api.pagegeneration.com/v1/generations/{os.environ['GENERATION_ID']}/sites",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    timeout=90,
)
data = response.json()

Response 200. The response body is an object with an items array; each item is the object Site.

Response 200
{
  "items": [
    {
      "id": "c41d9f7e-08a2-4b6d-b3e5-2a9f6c0d1e84",
      "index": 0,
      "status": "ready",
      "artifact_url": "https://api.pagegeneration.com/v1/downloads/dC83YjBlNmE1Mi4uLg.4f9a…",
      "preview_url": null,
      "domain": null,
      "failure_reason": null
    }
  ]
}

Errors: 401 unauthorized403 forbidden404 not_found

GET/generations/{generationId}/artifact#

Permission: generations:read

The whole order as one file: a 302 response to a signed link that is valid for an hour.

  • The archive holds one nested archive per finished site: site-001.zip, site-002.zip and so on by ordinal number.
  • It works for an order in progress too: the archive contains the sites that are ready at the time of the request. No ready site, or all archives deleted after retention — 409 conflict.
Request parameters
FieldTypeRulesDescription
generationIdin pathstringrequiredOrder identifier
curl -L -o order.zip "https://api.pagegeneration.com/v1/generations/$GENERATION_ID/artifact" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch(`https://api.pagegeneration.com/v1/generations/${process.env.GENERATION_ID}/artifact`, {
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
const archive = await response.arrayBuffer();
import os

import requests

response = requests.get(
    f"https://api.pagegeneration.com/v1/generations/{os.environ['GENERATION_ID']}/artifact",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    timeout=90,
)
archive = response.content

Response 302. No body; the signed link is in the Location header.

Errors: 401 unauthorized403 forbidden404 not_found409 conflict

GET/downloads/{token}#

Permission: no key

Download an archive by the signed link from artifact_url or from the redirect. No key is needed: the signature in the link is the pass.

  • Use the link as you received it; don’t build it yourself.
  • A forged link, an expired link and an archive deleted after retention all answer the same — 404 not_found.
Request parameters
FieldTypeRulesDescription
tokenin pathstringrequiredThe signature from the issued link
curl -o site.zip "https://api.pagegeneration.com/v1/downloads/$DOWNLOAD_TOKEN"
const response = await fetch(`https://api.pagegeneration.com/v1/downloads/${process.env.DOWNLOAD_TOKEN}`);
const archive = await response.arrayBuffer();
import os

import requests

response = requests.get(
    f"https://api.pagegeneration.com/v1/downloads/{os.environ['DOWNLOAD_TOKEN']}",
    timeout=90,
)
archive = response.content

Response 200. An application/zip archive, always as an attachment.

Errors: 404 not_found

ObjectOrder#

FieldTypeRulesDescription
idstringalways presentOrder identifier
statusstringalways presentqueuedrunningsucceededfailedcancelledStatus, see Order lifecycle
created_atdate-timealways presentCreation time
requested_countintegeralways presentHow many sites were ordered
ready_countintegeralways presentHow many sites are ready and downloadable
failed_countintegeralways presentHow many sites failed
progressnumberalways present0–1Share of ready sites — for a progress bar, not for logic
seedstringalways presentOrder seed
business_namestringmay be absentThe name from brief.business_name or the first of business_names; if neither is set, the field is absent
vertical_categorystringmay be absentThe order’s vertical or random; absent after the input data is deleted
geo_country_codestringmay be absentThe accepted country or random; absent after the input data is deleted
artifact_available_untildate-time | nullalways presentUntil when the order archive is available: readiness of the last site plus 30 days. null while no site is ready
waiting_reasonstringmay be absentawaiting_starttechnical_delayWhy an unfinished order is stalled; absent when the order is moving
errorobjectmay be absentWhy the service closed the order without a result. If the sites simply failed, the field is absent: the reasons are in the sites’ failure_reason
error.codestringmay be absentA machine code of the reason, for example budget_hold_expired or enqueue_failed; in both cases the credits are returned. The set of codes is open
error.messagestringmay be absentAn explanation in the Accept-Language language; may change

ObjectSite#

FieldTypeRulesDescription
idstringalways presentSite identifier
indexintegeralways presentOrdinal number within the order, from zero
statusstringalways presentqueuedplanningwritingbuildingreadyfailedStatus, see Order lifecycle
artifact_urlstring | nullalways presentA signed link to the site archive, valid for an hour. null until the site is ready and after the archive is deleted on expiry
domainstring | nullalways presentThe domain from the order’s domains, or null
failure_reasonstring | nullalways presentA machine code of the last failure, or null. The set of codes is open: show an unknown code as is
preview_urlnullalways presentReserved; always null for now

Saved settings#

An order body or a page set stored under a name. The service only stores them: when creating an order, send the whole body.

GET/generation-presets#

Permission: generations:read

The account’s saved settings, newest first.

curl "https://api.pagegeneration.com/v1/generation-presets" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch('https://api.pagegeneration.com/v1/generation-presets', {
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
const data = await response.json();
import os

import requests

response = requests.get(
    "https://api.pagegeneration.com/v1/generation-presets",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    timeout=90,
)
data = response.json()

Response 200. The response body is an object with an items array; each item is the object Saved settings.

Response 200
{
  "items": [
    {
      "id": "2f6b8c1d-7a3e-4c59-8d0b-6e1f4a9c3b72",
      "name": "DE finance, 40 sites",
      "kind": "request",
      "request": {
        "count": 40,
        "style": "random",
        "language": "de",
        "target": "html",
        "vertical_category": "finance",
        "shuffle_pages": true,
        "brief": {
          "geo": "DE",
          "forbidden_words": [
            "garantiert"
          ]
        }
      },
      "created_at": "2026-11-12T09:40:00.000Z"
    }
  ]
}

Errors: 401 unauthorized403 forbidden

POST/generation-presets#

Permission: generations:write

Save settings so you don’t have to rebuild the order body. Only the shape is checked here; the full check happens when an order is created.

  • Kind request needs count, style, language and brief inside request; seed is not stored. Kind pages needs a non-empty pages.
  • No more than 10 per account; beyond that — 409 limit_reached.
Request parameters
FieldTypeRulesDescription
namestringrequiredup to 80 charactersName
kindstringdefaultrequestrequestpagesrequest — the whole order body, pages — only the page set
requestobjectThe order body, for kind request
pagesobject[]The page set, for kind pages
curl -X POST "https://api.pagegeneration.com/v1/generation-presets" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "DE finance, 40 sites",
  "kind": "request",
  "request": {
    "count": 40,
    "style": "random",
    "language": "de",
    "target": "html",
    "vertical_category": "finance",
    "shuffle_pages": true,
    "brief": {
      "geo": "DE",
      "forbidden_words": [
        "garantiert"
      ]
    }
  }
}'
const response = await fetch('https://api.pagegeneration.com/v1/generation-presets', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'DE finance, 40 sites',
    kind: 'request',
    request: {
      count: 40,
      style: 'random',
      language: 'de',
      target: 'html',
      vertical_category: 'finance',
      shuffle_pages: true,
      brief: {
        geo: 'DE',
        forbidden_words: ['garantiert'],
      },
    },
  }),
});
const data = await response.json();
import os

import requests

response = requests.post(
    "https://api.pagegeneration.com/v1/generation-presets",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    json={
        "name": "DE finance, 40 sites",
        "kind": "request",
        "request": {
            "count": 40,
            "style": "random",
            "language": "de",
            "target": "html",
            "vertical_category": "finance",
            "shuffle_pages": True,
            "brief": {
                "geo": "DE",
                "forbidden_words": ["garantiert"],
            },
        },
    },
    timeout=90,
)
data = response.json()

Response 201. The response body is the object Saved settings.

Response 201
{
  "id": "2f6b8c1d-7a3e-4c59-8d0b-6e1f4a9c3b72",
  "name": "DE finance, 40 sites",
  "kind": "request",
  "request": {
    "count": 40,
    "style": "random",
    "language": "de",
    "target": "html",
    "vertical_category": "finance",
    "shuffle_pages": true,
    "brief": {
      "geo": "DE",
      "forbidden_words": [
        "garantiert"
      ]
    }
  },
  "created_at": "2026-11-12T09:40:00.000Z"
}

Errors: 400 validation_failed401 unauthorized403 forbidden409 limit_reached

DELETE/generation-presets/{presetId}#

Permission: generations:write

Delete saved settings.

Request parameters
FieldTypeRulesDescription
presetIdin pathstringrequiredSaved settings identifier
curl -X DELETE "https://api.pagegeneration.com/v1/generation-presets/$PRESET_ID" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch(`https://api.pagegeneration.com/v1/generation-presets/${process.env.PRESET_ID}`, {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
import os

import requests

response = requests.delete(
    f"https://api.pagegeneration.com/v1/generation-presets/{os.environ['PRESET_ID']}",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    timeout=90,
)

Response 204. No body.

Errors: 401 unauthorized403 forbidden404 not_found

ObjectSaved settings#

FieldTypeRulesDescription
idstringalways presentIdentifier
namestringalways presentName
kindstringalways presentrequestpagesKind: the whole order body or only the page set
requestobjectmay be absentThe order body without seed; only for kind request
pagesobject[]may be absentThe page set; only for kind pages
created_atdate-timealways presentWhen it was saved

Credits and invoices#

One credit is one finished site. Credits are bought with an invoice that a person pays in a browser.

GET/credits#

Permission: billing:read

The account’s credit balance.

curl "https://api.pagegeneration.com/v1/credits" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch('https://api.pagegeneration.com/v1/credits', {
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
const data = await response.json();
import os

import requests

response = requests.get(
    "https://api.pagegeneration.com/v1/credits",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    timeout=90,
)
data = response.json()

Response 200. The response body is the object Balance.

Response 200
{
  "available": 460,
  "reserved": 40,
  "spent_today": 20,
  "credit_price_usd": 2.5,
  "minimum_top_up_credits": 8
}

Errors: 401 unauthorized403 forbidden

POST/credits/top-up#

Permission: billing:write

Issue an invoice for credits. This call doesn’t change the balance: credits are added once the payment service confirms the payment. A person pays the invoice in a browser at payment_url.

  • A purchase below minimum_top_up_credits from the balance is 400; details.minimum_top_up_credits holds the smallest allowed number.
  • No more than 5 unpaid invoices per hour per account; a request that arrives while the previous invoice is still being created also gets 429 rate_limited.
  • After payment, poll the balance: confirmation isn’t instant.
  • 409 conflict — payments are temporarily unavailable.
Request parameters
FieldTypeRulesDescription
credit_amountintegerrequired1–10000How many credits to buy
curl -X POST "https://api.pagegeneration.com/v1/credits/top-up" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "credit_amount": 500
}'
const response = await fetch('https://api.pagegeneration.com/v1/credits/top-up', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    credit_amount: 500,
  }),
});
const data = await response.json();
import os

import requests

response = requests.post(
    "https://api.pagegeneration.com/v1/credits/top-up",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    json={
        "credit_amount": 500,
    },
    timeout=90,
)
data = response.json()

Response 201. The response body is the object Invoice.

Response 201
{
  "invoice_id": "5e8d2a7c-4b1f-4e96-a3d0-7c9b1f5e2a48",
  "credit_amount": 500,
  "amount_usd": 1250,
  "payment_url": "https://pay.example/invoice/4821093376"
}

Errors: 400 validation_failed401 unauthorized403 forbidden409 conflict429 rate_limited

ObjectBalance#

FieldTypeRulesDescription
availableintegeralways presentAvailable to spend
reservedintegeralways presentReserved for orders in progress
spent_todayintegeralways presentCharged during the current UTC day
credit_price_usdnumberalways presentCredit price for your account, in US dollars
minimum_top_up_creditsintegeralways presentThe smallest purchase per invoice

ObjectInvoice#

FieldTypeRulesDescription
invoice_idstringalways presentInvoice identifier
credit_amountintegeralways presentHow many credits the invoice is for
amount_usdnumberalways presentInvoice amount in US dollars
payment_urlstringalways presentPayment page: open it in a browser

Webhooks#

Subscriptions to order events. How delivery works and how to verify the signature is covered in the Event delivery section.

GET/webhooks#

Permission: webhooks:manage

The account’s subscriptions, including deactivated ones (active: false).

curl "https://api.pagegeneration.com/v1/webhooks" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch('https://api.pagegeneration.com/v1/webhooks', {
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
const data = await response.json();
import os

import requests

response = requests.get(
    "https://api.pagegeneration.com/v1/webhooks",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    timeout=90,
)
data = response.json()

Response 200. The response body is an object with an items array; each item is the object Subscription.

Response 200
{
  "items": [
    {
      "id": "9a2c4e6f-1b3d-4f5a-8c7e-0d2b4f6a8c1e",
      "url": "https://hooks.partner.example/site-generator",
      "topics": [
        "site.ready",
        "generation.succeeded",
        "generation.failed"
      ],
      "active": true,
      "secret_preview": "Xk3vT9qL"
    }
  ]
}

Errors: 401 unauthorized403 forbidden

POST/webhooks#

Permission: webhooks:manage

Subscribe to events. The signing secret is returned only in this response — store it right away.

  • URL requirements are in the Event delivery section.
  • Up to 50 subscriptions per account and up to 10 per event; deactivated subscriptions count too. Exceeding the limit is 409 limit_reached.
Request parameters
FieldTypeRulesDescription
urlstringrequiredReceiver URL, https only
topicsstring[]requiredEvents from the events table, one or more
curl -X POST "https://api.pagegeneration.com/v1/webhooks" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://hooks.partner.example/site-generator",
  "topics": [
    "site.ready",
    "generation.succeeded",
    "generation.failed"
  ]
}'
const response = await fetch('https://api.pagegeneration.com/v1/webhooks', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://hooks.partner.example/site-generator',
    topics: ['site.ready', 'generation.succeeded', 'generation.failed'],
  }),
});
const data = await response.json();
import os

import requests

response = requests.post(
    "https://api.pagegeneration.com/v1/webhooks",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    json={
        "url": "https://hooks.partner.example/site-generator",
        "topics": ["site.ready", "generation.succeeded", "generation.failed"],
    },
    timeout=90,
)
data = response.json()

Response 201. The response body is the object Subscription.

Response 201
{
  "id": "9a2c4e6f-1b3d-4f5a-8c7e-0d2b4f6a8c1e",
  "url": "https://hooks.partner.example/site-generator",
  "topics": [
    "site.ready",
    "generation.succeeded",
    "generation.failed"
  ],
  "active": true,
  "secret_preview": "Xk3vT9qL",
  "secret": "Xk3vT9qLw2ZrB7nHc5JmYp0aGfD4sVu8EoNi6tK1xQe"
}

Errors: 400 validation_failed401 unauthorized403 forbidden409 limit_reached

DELETE/webhooks/{webhookId}#

Permission: webhooks:manage

Deactivate a subscription. It stops receiving events and stays in the list with active: false.

  • A deactivated subscription can’t be turned back on — create a new one.
Request parameters
FieldTypeRulesDescription
webhookIdin pathstringrequiredSubscription identifier
curl -X DELETE "https://api.pagegeneration.com/v1/webhooks/$WEBHOOK_ID" \
  -H "Authorization: Bearer $API_KEY"
const response = await fetch(`https://api.pagegeneration.com/v1/webhooks/${process.env.WEBHOOK_ID}`, {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
  },
});
import os

import requests

response = requests.delete(
    f"https://api.pagegeneration.com/v1/webhooks/{os.environ['WEBHOOK_ID']}",
    headers={
        "Authorization": f"Bearer {os.environ['API_KEY']}",
    },
    timeout=90,
)

Response 204. No body.

Errors: 401 unauthorized403 forbidden404 not_found

ObjectSubscription#

FieldTypeRulesDescription
idstringalways presentSubscription identifier
urlstringalways presentReceiver URL
topicsstring[]always presentThe subscription’s events
activebooleanalways presentfalse — the subscription is deactivated
secret_previewstringalways presentThe first characters of the secret — to recognise the subscription in the list
secretstringmay be absentThe full signing secret. Only in the creation response

Event delivery#

For every event the service sends a POST with a JSON body to the subscription URL. Any 2xx response within 10 seconds counts as delivered. Respond right away and do the work after responding.

Delivery
POST /site-generator HTTP/1.1
Host: hooks.partner.example
Content-Type: application/json
X-Event-Id: 3c5e7a91-2b4d-4f60-8a1c-e9d7b5f30a12
X-Delivery-Id: b8f1d2c3-6e4a-4b7d-9c05-1a2f3e4d5c6b
X-Topic: site.ready
X-Attempt: 1
X-Timestamp: 1794477600
X-Signature: v1=5f2c…e1a9

{"event_id":"3c5e7a91-2b4d-4f60-8a1c-e9d7b5f30a12","topic":"site.ready","occurred_at":"2026-11-12T10:00:00.000Z","data":{"generation_id":"7b0e6a52-3f1c-4a8e-9d2b-5c1f0e8a4d37","site_id":"c41d9f7e-08a2-4b6d-b3e5-2a9f6c0d1e84","site_index":0}}
Delivery headers
HeaderMeaning
X-Event-IdEvent identifier; the same for every attempt — use it to drop duplicates
X-Delivery-IdIdentifier of the delivery of this event to this subscription
X-TopicEvent name
X-AttemptAttempt number, from 1
X-TimestampWhen the attempt was sent, Unix seconds
X-SignatureSignature: v1= followed by a hexadecimal string
Delivery body
FieldMeaning
event_idSame as X-Event-Id
topicEvent name
occurred_atWhen the event happened; the same in every attempt
dataEvent fields, see the events table
Events
Eventdata fieldsMeaning
site.readygeneration_idsite_idsite_indexA site is ready and its archive can be downloaded
site.failedgeneration_idsite_iderror_codeA site failed. error_code is a machine code of the reason; the set of codes is open
generation.succeededgeneration_idready_countfailed_countThe order has finished with at least one site ready
generation.failedgeneration_idready_countfailed_counterror_codeThe order has finished with no ready sites; credits are returned. error_code isn’t always present
generation.cancelledgeneration_idready_countfailed_countThe order was cancelled

Verifying the signature

  1. Take the request body as raw bytes, exactly as received — before parsing the JSON.
  2. Build a string: the X-Timestamp value, a dot, the body.
  3. Compute HMAC-SHA256 of that string. The key is the subscription secret as a string, exactly as it was issued.
  4. Write the result as a hexadecimal string and compare it with the part of X-Signature after v1= — using a constant-time comparison.
  5. Reject deliveries whose X-Timestamp differs from the current time by more than 5 minutes.
import { createHmac, timingSafeEqual } from 'node:crypto';

export function isValidSignature(rawBody, headers, secret, toleranceSeconds = 300) {
  const timestamp = String(headers['x-timestamp'] ?? '');
  const expected = createHmac('sha256', secret).update(timestamp + '.').update(rawBody).digest();
  const isFresh = Math.abs(Date.now() / 1000 - Number(timestamp)) <= toleranceSeconds;
  const isMatching = String(headers['x-signature'] ?? '')
    .split(',')
    .map((part) => part.trim())
    .filter((part) => part.startsWith('v1='))
    .map((part) => Buffer.from(part.slice(3), 'hex'))
    .some((received) => received.length === expected.length && timingSafeEqual(received, expected));
  return isFresh && isMatching;
}
import hashlib
import hmac
import time


def is_valid_signature(raw_body: bytes, headers, secret: str, tolerance_seconds: int = 300) -> bool:
    timestamp = headers.get("X-Timestamp", "")
    signed_payload = timestamp.encode() + b"." + raw_body
    expected = hmac.new(secret.encode(), signed_payload, hashlib.sha256).hexdigest()
    is_fresh = timestamp.isdigit() and abs(time.time() - int(timestamp)) <= tolerance_seconds
    received = [part.strip()[3:] for part in headers.get("X-Signature", "").split(",") if part.strip().startswith("v1=")]
    return is_fresh and any(hmac.compare_digest(candidate, expected) for candidate in received)

The body is the same in every attempt. X-Timestamp is the time of the attempt and is part of the signature, so every attempt has its own signature: verify it against the headers of the same delivery.

Retries and ordering

  • A failure is a non-2xx response, a timeout or a connection error. Redirects are not followed: a 3xx response is a failure too.
  • Retries come after 1 minute, 5 minutes, 30 minutes, 2 hours, 5 hours, 10 hours and 24 hours: up to 8 attempts in total.
  • A 410 response deactivates the subscription immediately.
  • Delivery is at-least-once and ordering isn’t guaranteed. Treat an event as a reason to re-read the order through the API, not as the only source of state.
  • An account gets up to 2,000 deliveries a day (UTC), retries included. Beyond the limit, deliveries are not sent until the end of the day and are not sent later.

URL requirements

  • https only and the standard port 443 only.
  • A host name, not an IP address.
  • No username or password in the URL.
  • Internal network addresses and the service’s own addresses are rejected.

Limits and retention#

LimitValue
Sites per order100
Pages per site in an order20
Blocks per page30
Request body size, KB; larger gets 413100
Requests per second from one address10
Allowed burst above that, requests40
Long poll, seconds per request60
Orders of an account in progress at once2
Sites of an order in progress at once20
Waiting to start before the order is closed with a return, hours72
Download link lifetime, minutes60
Site archive retention from readiness, days30
Idempotency key retention, hours, at least24
Saved settings per account10
Active keys per account20
Credits per invoice10000
Unpaid invoices per hour per account5
Language or country requests per hour per account3
Subscriptions per account, including deactivated50
Subscriptions per event10
Delivery attempts per event8
Waiting for the receiver’s response, seconds10
Deliveries per day per account2000

Length limits for the order’s strings and lists are in the field table of order creation. After the retention period the archive is deleted, while the order’s artifact_available_until stays in the response.

Integration questions#

How do I learn that an order is done without my own server for webhooks?
With long polling: GET /generations/<id>?wait=60. The request returns when the status changes or after a minute; repeat it until a final status.
The order is succeeded but has fewer sites than ordered. Is that an error?
No. succeeded means at least one site is ready. failed_count tells how many failed; their credits are back on the balance. Order the missing sites with a new order.
The request to create an order was cut off. Was the order created?
Within 24 hours, repeat the request with the same Idempotency-Key and the same body. If the order was created, you get it back; if not, it is created now. There will be no second order and no second charge.
What do I do with capacity_exhausted?
Lower count to details.max_count, or raise section_reuse_limit to details.required_section_reuse_limit, or set style: random — then the service picks a style with enough capacity. You can also split the volume into several orders.
How is target: php different from form_endpoint: php?
target is the technology of the whole site: pages as .php files. form_endpoint: php is only the form handler as a PHP file in the archive; it is included with any technology.
The archive link stopped working.
A signed link is valid for an hour. Request the site list or the order archive again — the link will be new. 30 days after a site became ready its archive is deleted and artifact_url becomes null.
Catalog titles come in one language. How do I show them to a user?
The catalog isn’t translated. Keep your own names for the role, style, country_code keys and the vertical key, and show an unknown key as is.
An event arrived twice or out of order.
That is by design: delivery is at-least-once. Drop duplicates by X-Event-Id, and after any event read the order state through the API.
How do I rotate a key without downtime?
Create a second key in the dashboard, switch the integration to it and revoke the first. Reissuing doesn’t fit: the old value stops working at once.