API connection
Create an API token, authenticate requests, and use the schema and blueprint endpoints.
Create an API token
Open API Tokens from the header, create a token for the selected organization, and copy the token when it is shown. The raw token is only displayed once. Store it in the connected app's secret manager or environment variables.
- Tokens are scoped to the selected organization.
- Use one token per external system so a compromised token can be revoked without disrupting every integration.
- Revoked tokens stop authenticating immediately.
Authenticate requests
Send the token as a bearer token on every API request. X-Api-Token is also supported for compatibility, but Authorization bearer tokens are preferred.
curl https://staticpageapi.com/api/v1/schema \
-H "Authorization: Bearer YOUR_API_TOKEN"
Read the schema first
GET /api/v1/schema returns the fields and enum values that API clients should use when generating pages, sections, and rows. Fetch it before generating JSON so the client stays aligned with the current app.
curl https://staticpageapi.com/api/v1/schema \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
Create a page blueprint
POST /api/v1/page_blueprints creates one or more pages, their sections, and any nested rows in one transaction. Send one page with fields at the top level, or send multiple page blueprints as a top-level array or a pages array. The token decides the organization, so do not send organization_id.
curl https://staticpageapi.com/api/v1/page_blueprints \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "spring-campaign",
"meta_title": "Spring Campaign",
"meta_description": "A campaign page created through the API.",
"status": "draft",
"sections": [
{
"type_of": "hero",
"status": "active",
"order": 1,
"header": "Launch your spring campaign",
"header_type": "h1",
"body": "<p>Build a page from structured content blocks.</p>",
"actions": [
{ "label": "Get started", "url": "/contact", "style": "primary", "position": 1 }
]
}
]
}'
Trial and billing restrictions
Organizations can use a seven-day trial before subscribing. During the trial, API clients can read schema/templates and create/edit content, with page creation limited and exports unlimited.
- A trial lasts seven days from organization creation.
- Trial organizations can create up to three pages.
- Trial organizations can export as many times as needed.
- Active paid subscriptions remove the trial page limit.
- GET and HEAD API requests remain available so an AI can inspect schema, templates, and existing content before deciding what to do.
- Write API requests require either an active trial or an active subscription.
- If POST /api/v1/page_blueprints returns HTTP 402 with Trial page limit reached, do not retry with a different payload. Ask the user to subscribe, delete/repurpose an existing page, or edit an existing draft instead.
- Before creating a new page on a trial account, prefer checking existing pages and reusing a draft when the user is experimenting.
Edit existing content
After a blueprint exists, use the incremental endpoints to list, create, update, reorder, or delete sections and rows.
- GET /api/v1/templates
- GET /api/v1/template_library
- POST /api/v1/template_library/:id/copy
- POST /api/v1/templates
- GET, PATCH, and DELETE /api/v1/templates/:id
- GET /api/v1/pages/:page_id/sections
- POST /api/v1/pages/:page_id/sections
- PATCH /api/v1/pages/:page_id/sections/reorder
- GET /api/v1/sections/:section_id
- PATCH /api/v1/sections/:section_id
- DELETE /api/v1/sections/:section_id
- GET /api/v1/sections/:section_id/rows
- POST /api/v1/sections/:section_id/rows
- PATCH /api/v1/sections/:section_id/rows/reorder
- GET, PATCH, and DELETE /api/v1/rows/:row_id
Create Liquid templates for custom layouts
When a Figma mockup or reference page cannot be represented cleanly with the built-in section and row renderers, create database-backed Liquid templates first. Then create sections and rows with template_id instead of type_of, and store editable template field values in template_data. If a section uses a Liquid template, its rows should use Liquid row templates too.
curl https://staticpageapi.com/api/v1/templates \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"templateable_type": "Section",
"key": "figma_feature_band",
"name": "Figma feature band",
"status": "active",
"template_html": "<section class=\"figma-feature\"><p>{{ section.data.eyebrow }}</p><h2>{{ section.header }}</h2>{% for row in rows %}{{ row.rendered_html }}{% endfor %}</section>",
"template_css": ".figma-feature { padding: 6rem 0; }",
"field_schema": {
"fields": [
{ "key": "eyebrow", "label": "Eyebrow", "type": "text", "default": "Overview" }
]
},
"default_data": {
"eyebrow": "Overview"
}
}'
Handle errors
Unauthorized requests return 401. Billing or trial restrictions return 402. Invalid blueprint payloads return 422 with an error message. Not-found records return 404 when the token's organization cannot access the requested page, section, or row.
{
"error": "Trial page limit reached"
}
© 2026 StaticPagesApi. All rights reserved.
Documentation, examples, prompts, templates, and API guidance are provided for authorized use with StaticPagesApi.