Skip to main content

WorkspacesApi

Struct WorkspacesApi 

Source
pub struct WorkspacesApi { /* private fields */ }
Expand description

Workspace management, file storage, and sharing

Implementations§

Source§

impl WorkspacesApi

Source

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.

Source

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.

Source

pub async fn create(&self, body: &CreateWorkspaceRequest) -> Result<Workspace>

Create a workspace

POST /api/v1/workspaces

Required scopes: files:write.

Source

pub async fn delete( &self, workspace_id: &str, ) -> Result<DeleteWorkspaceResponse>

Delete workspace and all files

DELETE /api/v1/workspaces/{workspaceId}

Required scopes: files:write.

Source

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.

Source

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.

Source

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.

Source

pub async fn get(&self, workspace_id: &str) -> Result<Workspace>

Get workspace metadata

GET /api/v1/workspaces/{workspaceId}

Required scopes: files:read.

Source

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.

Source

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.

Source

pub async fn list(&self) -> Result<ListWorkspacesResponse>

List all workspaces

GET /api/v1/workspaces

Required scopes: files:read.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub async fn revoke_workspace_share( &self, workspace_id: &str, agent_id: &str, ) -> Result<Workspace>

Revoke workspace sharing

DELETE /api/v1/workspaces/{workspaceId}/share/{agentId}

Required scopes: files:write.

Source

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.

Source

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.

Source

pub async fn share( &self, workspace_id: &str, body: &ShareWorkspaceRequest, ) -> Result<Workspace>

Share workspace with an agent

POST /api/v1/workspaces/{workspaceId}/share

Required scopes: files:write.

Source

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.

Source

pub async fn update( &self, workspace_id: &str, body: &UpdateWorkspaceRequest, ) -> Result<Workspace>

Update workspace name

PATCH /api/v1/workspaces/{workspaceId}

Required scopes: files:write.

Source

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

Source§

fn clone(&self) -> WorkspacesApi

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WorkspacesApi

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more