Documents API
Space-scoped document wiki endpoints are available under
/api/v1.0/spaces/{slug}/documents. They manage document trees, drafts,
reviews, revisions, comments, attachments, diagrams, embedded polls, and search
indexing.
All endpoints require authentication and access to the target space.
Page Tree
| Method | Endpoint | Description |
|---|---|---|
GET | /spaces/{slug}/documents/tree | List the document page tree. |
POST | /spaces/{slug}/documents/pages | Create a page draft. |
GET | /spaces/{slug}/documents/pages/{page_id} | Fetch one page. |
PATCH | /spaces/{slug}/documents/pages/{page_id}/tree | Update title, parent, position, or owners. |
DELETE | /spaces/{slug}/documents/pages/{page_id} | Delete a page and remove it from search. |
Create Page
curl -X POST "https://api.qarion.com/api/v1.0/spaces/finance/documents/pages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Monthly Close Runbook",
"content_markdown": "# Monthly Close\n\nSteps for the finance pipeline.",
"parent_id": null,
"owner_ids": []
}'
Draft Review
| Method | Endpoint | Description |
|---|---|---|
PUT | /spaces/{slug}/documents/pages/{page_id}/draft | Update draft content and metadata. |
POST | /spaces/{slug}/documents/pages/{page_id}/submit | Submit a draft for review with a change summary. |
POST | /spaces/{slug}/documents/pages/{page_id}/publish | Publish the submitted draft. |
POST | /spaces/{slug}/documents/pages/{page_id}/reject | Reject the submitted draft with reviewer notes. |
GET | /spaces/{slug}/documents/pages/{page_id}/revisions | List published revisions. |
Publishing queues a background document-page reindex. Updating tree metadata for a published page also queues reindexing. Deleting a page queues removal from the document search index.
Attachments and Diagrams
| Method | Endpoint | Description |
|---|---|---|
GET | /spaces/{slug}/documents/pages/{page_id}/attachments | List page attachments. |
POST | /spaces/{slug}/documents/pages/{page_id}/attachments | Upload a file attachment. |
GET | /spaces/{slug}/documents/pages/{page_id}/attachments/{attachment_id}/download | Download an attachment. |
DELETE | /spaces/{slug}/documents/pages/{page_id}/attachments/{attachment_id} | Delete an attachment. |
POST | /spaces/{slug}/documents/pages/{page_id}/diagrams | Create a draw.io diagram attachment. |
PUT | /spaces/{slug}/documents/pages/{page_id}/diagrams/{attachment_id} | Update a draw.io diagram attachment. |
File uploads are multipart form uploads using the file field. The API enforces
the same attachment type and size limits as the rest of the platform.
Upload Attachment
curl -X POST "https://api.qarion.com/api/v1.0/spaces/finance/documents/pages/{page_id}/attachments" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@evidence.pdf"
Create Diagram
curl -X POST "https://api.qarion.com/api/v1.0/spaces/finance/documents/pages/{page_id}/diagrams" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_name": "monthly-close.drawio",
"xml": "<mxfile>...</mxfile>"
}'
Comments and Mentions
| Method | Endpoint | Description |
|---|---|---|
GET | /spaces/{slug}/documents/mention-suggestions?q={query} | Suggest users for mentions. |
GET | /spaces/{slug}/documents/pages/{page_id}/comments | List page comments. |
POST | /spaces/{slug}/documents/pages/{page_id}/comments | Create a page comment. |
PUT | /spaces/{slug}/documents/pages/{page_id}/comments/{comment_id} | Update a comment. |
DELETE | /spaces/{slug}/documents/pages/{page_id}/comments/{comment_id} | Delete a comment. |
List endpoints return pagination headers when pagination applies.
Polls
| Method | Endpoint | Description |
|---|---|---|
POST | /spaces/{slug}/documents/pages/{page_id}/polls | Create a poll and return its embeddable ID. |
GET | /spaces/{slug}/documents/pages/{page_id}/polls/{poll_id} | Fetch poll options, current user vote, results visibility, and permissions. |
GET | /spaces/{slug}/documents/pages/{page_id}/polls/{poll_id}/voters | Return option-level voter breakdowns for poll editors. |
PATCH | /spaces/{slug}/documents/pages/{page_id}/polls/{poll_id} | Update poll metadata, options before voting, limits, and poll access grants. |
POST | /spaces/{slug}/documents/pages/{page_id}/polls/{poll_id}/vote | Submit or update the current user's vote. |
POST | /spaces/{slug}/documents/pages/{page_id}/polls/{poll_id}/close | Close an open poll manually. |
Polls support single_choice and multi_choice types. Access can inherit from
the page or use direct user/team grants with view, vote, or edit levels.
Embed a poll in page Markdown with:
```poll
id: POLL_ID
```
Create Poll
curl -X POST "https://api.qarion.com/api/v1.0/spaces/finance/documents/pages/{page_id}/polls" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Adopt the new incident review template?",
"description": "Vote before the next governance meeting.",
"poll_type": "single_choice",
"options": [{"label": "Yes"}, {"label": "No"}],
"inherit_page_access": true
}'
Error Notes
| Status | Meaning |
|---|---|
403 | The user cannot review, edit, or delete the requested resource. |
404 | The page, attachment, revision, or comment was not found in the space. |
413 | Uploaded file exceeds the configured size limit. |
422 | Uploaded file type is not allowed or request validation failed. |
Related
- Search API — Document pages are indexed after publication
- Attachments API — Shared attachment response shape
- Comments API — Shared comment model
- Architecture Standards API — Documents-backed standards, exceptions, and artifacts