pub struct WorkspacesApi { /* private fields */ }Expand description
Workspace management, file storage, and sharing
Implementations§
Source§impl WorkspacesApi
impl WorkspacesApi
Sourcepub async fn assign_workspace(
&self,
workspace_id: &str,
body: &AssignWorkspaceRequest,
) -> Result<Workspace>
pub async fn assign_workspace( &self, workspace_id: &str, body: &AssignWorkspaceRequest, ) -> Result<Workspace>
Assign agent/team/company to workspace
POST /api/v1/workspaces/{workspaceId}/assign
Required scopes: files:write.
Sourcepub async fn copy_workspace_file(
&self,
workspace_id: &str,
body: &CopyWorkspaceFileRequest,
) -> Result<WorkspaceFile>
pub async fn copy_workspace_file( &self, workspace_id: &str, body: &CopyWorkspaceFileRequest, ) -> Result<WorkspaceFile>
Copy a file within the workspace
POST /api/v1/workspaces/{workspaceId}/files/copy
Required scopes: files:write.
Sourcepub async fn create(&self, body: &CreateWorkspaceRequest) -> Result<Workspace>
pub async fn create(&self, body: &CreateWorkspaceRequest) -> Result<Workspace>
Create a workspace
POST /api/v1/workspaces
Required scopes: files:write.
Sourcepub async fn delete(
&self,
workspace_id: &str,
) -> Result<DeleteWorkspaceResponse>
pub async fn delete( &self, workspace_id: &str, ) -> Result<DeleteWorkspaceResponse>
Delete workspace and all files
DELETE /api/v1/workspaces/{workspaceId}
Required scopes: files:write.
Sourcepub async fn delete_workspace_file(
&self,
workspace_id: &str,
params: &DeleteWorkspaceFileParams,
) -> Result<DeleteWorkspaceFileResponse>
pub async fn delete_workspace_file( &self, workspace_id: &str, params: &DeleteWorkspaceFileParams, ) -> Result<DeleteWorkspaceFileResponse>
Delete a file
DELETE /api/v1/workspaces/{workspaceId}/files
Required scopes: files:write.
Sourcepub async fn download_workspace_file(
&self,
workspace_id: &str,
params: &DownloadWorkspaceFileParams,
) -> Result<Bytes>
pub async fn download_workspace_file( &self, workspace_id: &str, params: &DownloadWorkspaceFileParams, ) -> Result<Bytes>
Download file content
GET /api/v1/workspaces/{workspaceId}/files/content
Required scopes: files:read.
Sourcepub async fn empty_workspace_trash(
&self,
workspace_id: &str,
) -> Result<EmptyWorkspaceTrashResponse>
pub async fn empty_workspace_trash( &self, workspace_id: &str, ) -> Result<EmptyWorkspaceTrashResponse>
Permanently empty workspace trash
DELETE /api/v1/workspaces/{workspaceId}/trash
Required scopes: files:write.
Sourcepub async fn get(&self, workspace_id: &str) -> Result<Workspace>
pub async fn get(&self, workspace_id: &str) -> Result<Workspace>
Get workspace metadata
GET /api/v1/workspaces/{workspaceId}
Required scopes: files:read.
Sourcepub async fn get_workspace_file_history_content(
&self,
workspace_id: &str,
params: &GetWorkspaceFileHistoryContentParams,
) -> Result<Bytes>
pub async fn get_workspace_file_history_content( &self, workspace_id: &str, params: &GetWorkspaceFileHistoryContentParams, ) -> Result<Bytes>
Bytes of a prior version
version is a file_id from listWorkspaceFileHistory and must belong to path’s history
— any other id is 404. Served with the version’s own Content-Type, its Content-Length,
and Cache-Control: private, max-age=3600.
GET /api/v1/workspaces/{workspaceId}/files/history/content
Required scopes: files:read.
Sourcepub async fn get_workspace_terminal(&self, workspace_id: &str) -> Result<Value>
pub async fn get_workspace_terminal(&self, workspace_id: &str) -> Result<Value>
WebSocket terminal session for workspace
GET /api/v1/workspaces/{workspaceId}/terminal
Required scopes: files:read.
Sourcepub async fn list(&self) -> Result<ListWorkspacesResponse>
pub async fn list(&self) -> Result<ListWorkspacesResponse>
List all workspaces
GET /api/v1/workspaces
Required scopes: files:read.
Sourcepub async fn list_agent_workspace_files(
&self,
agent_id: &str,
params: &ListAgentWorkspaceFilesParams,
) -> Result<ListAgentWorkspaceFilesResponse>
pub async fn list_agent_workspace_files( &self, agent_id: &str, params: &ListAgentWorkspaceFilesParams, ) -> Result<ListAgentWorkspaceFilesResponse>
List agent workspace files (shortcut)
GET /api/v1/agents/{agentId}/workspace/files
Required scopes: agents:read.
Sourcepub async fn list_workspace_file_history(
&self,
workspace_id: &str,
params: &ListWorkspaceFileHistoryParams,
) -> Result<ListWorkspaceFileHistoryResponse>
pub async fn list_workspace_file_history( &self, workspace_id: &str, params: &ListWorkspaceFileHistoryParams, ) -> Result<ListWorkspaceFileHistoryResponse>
Prior versions of a file
Every earlier version kept for path, newest first; the current content is not in the list.
versions is empty for a file that has never been overwritten (measured 2026-09-10). Read a
version’s bytes with getWorkspaceFileHistoryContent.
GET /api/v1/workspaces/{workspaceId}/files/history
Required scopes: files:read.
Sourcepub async fn list_workspace_files(
&self,
workspace_id: &str,
params: &ListWorkspaceFilesParams,
) -> Result<ListWorkspaceFilesResponse>
pub async fn list_workspace_files( &self, workspace_id: &str, params: &ListWorkspaceFilesParams, ) -> Result<ListWorkspaceFilesResponse>
List files in workspace directory
GET /api/v1/workspaces/{workspaceId}/files
Required scopes: files:read.
Sourcepub async fn list_workspace_trash(
&self,
workspace_id: &str,
) -> Result<ListWorkspaceTrashResponse>
pub async fn list_workspace_trash( &self, workspace_id: &str, ) -> Result<ListWorkspaceTrashResponse>
List trashed files in workspace
GET /api/v1/workspaces/{workspaceId}/trash
Required scopes: files:read.
Sourcepub async fn move_workspace_file(
&self,
workspace_id: &str,
body: &MoveWorkspaceFileRequest,
) -> Result<WorkspaceFile>
pub async fn move_workspace_file( &self, workspace_id: &str, body: &MoveWorkspaceFileRequest, ) -> Result<WorkspaceFile>
Move/rename a file
POST /api/v1/workspaces/{workspaceId}/files/move
Required scopes: files:write.
Sourcepub async fn publish_workspace_snapshot(
&self,
workspace_id: &str,
body: &PublishWorkspaceSnapshotRequest,
) -> Result<PublishWorkspaceSnapshotResponse>
pub async fn publish_workspace_snapshot( &self, workspace_id: &str, body: &PublishWorkspaceSnapshotRequest, ) -> Result<PublishWorkspaceSnapshotResponse>
Mint a public share link for an HTML snapshot
Stores a self-contained HTML page (assets already inlined by the client, ≤3 MB) under an
opaque token for seven days; GET /public/share/{token} serves it back as JSON data for the
sandboxed viewer, never as executable HTML. The workspace id is not consulted beyond scope.
POST /api/v1/workspaces/{workspaceId}/publish
Required scopes: files:write.
Sourcepub async fn restore_workspace_trash(
&self,
workspace_id: &str,
body: &RestoreWorkspaceTrashRequest,
) -> Result<RestoreWorkspaceTrashResponse>
pub async fn restore_workspace_trash( &self, workspace_id: &str, body: &RestoreWorkspaceTrashRequest, ) -> Result<RestoreWorkspaceTrashResponse>
Restore a trashed file to its original path
POST /api/v1/workspaces/{workspaceId}/trash/restore
Required scopes: files:write.
Revoke workspace sharing
DELETE /api/v1/workspaces/{workspaceId}/share/{agentId}
Required scopes: files:write.
Sourcepub async fn run_workspace_command(
&self,
workspace_id: &str,
body: &RunWorkspaceCommandRequest,
) -> Result<RunWorkspaceCommandResponse>
pub async fn run_workspace_command( &self, workspace_id: &str, body: &RunWorkspaceCommandRequest, ) -> Result<RunWorkspaceCommandResponse>
Execute shell command in workspace
POST /api/v1/workspaces/{workspaceId}/run-command
Required scopes: files:write.
Sourcepub async fn search_workspace_files(
&self,
workspace_id: &str,
params: &SearchWorkspaceFilesParams,
) -> Result<SearchWorkspaceFilesResponse>
pub async fn search_workspace_files( &self, workspace_id: &str, params: &SearchWorkspaceFilesParams, ) -> Result<SearchWorkspaceFilesResponse>
Search files in workspace
GET /api/v1/workspaces/{workspaceId}/search
Required scopes: files:read.
Share workspace with an agent
POST /api/v1/workspaces/{workspaceId}/share
Required scopes: files:write.
Sourcepub async fn unassign_workspace(
&self,
workspace_id: &str,
body: &UnassignWorkspaceRequest,
) -> Result<Workspace>
pub async fn unassign_workspace( &self, workspace_id: &str, body: &UnassignWorkspaceRequest, ) -> Result<Workspace>
Unassign agent/team/company from workspace
The body names WHICH assignment to remove — agent_id, team_id or company_id. It was
undeclared until 2026-08-31, and the omission did not stay in the document: the SDK
generator faithfully wrote body: false, a proxy honoured that flag and dropped the body,
and the server still read it. The result was a DELETE that always succeeded and changed
nothing — 200, no error, unchanged state, under a button labelled Unassign.
Three layers each behaved correctly on what they were given; the mistake in the first passed through both and came out the other side as “it works”. A spec cannot be checked against a spec.
DELETE /api/v1/workspaces/{workspaceId}/assign
Required scopes: files:write.
Sourcepub async fn update(
&self,
workspace_id: &str,
body: &UpdateWorkspaceRequest,
) -> Result<Workspace>
pub async fn update( &self, workspace_id: &str, body: &UpdateWorkspaceRequest, ) -> Result<Workspace>
Update workspace name
PATCH /api/v1/workspaces/{workspaceId}
Required scopes: files:write.
Sourcepub async fn upload_workspace_file(
&self,
workspace_id: &str,
body: &UploadWorkspaceFileRequest,
params: &UploadWorkspaceFileParams,
) -> Result<Value>
pub async fn upload_workspace_file( &self, workspace_id: &str, body: &UploadWorkspaceFileRequest, params: &UploadWorkspaceFileParams, ) -> Result<Value>
Upload or update a file
PUT /api/v1/workspaces/{workspaceId}/files
Required scopes: files:write.
Trait Implementations§
Source§impl Clone for WorkspacesApi
impl Clone for WorkspacesApi
Source§fn clone(&self) -> WorkspacesApi
fn clone(&self) -> WorkspacesApi
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more