workspaces

Ensure Workspace

Create or update a workspace and link it to a machine.

This endpoint:

  1. Finds or creates a workspace (by machine+path)
  2. Creates/updates the machine-workspace link with the local path
  3. Ensures a main worktree exists with the machine reference
post/api/v1/workspaces/ensure

Request

  • Base URL
    https://docs.omnara.com (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Request body

WorkspaceEnsureRequest required

Payload for creating or updating a workspace from the daemon.

machine_id, string required

Identifier of the daemon machine

local_path, string required

Absolute path reported by the daemon

git_host, string nullable

Canonical git host if detected (e.g., github.com)

git_path, string nullable

Canonical git path if detected (e.g., org/repo)

workspace_metadata, object nullable

Optional workspace metadata (labels, annotations, etc.)

git_settings, GitSettings nullable

Git-related settings for a workspace.

Response

Successful Response

WorkspaceDescriptor required

Serialized workspace row returned to API clients.

id, string required

Unique workspace identifier

user_id, string required

Owner user identifier

git_host, string nullable

Canonical git host (e.g., github.com)

git_path, string nullable

Canonical git repository path (e.g., org/repo)

workspace_metadata, object nullable

Arbitrary workspace metadata (labels, annotations)

workspace_config, WorkspaceConfigOutput

Workspace configuration including git, sync, and remote environment settings

user_machine_paths, SharedSchemasApiWorkspacesUserMachinePathDescriptor[]

Machines linked to this workspace with their local paths

created_at, string date-time required

Timestamp when the workspace was created

updated_at, string date-time required

Timestamp when the workspace was last updated

Changes

No recorded changes to this operation across all 1 revision of this API.