Workspace API

Pages

Pages endpoints of the Zanfia Workspace API, with schemas and code samples.

7 min readLast updated Sep 10, 2026

Custom hosted HTML pages on your storefront domain. Requires the pages:read / pages:write scopes. All routes require a Authorization: Bearer header — see Authentication.

List pages

GET/pages

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/pages"
{  "count": 0,  "pages": [    {      "id": "string",      "slug": "string",      "title": "string",      "status": "draft",      "source": "pasted",      "publishedAt": "string",      "createdAt": "string",      "updatedAt": "string"    }  ]}
{  "error": "string",  "message": "string"}

Create a page

POST/pages

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/pages" \  -H "Content-Type: application/json" \  -d '{    "slug": "string",    "title": "string",    "html": "string"  }'
{  "pageId": "string",  "slug": "string"}
{  "error": "string",  "message": "string"}

Generate a page with AI

POST/pages/generate

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

POST /pages/generate — the same body the dashboard's page wizard sends; the acting user and workspace come from the API key. Generation is async: the response carries a run handle, the page itself lands later.

Response Body

application/json

application/json

curl -X POST "https://example.com/pages/generate" \  -H "Content-Type: application/json" \  -d '{    "intent": "lead-magnet",    "brief": "string",    "title": "string"  }'
{  "runId": "string",  "publicAccessToken": "string"}
{  "error": "string",  "message": "string"}

List page design templates

GET/page-templates

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Query Parameters

category?string

Only templates of this intent category.

Response Body

application/json

application/json

curl -X GET "https://example.com/page-templates"
{  "count": 0,  "templates": [    {      "id": "string",      "name": "string",      "category": "string",      "description": "string",      "directUse": true    }  ]}
{  "error": "string",  "message": "string"}

Page detail

GET/pages/{pageId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

pageId*string

Page id

Response Body

application/json

application/json

curl -X GET "https://example.com/pages/string"
{  "id": "string",  "slug": "string",  "title": "string",  "status": "draft",  "source": "pasted",  "publishedAt": "string",  "createdAt": "string",  "updatedAt": "string",  "html": "string",  "seo": {    "title": "string",    "description": "string",    "noindex": true  }}
{  "error": "string",  "message": "string"}

Update a page

PATCH/pages/{pageId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

pageId*string

Page id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/pages/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "pageId": "string"}
{  "error": "string",  "message": "string"}

Delete a page

DELETE/pages/{pageId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

pageId*string

Page id

Response Body

application/json

application/json

curl -X DELETE "https://example.com/pages/string"
{  "pageId": "string"}
{  "error": "string",  "message": "string"}

Publish or unpublish a page

POST/pages/{pageId}/publish

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

pageId*string

Page id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/pages/string/publish" \  -H "Content-Type: application/json" \  -d '{    "publish": true  }'
{  "pageId": "string",  "status": "draft"}
{  "error": "string",  "message": "string"}

Edit a page with AI

POST/pages/{pageId}/edit

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

pageId*string

Page id

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

POST /pages/{pageId}/edit — AI-edits the page's current HTML from an edit brief (the same contract the Creator Assistant's edit-page tool uses).

Response Body

application/json

application/json

curl -X POST "https://example.com/pages/string/edit" \  -H "Content-Type: application/json" \  -d '{    "instructions": "string"  }'
{  "pageId": "string",  "edited": true}
{  "error": "string",  "message": "string"}

List page revisions

GET/pages/{pageId}/revisions

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

pageId*string

Page id

Response Body

application/json

application/json

curl -X GET "https://example.com/pages/string/revisions"
{  "revisions": [    {      "id": "string",      "createdAt": "string",      "source": "ai-edit",      "sizeBytes": 0    }  ]}
{  "error": "string",  "message": "string"}

Restore a page revision

POST/pages/{pageId}/revisions/{revisionId}/restore

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

pageId*string

Page id

revisionId*string

Response Body

application/json

application/json

curl -X POST "https://example.com/pages/string/revisions/string/restore"
{  "pageId": "string",  "revisionId": "string",  "restored": true}
{  "error": "string",  "message": "string"}

Activate the automations generated for a page

POST/pages/{pageId}/activate-automations

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

pageId*string

Page id

Response Body

application/json

application/json

curl -X POST "https://example.com/pages/string/activate-automations"
{  "delivery": {    "automationId": "string",    "status": "activated"  },  "followUps": [    {      "kind": "day_before",      "broadcastId": "string",      "sendAt": 0,      "status": "activated"    }  ]}
{  "error": "string",  "message": "string"}

Set or clear the storefront main page

PUT/pages/main

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Set (or clear) the storefront's main page. pageId = a Published page's id to render at the storefront root; null reverts to the product storefront.

Response Body

application/json

application/json

curl -X PUT "https://example.com/pages/main" \  -H "Content-Type: application/json" \  -d '{    "pageId": "string"  }'
{  "mainPageId": "string"}
{  "error": "string",  "message": "string"}

Was this article helpful?

Related articles

Spotted something off? Tell us at support@zanfia.com.