Collaborative Document Editing

The workflow for bootstrapping collaboration, joining the hub, editing text, and publishing revisions.

Use the same editing workflow for organization, cluster, location and Project documents. Plain text and GAEB .x86 files support live text operations. Office files support bootstrap metadata and presence; PDF and Office content editing are not part of this text editor.

Open and edit

  1. Load the document from its library. For a Project, use /v1/document-libraries/project/{projectId}/documents.
  2. Call POST /v1/documents/{documentId}/collaboration/bootstrap. Keep the returned collaborativeDocumentId; check canEdit and supportsTextEditing.
  3. Connect to /hubs/document-collaboration with the current credential and call JoinDocument(collaborativeDocumentId).
  4. Load GetTextState, then submit incremental edits through SubmitTextOperations with the observed revision number. Apply TextOperationsApplied broadcasts and reload state when the response requires resynchronization.
  5. Use UpdatePresence for cursor/selection activity. Handle TextStateUpdated and PresenceUpdated alongside operation broadcasts.

Read-only users can join and read existing text state. An editor must initialize the first snapshot, and every mutation requires current write access at the document's folder path.

Publish and reopen

Call PublishDocument while joined, or POST /v1/documents/collaboration/{collaborativeDocumentId}/publish, to create a downloadable file version. Handle DocumentPublished by refreshing the library and current file metadata while retaining the collaboration ID. Call LeaveDocument when leaving the editor.

Publishing a Project document preserves its spatialProjectId, filename, folder path and version lineage. It stays in that Project's library. Bootstrapping from the original or a previously published version returns the same logical collaboration. Checkpoints, revision history, restore and publish history use the existing collaboration endpoints.

Access changes and deletion

Project access inherits the parent location's document permissions at the Project-relative path. Project deletion makes its collaboration unavailable and schedules stored snapshots for cleanup. On SubscriptionRevoked, stop editing and discard inaccessible state. A lost write permission blocks edits even while read access remains.

Publishing does not happen automatically on leaving the session. Publish before leaving when a new downloadable file version is required.

On this page