Skip to main content

Workspace API

Workspace API

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

Quick Reference​

MethodDescription
changeChanges the active workspace to the specified one.
getByIdRetrieves a specific workspace by its unique identifier.
listLists all available workspaces for the current user.
listProjectsLists all projects in the current workspace.
selectSelects a workspace as the active context.

Methods​


change​

client.workspace.change(workspaceId: string): Promise<void>

Changes the active workspace to the specified one.

Updates the active workspace context directly without requiring a separate selection object. This is a simplified version of the select operation for quick workspace switching.

ParameterTypeRequiredDescription
workspaceIdstringYesThe unique identifier of the workspace to activate

Returns: Promise<void> — A promise that resolves when the workspace has been changed

Full reference →


getById​

client.workspace.getById(workspaceId: string): Promise<Workspace>

Retrieves a specific workspace by its unique identifier.

Returns detailed information about a single workspace including its settings, members, projects, and configuration metadata.

ParameterTypeRequiredDescription
workspaceIdstringYesThe unique identifier of the workspace to retrieve

Returns: Promise<Workspace> — A promise that resolves to the requested Workspace object

Full reference →


list​

client.workspace.list(): Promise<Workspace[]>

Lists all available workspaces for the current user.

Returns every workspace the user has access to, including their personal workspaces and any shared workspaces. Useful for workspace browsing and selection UIs.

No parameters.

Returns: Promise<Workspace[]> — A promise that resolves to an array of Workspace objects

Full reference →


listProjects​

client.workspace.listProjects(): Promise<WorkspaceProject[]>

Lists all projects in the current workspace.

Returns an array of workspace projects with their metadata and status. Use this to display available projects or navigate between them.

No parameters.

Returns: Promise<WorkspaceProject[]> — A promise that resolves to an array of WorkspaceProject objects

Full reference →


select​

client.workspace.select(data: SelectWorkspaceRequest): Promise<void>

Selects a workspace as the active context.

Switches the active workspace to the specified one, updating all subsequent API calls to operate within that workspace context. This affects project selection, file access, and other operations.

ParameterTypeRequiredDescription
dataSelectWorkspaceRequestYesRequest containing workspace selection details

Returns: Promise<void> — A promise that resolves when the workspace has been selected

Full reference →