Skip to main content
Coming soon — experimental API 0.3. The original document and part services remain available. See availability and scope. The current document is the open costume. It contains workspaces and live parts. The API does not expose a document manager, workspace creation, or a command to switch the active workspace in 0.2.

ReadDocument

Requires ReadDocument. Returns a copied snapshot of the current costume, including workspace mesh instances and attached part roots associated with a workspace. Parts are instances, not shared geometry assets. The snapshot is not restricted to the active workspace. Avatar body geometry, environment objects, and grouping nodes are not general-purpose parts in this API. Do not treat the snapshot as a complete scene graph. WorkspaceInfo contains WorkspaceHandle handle, std::string name, and bool locked. Join a part to its workspace by handle. Do not assume vector positions are permanent or that names are unique. The avatar and context use the same observation revision as this document snapshot. See avatars and measurements and tools and context for their fields and edit rules. Body geometry remains excluded from the general-purpose part list.

ReadPart

Requires ReadDocument. Refreshes document state, validates both identities, and returns the current part metadata. A missing or retired part returns InvalidHandle; an expired document returns DocumentClosed. visible and frozen do not compute inherited state from ancestors. Eligibility flags combine the host’s target checks with the session’s permission. A blank filter_reason does not imply a filter permission was granted.

RenamePart

Requires ReadDocument and RenameParts. RenamePartRequest contains DocumentHandle document, PartHandle part, Revision expected_revision, and std::string name. The new name must be valid UTF-8, between 1 and 1,024 bytes, contain no control characters, and contain more than ASCII spaces. Supply the nonzero revision on which you based the rename. The host checks workspace locks, frozen state, name editability, selection locks, and document protection. Use can_rename to decide which parts to offer. The current adapter does not support renaming every standalone workspace mesh; a display name alone does not establish a persisted name property. A successful rename uses the application’s command history and updates document state. An eligible part already bearing the requested name returns success with changed = false, without creating a rename history entry.

C++ example

This function uses a session supplied by the application host. It renames the first eligible part; a user-facing integration should let you choose the target.
Check the returned result and its refresh_error. Follow the command completion rules before deciding whether to refresh or retry.