All docs

Landing Pages

REST reference for graph8 landing pages — clone from URL or homepage, edit, publish to Cloudflare Pages

The Landing Pages API exposes graph8’s clone-first page builder: clone any URL into a fully editable replica, modify text + images + design tokens via chat or direct edits, then publish to a Cloudflare Pages subdomain.

30-second start

List your landing pages:

cURL

curl 'https://be.graph8.com/api/v1/pages?status=published' \
  -H "Authorization: Bearer $G8_API_KEY"

TypeScript

import { g8 } from '@graph8/sdk';
g8.init({ apiKey: process.env.G8_API_KEY! });

const pages = await g8.pages.list({ status: 'published' });
console.log(pages);

CLI

# Use the REST API directly — no dedicated CLI command yet
curl 'https://be.graph8.com/api/v1/pages' \
  -H "Authorization: Bearer $(g8 whoami | grep -oE '[a-f0-9]{40}' | head -1)"

MCP

Ask your agent: “List my landing pages” → tool exists in MCP all mode; uses the same backend.

Quick reference

EndpointMethodPurpose
/pagesGETList landing pages
/pages/{id}GETGet a page (HTML, design tokens, image refs, version)
/pagesPOSTCreate from template / clone homepage / clone URL
/pages/{id}PATCHUpdate page (HTML diff, brand overrides)
/pages/{id}DELETEDelete
/pages/{id}/publishPOSTDeploy to Cloudflare Pages
/pages/{id}/versionsGETList version history
/pages/{id}/versions/{version_id}GETRestore / preview a previous version
/pages/{id}/chatPOSTSend a chat message that edits the page

Three ways to create

1. From a template

POST /api/v1/pages
Content-Type: application/json

{
  "template": "demo" | "lead_magnet" | "product_launch" | "event" | "free_trial",
  "title": "Q3 PLG Demo Page",
  "campaign_id": "cmp_abc123"
}

Templates ship with sensible defaults — hero, value props, social proof, CTA. Customize via PATCH or the chat surface afterwards.

2. Clone your homepage

POST /api/v1/pages
{ "clone_source": "homepage", "title": "Cloned home" }

Pulls the org’s primary website via Firecrawl, extracts design tokens (colors, fonts, components), sanitizes the HTML, injects deterministic data-g8-id element IDs, and creates a fully editable replica. The clone preserves the visual identity so further pages live in the same brand system.

3. Clone from any URL

POST /api/v1/pages
{ "clone_source": "url", "url": "https://competitor.com/pricing", "title": "Competitor pricing analog" }

Same pipeline as homepage clone, but from an arbitrary URL. Useful for matching a competitor’s flow or replicating a hero page you like.

Edit via chat

POST /api/v1/pages/{page_id}/chat
{
  "message": "Change the hero headline to 'Stop paying for stale data' and make the primary CTA pink."
}

Returns the diff applied to the page plus a new version. The chat surface is conversational — it can target specific elements (“the second testimonial”), apply brand-token changes, and add or remove sections.

Edit via PATCH

PATCH /api/v1/pages/{page_id}
{
  "html": "<...full HTML...>",
  "design_tokens": {
    "colors": { "primary": "#9C73FF", "secondary": "#00CAEB" },
    "fonts": { "heading": "Aeonik", "body": "Inter" }
  }
}

Use this for programmatic edits — e.g. propagating a brand-token change across multiple pages.

Versions

GET /api/v1/pages/{id}/versions
# { data: [{ version_id, created_at, label, chat_message? }, ...] }

GET /api/v1/pages/{id}/versions/{version_id}
# Returns the full HTML snapshot of that version (for preview / restore)

Every chat edit creates a version. Restore by PATCHing the current page with a version’s HTML.

Publish

POST /api/v1/pages/{page_id}/publish

Deploys the current version to Cloudflare Pages at https://g8-lp-{org_sha256[:8]}.pages.dev/{slug}. Returns the public URL.

The CF Pages backend uses Direct Upload — no DNS / domain config needed. For a custom domain, attach via Cloudflare dashboard manually (custom-domain mapping API is not yet exposed).

List + delete

GET /api/v1/pages?campaign_id=cmp_abc123&status=published
DELETE /api/v1/pages/{page_id}

Credit costs

OperationCredits
List / get / versionsFree
Create (template)Free
Create (clone)Free — but Firecrawl + AI extraction may take 30-90 seconds
Edit via PATCHFree
Edit via chat1 per 1,000 AI tokens (the chat is LLM-powered)
PublishFree (Cloudflare Pages is bundled)

Errors

StatusCauseFix
401Missing or invalid Authorization: Bearer headerGet a key
402Out of credits (waterfall enrichment, AI generation, voice minutes)Top up in Settings → Billing, or switch to Platform
404Resource ID doesn’t existList first to verify the ID
422Validation error in request bodyInspect error.message + error.field in the response
429Rate limit (50 rps per org)Backoff per Retry-After header. See Rate Limits
5xxgraph8 errorRetry with exponential backoff (5s → 30s → 120s)

The full error envelope shape: { "error": { "code": "...", "message": "...", "field": "...", "request_id": "..." } }. Include the request_id in any support ticket. See Errors for the canonical reference.

See also

Build with graph8