> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blaxel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspaces, users and roles

> Manage Blaxel workspaces, invite users, assign roles, and configure access control to share resources securely across your organization.

All resources on Blaxel are logically regrouped in an **account**, which is the highest possible level of tenancy. An account can have **multiple workspaces** — a common pattern when dealing with multiple environments (e.g. development vs. production), business units, or end-clients.

Users can be either [team members](https://docs.blaxel.ai/Security/Workspace-access-control.md), or [service accounts](https://docs.blaxel.ai/Security/Service-accounts.md) that represent external systems that can operate Blaxel. They are added to a workspace with certain permissions on the workspace resources inherited from their role.

## Workspace name

The workspace name (called `name` in the Blaxel API) uniquely identifies your workspace. You set it when the workspace is created. Once set, it cannot be changed. The workspace name appears at the bottom of the left sidebar in the Blaxel Console.

Each workspace also has a display name for better organization, which workspace admins can modify.

## User roles

There are three roles that a user or service account can have in a workspace: **admin**, **member** and **viewer**.

### Sandboxes

| Action | Viewer | Member | Admin |
| - | :-: | :-: | :-: |
| List and view [sandboxes](https://docs.blaxel.ai/Sandboxes/Overview.md), their snapshots, previews and schedules | ✓ | ✓ | ✓ |
| View sandbox logs and metrics | ✓ | ✓ | ✓ |
| Create, update, start, stop, fork and delete sandboxes | | ✓ | ✓ |
| Archive and unarchive sandboxes, create and restore snapshots | | ✓ | ✓ |
| Create, update and delete previews and schedules | | ✓ | ✓ |
| Create preview tokens, view preview tokens and request headers | | ✓ | ✓ |
| Open a terminal in a sandbox | | ✓ | ✓ |
| Use the [sandbox API](https://docs.blaxel.ai/Sandboxes/Overview.md): processes, filesystem, network (ports and tunnels), drive mounts, codegen, archive and system | | ✓ | ✓ |

### Workspace

| Action | Viewer | Member | Admin |
| - | :-: | :-: | :-: |
| View team members | ✓ | ✓ | ✓ |
| Invite and remove users, change their role | | | ✓ |
| Manage service accounts and their API keys | | | ✓ |
| Rename and delete the workspace | | | ✓ |

## Shared account settings

A Blaxel account is the top-level entity that owns one or more workspaces. The following are managed at the account level and are **shared across all workspaces** in an account:

* Quota tier and limits
* Credits
* SSO/SAML configuration
* Usage analytics

This means that resource usage in any workspace draws from the common credit balance and counts toward the same quotas. See the [usage and quotas documentation](https://docs.blaxel.ai/Security/Quotas.md) for more information.

## Create a workspace

Workspaces can be created, managed, and deleted using the Blaxel Console and the Blaxel SDKs.

### Blaxel Console

To create a new workspace using the Blaxel Console:

* Click the workspace name at the bottom left corner.

* In the rollout menu, click **Switch** > **+**.

  ![Workspaces](https://mintcdn.com/blaxel/bXo-Y-Pc2ytv5Hve/images/workspaces/create-workspace-1.webp?fit=max\&auto=format\&n=bXo-Y-Pc2ytv5Hve\&q=85\&s=b4b3394f89cf3d0eb3d914c5305b7a9c)

* In the **Create a new workspace** dialog, enter a workspace name and label.

* Click **Create** to create the workspace.

  ![Workspaces](https://mintcdn.com/blaxel/bXo-Y-Pc2ytv5Hve/images/workspaces/create-workspace-2.webp?fit=max\&auto=format\&n=bXo-Y-Pc2ytv5Hve\&q=85\&s=8bcb70fed5413f7b53cfc201c3f23944)

### Blaxel SDKs

```typescript TypeScript theme={null}
import { createWorkspace } from "@blaxel/core";

const { data: newWs } = await createWorkspace({
  body: {
    name: "my-workspace",
    displayName: "My Workspace",
    region: "us-west-2",
  },
});
console.log(newWs);
```

```python Python theme={null}
import asyncio
from blaxel.core.common import autoload
from blaxel.core.client import client
from blaxel.core.client.api.workspaces import create_workspace
from blaxel.core.client.models.workspace import Workspace

autoload()

async def main():
    new_ws = await create_workspace.asyncio(
        client=client,
        body=Workspace(
            name="my-workspace",
            display_name="My Workspace",
            region="us-west-2",
        ),
    )
    print(new_ws)

asyncio.run(main())
```

## Delete a workspace

> [!WARNING]
>
> Deleting a workspace is permanent and cannot be undone.

### Blaxel Console

To delete a workspace using the Blaxel Console:

* Click the workspace name at the bottom left corner.
* Click **Workspace settings**.
* Review the information and click **Delete workspace** to delete the workspace.

  ![Workspaces](https://mintcdn.com/blaxel/bXo-Y-Pc2ytv5Hve/images/workspaces/delete-workspace.webp?fit=max\&auto=format\&n=bXo-Y-Pc2ytv5Hve\&q=85\&s=051d21795f0a2b85b8d1b4ea741918ad)

### Blaxel SDKs

```typescript TypeScript theme={null}
import { deleteWorkspace } from "@blaxel/core";

const { data: deleted } = await deleteWorkspace({
  path: {
    workspaceName: "my-workspace",
  },
});
console.log(deleted);
```

```python Python theme={null}
import asyncio
from blaxel.core.common import autoload
from blaxel.core.client import client
from blaxel.core.client.api.workspaces import delete_workspace

autoload()

async def main():
    deleted = await delete_workspace.asyncio(
        workspace_name="my-workspace",
        client=client,
    )
    print(deleted)

asyncio.run(main())
```

## Invite a member

Admins can invite team members via their email address. They will be prompted for the role to give the user.

To invite a team member:

* Click **Workspace** > **Team**.
* Click **Invite user**.
* Enter the invitee's email address and role.

  ![Workspaces](https://mintcdn.com/blaxel/bXo-Y-Pc2ytv5Hve/images/workspaces/invite-user.webp?fit=max\&auto=format\&n=bXo-Y-Pc2ytv5Hve\&q=85\&s=5f028813d46d1065615e1e479c7eb616)

The invitee will receive an email to allow them to accept the invitation on the Blaxel console. They will not be able to access workspace resources until they have manually accepted the invitation. If the user doesn't have a Blaxel account already, they will be asked to sign up first.

Invitations to other workspaces are visible from your profile.

## Remove a member

To remove a member from a standard Blaxel workspace:

* Click **Workspace** > **Team**
* Select **Remove** from the member's actions menu
* Confirm the removal

Only workspace admins can remove members. You cannot remove yourself; another workspace admin must remove you.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.