Developers
Page4 API
The Page4 API turns Markdown, CSV, JSON, or PageSpec inputs into safe, shareable pages — versioned, takedown-ready, and ready for agents.
What the Page4 API does
Page4 ships a REST API for human and agent clients. Authenticate with a workspace-scoped Bearer API key (or a signed-in dashboard session), send Markdown / CSV / JSON / PageSpec, and we render safe HTML to a managed page4.you/<slug> link. The same API powers our MCP server and OAuth-granted agents.
Base URL: https://app.page4.you · Versioned at /v1/* · All endpoints return JSON unless an HTML form Accepts text/html.
1. Authenticate
Create an API key from Developers → API keys. Send it as a Bearer token. Include an Idempotency-Key header on any mutating call so retries do not double-publish.
Authorization: Bearer pk_live_...
Idempotency-Key: 2026-05-25T17:30Z-launch-notes2. List pages
Returns the workspace’s pages — drafts, published, and review_required — in one paginated call. Useful for sync flows and reconciliation.
curl https://app.page4.you/v1/pages \
-H "Authorization: Bearer pk_live_..." \
-H "Accept: application/json"3. Create and publish in one call
Pass publish: true and we run safety scanning, render the page, and return its public URL in the same response. Without the flag, the page lands as a draft for review.
curl https://app.page4.you/v1/pages \
-H "Authorization: Bearer pk_live_..." \
-H "Idempotency-Key: launch-notes-1" \
-d '{"markdown":"# Launch notes","publish":true,"visibility":"unlisted"}'4. Validate before publishing
Dry-run validates any source through the same PageSpec, scanning, and renderer pipeline — without saving anything. Use this to fail fast in agent loops.
curl https://app.page4.you/v1/pagespec/validate \
-H "Authorization: Bearer pk_live_..." \
-d '{"markdown":"# Draft preview"}'5. Webhooks for downstream automation
Subscribe to page.published and other events from Developers → Webhooks. Page4 signs every delivery with the secret you receive on creation.
curl https://app.page4.you/v1/webhooks \
-H "Authorization: Bearer pk_live_..." \
-d '{"name":"prod","url":"https://example.com/page4","events":["page.published"]}'Full OpenAPI spec
For machine readers — code generation, schema validators, IDE tooling — fetch the canonical OpenAPI 3.1 document. The link below is stable and what client generators should reference.