Documentation Index
Fetch the complete documentation index at: https://mintlify.com/toeverything/AFFiNE/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Document API provides operations for managing documents within AFFiNE workspaces, including creating, reading, updating, publishing, and managing document-level permissions.Queries
Get Document
Retrieve a specific document by ID within a workspace.The workspace containing the document
The document ID to retrieve
Get Public Documents
Retrieve all publicly shared documents in a workspace.Get Recently Updated Documents
Retrieve recently updated documents with pagination.Get Document Metadata
Retrieve document metadata including editor information.Get Document Analytics
Retrieve page view analytics for a document.Mutations
Publish Document
Make a document publicly accessible.The display mode for the public document. Values:
Page, EdgelessRevoke Public Document
Remove public access from a document.Grant Document User Roles
Grant specific users access to a document with a defined role.Update Document User Role
Change a user’s role on a specific document.Revoke Document User Roles
Remove a user’s access to a document.Update Document Default Role
Set the default permission level for users accessing the document.The default role cannot be set to
Owner. Valid values are Manager, Editor, Commenter, Reader, None.Type Definitions
DocType
Unique document identifier
ID of the workspace containing the document
Document title
Display mode:
Page or EdgelessWhether the document is publicly accessible
Default permission level for workspace members
Document creation timestamp
Last update timestamp
ID of the user who created the document
ID of the user who last updated the document
AI-generated document summary
DocRole Enum
Owner- Full control, can transfer ownershipManager- Can manage users and settingsEditor- Can edit document contentCommenter- Can add comments onlyReader- Read-only accessNone- No accessExternal- Limited external access
DocPermissions
Boolean flags indicating available actions:Doc_Read- Can read the documentDoc_Update- Can edit the documentDoc_Delete- Can delete the documentDoc_Trash- Can move to trashDoc_Restore- Can restore from trashDoc_Copy- Can copy the documentDoc_Duplicate- Can duplicate the documentDoc_Publish- Can publish/unpublishDoc_Users_Read- Can view shared usersDoc_Users_Manage- Can manage user permissionsDoc_TransferOwner- Can transfer ownershipDoc_Comments_Read- Can read commentsDoc_Comments_Create- Can create commentsDoc_Comments_Delete- Can delete commentsDoc_Comments_Resolve- Can resolve comments
Error Handling
- DocNotFound
- DocActionDenied
- DocUpdateBlocked