Share a page
View as MarkdownPOST
/v1/documents/{documentId}/grantsGives a user, a teamspace's members or everyone in the workspace (principalType workspace, principalId = workspace id) a level on the page and its subpages. Needs full access.
curl -X POST "https://api.lydie.co/v1/documents/01JCQ3V5MZ8G4ZK2X7T9R6N1PB/grants" \
-H "Authorization: Bearer $LYDIE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"principalType": "user",
"principalId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
"level": "view"
}'Path parameters
Body
One of
userteamspaceworkspaceOne of
viewcommenteditfull
Response
- documentIdstring
- principalTypestring
One of
userteamspaceworkspace - principalIdstring
- levelstring
One of
viewcommenteditfull - createdAttimestamp
{
"id": "string",
"documentId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
"principalType": "user",
"principalId": "01JCQ3V5MZ8G4ZK2X7T9R6N1PB",
"level": "view",
"createdBy": null,
"createdAt": "2026-11-12T09:30:00.000Z"
}Errors use one envelope for every endpoint. See Errors and versions.