> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-cursor-proxy-indicator-and-text-6cda.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspaces

> Persistent file storage across sessions. Upload input files, download results, and share data across tasks.

## What are workspaces?

A workspace is a persistent storage container that lives across sessions. Use workspaces to share files between tasks — upload input data before a task starts, or retrieve output files after it completes.

<Tip>
  Every project gets a default "My Files" workspace automatically.
</Tip>

## Create a workspace

<CodeGroup>
  ```python Python theme={null}
  from browser_use_sdk.v3 import AsyncBrowserUse

  client = AsyncBrowserUse()
  workspace = await client.workspaces.create(name="my-workspace")
  print(workspace.id, workspace.name)
  ```

  ```typescript TypeScript theme={null}
  import { BrowserUse } from "browser-use-sdk/v3";

  const client = new BrowserUse();
  const workspace = await client.workspaces.create({ name: "my-workspace" });
  console.log(workspace.id, workspace.name);
  ```
</CodeGroup>

## Manage workspaces

<CodeGroup>
  ```python Python theme={null}
  # Get
  workspace = await client.workspaces.get(workspace_id)

  # Update
  updated = await client.workspaces.update(workspace_id, name="renamed")

  # List
  workspaces = await client.workspaces.list()
  for w in workspaces.items:
      print(w.id, w.name)

  # Delete
  await client.workspaces.delete(workspace_id)
  ```

  ```typescript TypeScript theme={null}
  // Get
  const workspace = await client.workspaces.get(workspaceId);

  // Update
  const updated = await client.workspaces.update(workspaceId, { name: "renamed" });

  // List
  const workspaces = await client.workspaces.list();
  for (const w of workspaces.items) {
    console.log(w.id, w.name);
  }

  // Delete
  await client.workspaces.delete(workspaceId);
  ```
</CodeGroup>

## Use a workspace with a task

Pass `workspace_id` when running a task. The agent can read and write files in the workspace during execution.

<CodeGroup>
  ```python Python theme={null}
  from browser_use_sdk.v3 import AsyncBrowserUse

  client = AsyncBrowserUse()

  workspace = await client.workspaces.create(name="my-workspace")

  result = await client.run(
      'Create a file called HEARTBEAT.md with the text "say hello"',
      workspace_id=str(workspace.id),
  )
  print(result.output)
  ```

  ```typescript TypeScript theme={null}
  import { BrowserUse } from "browser-use-sdk/v3";

  const client = new BrowserUse();

  const workspace = await client.workspaces.create({ name: "my-workspace" });

  const result = await client.run(
    'Create a file called HEARTBEAT.md with the text "say hello"',
    { workspaceId: workspace.id },
  );
  console.log(result.output);
  ```
</CodeGroup>

## List and delete files

After a task completes, list files in the workspace or clean up individual files.

<CodeGroup>
  ```python Python theme={null}
  # List files
  files = await client.workspaces.files(workspace_id, include_urls=True)
  for f in files.files:
      print(f.path, f.size)

  # Delete a file
  await client.workspaces.delete_file(workspace_id, path="HEARTBEAT.md")
  ```

  ```typescript TypeScript theme={null}
  // List files
  const files = await client.workspaces.files(workspaceId, { includeUrls: true });
  for (const f of files.files) {
    console.log(f.path, f.size);
  }

  // Delete a file
  await client.workspaces.deleteFile(workspaceId, "HEARTBEAT.md");
  ```
</CodeGroup>

<Warning>
  Deleting a workspace permanently removes all its files. This cannot be undone.
</Warning>

<CardGroup cols={2}>
  <Card title="Workspaces API Reference" icon="code" href="/cloud/api-reference">
    Full endpoint reference.
  </Card>

  <Card title="Sessions Guide" icon="browser" href="/cloud/guides/sessions">
    Learn about sessions and profiles.
  </Card>
</CardGroup>
