Manage Workspaces in Wacht
fetchWorkspaces(options?: ListWorkspacesOptions)
options
(optional): An object containing pagination and filtering options.
page
(number): The page number to retrieve.per_page
(number): The number of items per page.search
(string): Search term for workspaces.organization_id
(string): Filter by organization ID.Promise<WorkspaceListResponse>
: A promise that resolves to a list of workspaces and pagination information.
fetchWorkspace(workspaceId: string)
workspaceId
(string): The unique identifier of the workspace.Promise<Workspace>
: A promise that resolves to the workspace object.
updateWorkspace(workspaceId: string, request: UpdateWorkspaceRequest)
workspaceId
(string): The unique identifier of the workspace to update.request
(UpdateWorkspaceRequest): The request body containing the updated details of the workspace.Promise<Workspace>
: A promise that resolves to the updated workspace object.
deleteWorkspace(workspaceId: string)
workspaceId
(string): The unique identifier of the workspace to delete.Promise<void>
: A promise that resolves when the workspace is successfully deleted.
createWorkspaceInOrganization(organizationId: string, request: CreateWorkspaceRequest)
organizationId
(string): The unique identifier of the organization.request
(CreateWorkspaceRequest): The request body containing the details of the new workspace.Promise<Workspace>
: A promise that resolves to the newly created workspace object.
fetchWorkspaceRoles()
Promise<WorkspaceRoleListResponse>
: A promise that resolves to a list of workspace roles.
createWorkspaceRole(workspaceId: string, request: CreateRoleRequest)
workspaceId
(string): The unique identifier of the workspace.request
(CreateRoleRequest): The request body containing the details of the new role.Promise<WorkspaceRole>
: A promise that resolves to the newly created workspace role object.
updateWorkspaceRole(workspaceId: string, roleId: string, request: UpdateRoleRequest)
workspaceId
(string): The unique identifier of the workspace.roleId
(string): The unique identifier of the role to update.request
(UpdateRoleRequest): The request body containing the updated details of the role.Promise<WorkspaceRole>
: A promise that resolves to the updated workspace role object.
deleteWorkspaceRole(workspaceId: string, roleId: string)
workspaceId
(string): The unique identifier of the workspace.roleId
(string): The unique identifier of the role to delete.Promise<void>
: A promise that resolves when the role is successfully deleted.