Skip to main content

Pages API

Create, read, update, and delete pages.

List Pages

GET /v1/pages

Returns a list of pages in a space.

Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
spaceIdstringYesSpace ID
parentIdstringNoFilter by parent page
limitnumberNoItems per page (default: 20)
pagenumberNoPage number

Example Request

curl "http://localhost:3000/api/pages?workspaceId=ws_123&spaceId=space_456" \
-H "Authorization: Bearer $API_KEY"

Example Response

{
"data": [
{
"id": "page_abc123",
"title": "Getting Started",
"slug": "getting-started",
"icon": "rocket",
"parentId": null,
"spaceId": "space_456",
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-20T14:30:00Z",
"createdBy": "user_789"
}
],
"meta": {
"page": 1,
"limit": 20,
"total": 45
}
}

Get Page

GET /v1/pages/:pageId

Returns a single page with its content.

Parameters

ParameterTypeRequiredDescription
pageIdstringYesPage ID

Example Request

curl "http://localhost:3000/api/pages/page_abc123" \
-H "Authorization: Bearer $API_KEY"

Example Response

{
"data": {
"id": "page_abc123",
"title": "Getting Started",
"slug": "getting-started",
"icon": "rocket",
"content": {
"type": "doc",
"content": [
{
"type": "heading",
"attrs": { "level": 1 },
"content": [{ "type": "text", "text": "Getting Started" }]
},
{
"type": "paragraph",
"content": [{ "type": "text", "text": "Welcome to our documentation." }]
}
]
},
"parentId": null,
"spaceId": "space_456",
"workspaceId": "ws_123",
"createdAt": "2025-01-15T10:00:00Z",
"updatedAt": "2025-01-20T14:30:00Z",
"createdBy": "user_789"
}
}

Create Page

POST /v1/pages

Creates a new page.

Body Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
spaceIdstringYesSpace ID
titlestringYesPage title
contentobjectYesPage content (ProseMirror format)
parentIdstringNoParent page ID
iconstringNoEmoji or icon

Example Request

curl -X POST "http://localhost:3000/api/pages" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspaceId": "ws_123",
"spaceId": "space_456",
"title": "New Feature Spec",
"content": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [{ "type": "text", "text": "Overview of the new feature." }]
}
]
},
"icon": "sparkles"
}'

Example Response

{
"data": {
"id": "page_xyz789",
"title": "New Feature Spec",
"slug": "new-feature-spec",
"icon": "sparkles",
"parentId": null,
"spaceId": "space_456",
"workspaceId": "ws_123",
"createdAt": "2025-01-22T09:00:00Z",
"updatedAt": "2025-01-22T09:00:00Z",
"createdBy": "user_789"
}
}

Update Page

PUT /v1/pages/:pageId

Updates an existing page.

Body Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace ID
titlestringNoNew title
contentobjectNoNew content
parentIdstringNoNew parent page
iconstringNoNew icon

Example Request

curl -X PUT "http://localhost:3000/api/pages/page_xyz789" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspaceId": "ws_123",
"title": "Updated Feature Spec",
"content": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [{ "type": "text", "text": "Updated content." }]
}
]
}
}'

Delete Page

DELETE /v1/pages/:pageId

Deletes a page.

Parameters

ParameterTypeRequiredDescription
pageIdstringYesPage ID
workspaceIdqueryYesWorkspace ID

Example Request

curl -X DELETE "http://localhost:3000/api/pages/page_xyz789?workspaceId=ws_123" \
-H "Authorization: Bearer $API_KEY"

Get Page History

GET /v1/pages/:pageId/history

Returns the revision history for a page.

Example Response

{
"data": [
{
"id": "hist_001",
"pageId": "page_abc123",
"version": 5,
"createdAt": "2025-01-20T14:30:00Z",
"createdBy": "user_789",
"summary": "Updated introduction"
},
{
"id": "hist_002",
"pageId": "page_abc123",
"version": 4,
"createdAt": "2025-01-18T11:00:00Z",
"createdBy": "user_456",
"summary": "Added code examples"
}
]
}

Restore Page Version

POST /v1/pages/:pageId/restore

Restores a page to a previous version.

Body Parameters

ParameterTypeRequiredDescription
historyIdstringYesHistory version ID

Example Request

curl -X POST "http://localhost:3000/api/pages/page_abc123/restore" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{ "historyId": "hist_002" }'