Author a page end-to-end
This is the whole lifecycle an integrator needs — create a page, set its content, publish it, and read it back — with real requests you can copy. Every call uses Authorization: Bearer <token> and the base URL https://forumulate.com/api.
You need three ids, each one call away: your org (GET /orgs), a space in it (GET /orgs/{orgId}/spaces), and a collection in that space (GET /orgs/{orgId}/spaces/{spaceId}/collections).
1. Create the page
A page can arrive as Markdown (body) or as a block document (content, TipTap/ProseMirror JSON) — use exactly one. Markdown is the shortest path:
curl -X POST \
https://forumulate.com/api/orgs/{orgId}/spaces/{spaceId}/collections/{collectionId}/pages \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{
"title": "Hello from the API",
"slug": "hello-api",
"body": "# Hello\n\nCreated **via the API**.\n\n- one\n- two\n"
}'Response:
{ "page": { "id": "533a69e6-…", "slug": "hello-api", "title": "Hello from the API" } }Keep that page.id — the rest of the lifecycle addresses the page directly, not through its collection.
2. Set or replace the content
PUT …/pages/{id}/content replaces the body wholesale. It accepts the same two shapes as create — Markdown body or block-doc content:
curl -X PUT \
https://forumulate.com/api/orgs/{orgId}/spaces/{spaceId}/pages/{pageId}/content \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{
"title": "Hello from the API",
"body": "# Hello, again\n\nUpdated **via PUT content**.\n\n1. first\n2. second\n"
}'3. Publish
Publishing makes the current draft the live revision. No request body:
curl -X POST \
https://forumulate.com/api/orgs/{orgId}/spaces/{spaceId}/pages/{pageId}/publish \
-H "Authorization: Bearer $TOKEN"4. Read it back
GET …/pages/{id}/markdown returns the rendered Markdown — the round-trip of what you sent:
curl https://forumulate.com/api/orgs/{orgId}/spaces/{spaceId}/pages/{pageId}/markdown \
-H "Authorization: Bearer $TOKEN"# Hello, again
Updated **via PUT content**.
1. first
2. secondThree reads are available, each for a different need:
Call | Returns |
|---|---|
| the page and its metadata (title, slug, cover, audience…) |
| the content as Markdown |
| the published block document |
Scopes
Reads need a token with read; create / PUT content / publish need write. Each endpoint states its required scope in the reference.