---
title: "openemail workspaces"
description: "Every command in this namespace, with its arguments, flags and examples."
url: "https://openemail.uk/docs/cli/reference/workspaces"
area: "CLI"
category: "Reference"
---

# openemail workspaces

Every command in this namespace, with its arguments, flags and examples.

## Commands

### `openemail workspaces list`

List your workspaces

```bash
openemail workspaces list [flags]
```

Resolves every workspace the person behind the client can open, the ones they own first, as the workspace switcher of the app lists them. It is about the person, not the workspace the key belongs to. An API key answers for the workspace owner, and an app for the person who connected it.

`activeWorkspaceId` is the workspace the app opens for them, `primaryWorkspaceId` the first one they made, which can never be deleted, and `personalWorkspaceId` their personal space, which holds their free address and is not in `data`.

- Scopes: `account:read`.
- Needs a sign-in.
- Aliases: `ls`.

**Examples**

```bash
openemail workspaces list
```

Print the raw JSON

```bash
openemail workspaces list --json
```

Also available in: API [`GET /workspaces`](https://openemail.uk/docs/api/reference/workspaces#get-workspaces); SDK [`workspaces.list()`](https://openemail.uk/docs/sdk/reference/workspaces#list).

### `openemail workspaces create`

Create a workspace

```bash
openemail workspaces create --name <value> [flags]
openemail workspaces create --data <json|@file|-> [flags]
```

Makes a new workspace owned by the person, on the Free plan, and makes it the workspace the app opens for them, as creating one in the app does. The key or the app making the call keeps acting for its own workspace.

An account can own one workspace on the Free plan. While it owns one, the call is refused with 403 `workspace_allowance_reached` and the message names that workspace: upgrade it first.

- Scopes: `account:write`.
- Needs a sign-in.
- Aliases: `new`, `add`.

**Flags**

- `--name <value>`: Up to 64 characters. Leading and trailing spaces are trimmed. Required, here or in `--data`.
- `--data <json|@file|->`: The whole `body` as JSON, inline, from a file with @path, or - for standard input. Flags override its keys.

**Examples**

```bash
openemail workspaces create --name 'Acme Support'
```

Read the whole body from a JSON file

```bash
openemail workspaces create --data @workspace.json
```

Also available in: API [`POST /workspaces`](https://openemail.uk/docs/api/reference/workspaces#post-workspaces); SDK [`workspaces.create()`](https://openemail.uk/docs/sdk/reference/workspaces#create).

### `openemail workspaces get-active`

Read the workspace the app opens

```bash
openemail workspaces get-active [flags]
```

Resolves the workspace the app opens for the person when they sign in, or the one it falls back to when they never chose one. It is not the workspace the key or the app acts on, which never changes.

- Scopes: `account:read`.
- Needs a sign-in.

**Examples**

```bash
openemail workspaces get-active
```

Print the raw JSON

```bash
openemail workspaces get-active --json
```

Also available in: API [`GET /workspaces/active`](https://openemail.uk/docs/api/reference/workspaces#get-workspaces-active); SDK [`workspaces.getActive()`](https://openemail.uk/docs/sdk/reference/workspaces#getActive).

### `openemail workspaces set-active`

Choose the workspace the app opens

```bash
openemail workspaces set-active <workspace-id> [flags]
```

Switches the workspace the app opens for the person, as the workspace switcher does, to any workspace they can open. It changes nothing for the key or the app making the call, which keeps acting for its own workspace.

- Scopes: `account:write`.
- Needs a sign-in.

**Arguments**

- `<workspace-id>` (required): A workspace id from `list`.

**Examples**

```bash
openemail workspaces set-active 10417196-e324-4283-af98-66ec62167c47
```

Print the raw JSON

```bash
openemail workspaces set-active 10417196-e324-4283-af98-66ec62167c47 --json
```

Also available in: API [`PUT /workspaces/active`](https://openemail.uk/docs/api/reference/workspaces#put-workspaces-active); SDK [`workspaces.setActive()`](https://openemail.uk/docs/sdk/reference/workspaces#setActive).

### `openemail workspaces delete`

Delete the workspace

```bash
openemail workspaces delete <id> --confirm <value> [flags]
```

Deletes the workspace the key or the app belongs to, with its domains, addresses, mail and members, and cancels its plan. It cannot be undone. `--confirm` has to be the name of the workspace, as `list` shows it, the same way the app asks the person to type it.

Only the owner may do it. An access token acting for a member is refused with 403 `owner_only`, and a key or an app limited to particular addresses or domains with 422 `capability_unsupported`. Any other workspace id is a 404, the first workspace an account made is refused with 409 `first_workspace`, and one with a domain being moved in or out with 409 `domain_moving`.

- Scopes: `account:write`.
- Needs a sign-in.
- Asks you to confirm.
- Aliases: `rm`, `del`, `remove`.

**Arguments**

- `<id>` (required): The id of the workspace the key or the app belongs to, which `me.get` reports as `workspaceId`.

**Flags**

- `--confirm <value>`: The name of the workspace. Letter case and the spaces around it do not matter. Sent as a query parameter. Required.

**Examples**

```bash
openemail workspaces delete workspace_4c1b257a --confirm 'Acme Support'
```

Skip the confirmation, for scripts

```bash
openemail workspaces delete workspace_4c1b257a --confirm 'Acme Support' --yes
```

Also available in: API [`DELETE /workspaces/{id}`](https://openemail.uk/docs/api/reference/workspaces#delete-workspaces-id); SDK [`workspaces.delete()`](https://openemail.uk/docs/sdk/reference/workspaces#delete).
