Skip to content
LogoLogo

Admit an independent Document collaboration-presence lease

Admit an independent Document collaboration-presence lease

POST/api/v1/documents/{document_id}/collaboration-sessions

Evaluates the caller's current Document permission and creates an independent session for this browser client. A caller with read-only access receives role viewer; a caller who may edit receives editor. The opaque admission_token lasts five minutes, is scoped to this Document, actor, and session, and authorizes nothing on this HTTP API. Each admission has its own token and exclusive connection lease, so another tab cannot invalidate it. The connected relay renews the lease; disconnected sessions expire through bounded cleanup.

The lease admits the browser-only durable Yjs relay. Raw updates, checkpoints and awareness are not REST or SDK payloads. Resource schema capability is checked at admission and again for each update/checkpoint.

X-Assign-Document-Schema defaults to 1. An editable schema 2 admission promotes only this resource's envelope through its normal revision transition, preserving opaque updates, checkpoints and replica generation. Existing schema 1 resources continue to accept schema 1 clients. Once promoted, schema 1 admission and already admitted schema 1 writes fail with document_schema_version_unsupported. Invalid header values fail with document_schema_version_unsupported. Project permissions remain authoritative.

Path Parameters

document_idRequired
string <uuid>
Example0198ac5e-f9b7-7000-8000-000000000001

Header Parameters

X-CSRF-TokenRequired
string·min 43·max 43

Session-bound CSRF token. It must exactly match the __Host-assign_csrf cookie sent with the request.

X-Assign-Document-Schema
integer·default 1

Highest writable document schema supported by this client. Missing means schema 1. Editable schema 2 admission atomically promotes the resource envelope without resetting its collaboration state. Older admissions are refused after promotion.

Values
12

Responses