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

# Spaces

> Manage spaces with the AX CLI

<Note>
  The `ax spaces` commands are currently in **BETA**. The API may change without notice. A one-time warning is emitted on first use.
</Note>

The `ax spaces` commands let you create, retrieve, and manage spaces on the Arize platform.

## `ax spaces list`

List all spaces, optionally filtered by organization.

```bash theme={null}
ax spaces list [--organization-id <id>] [--limit <n>] [--cursor <cursor>]
```

| Option              | Description                                       |
| ------------------- | ------------------------------------------------- |
| `--organization-id` | Filter spaces by organization ID                  |
| `--limit`           | Maximum number of results to return (default: 15) |
| `--cursor`          | Pagination cursor for the next page               |

**Examples:**

```bash theme={null}
ax spaces list
ax spaces list --organization-id org_abc123
ax spaces list --output spaces.json
```

## `ax spaces create`

Create a new space within an organization.

```bash theme={null}
ax spaces create --name <name> --organization-id <id> [--description <text>]
```

| Option              | Description                            |
| ------------------- | -------------------------------------- |
| `--name`            | Name for the new space                 |
| `--organization-id` | Organization ID to create the space in |
| `--description`     | Optional description for the space     |

**Example:**

```bash theme={null}
ax spaces create --name "production" --organization-id org_abc123
ax spaces create --name "staging" --organization-id org_abc123 --description "Staging environment"
```

## `ax spaces get`

Retrieve a single space by name or ID.

```bash theme={null}
ax spaces get <name-or-id>
```

**Example:**

```bash theme={null}
ax spaces get sp_abc123
ax spaces get "production"
```

## `ax spaces update`

Update a space's name or description. At least one of `--name` or `--description` must be provided.

```bash theme={null}
ax spaces update <name-or-id> [--name <name>] [--description <text>]
```

| Option          | Description                   |
| --------------- | ----------------------------- |
| `--name`        | New name for the space        |
| `--description` | New description for the space |

**Examples:**

```bash theme={null}
ax spaces update sp_abc123 --name "production-v2"
ax spaces update sp_abc123 --description "Main production environment"
ax spaces update sp_abc123 --name "prod" --description "Production"
```

## `ax spaces delete`

Delete a space and all resources within it. This operation is irreversible.

```bash theme={null}
ax spaces delete <name-or-id> [--force]
```

| Option    | Description                  |
| --------- | ---------------------------- |
| `--force` | Skip the confirmation prompt |

<Warning>
  Deleting a space permanently removes all resources that belong to it — models, monitors, dashboards, datasets, custom metrics, and experiments. Without `--force`, you will be prompted to type the space name or ID to confirm.
</Warning>

**Examples:**

```bash theme={null}
ax spaces delete sp_abc123 --force
ax spaces delete "production"
```

## `ax spaces add-user`

Add a user to a space, or update their role if already a member (upsert semantics). The user must already be a member of the space's parent organization.

```bash theme={null}
ax spaces add-user <name-or-id> --user-id <id> --role <role>
```

| Option         | Description                                                           |
| -------------- | --------------------------------------------------------------------- |
| `--user-id`    | Global ID of the user to add                                          |
| `--role`, `-r` | Predefined space role: `admin`, `member`, `read-only`, or `annotator` |

**Example:**

```bash theme={null}
ax spaces add-user sp_abc123 --user-id usr_xyz789 --role member
```

## `ax spaces remove-user`

Remove a user from a space.

```bash theme={null}
ax spaces remove-user <name-or-id> --user-id <id> [--force]
```

| Option          | Description                     |
| --------------- | ------------------------------- |
| `--user-id`     | Global ID of the user to remove |
| `--force`, `-f` | Skip the confirmation prompt    |

**Examples:**

```bash theme={null}
ax spaces remove-user sp_abc123 --user-id usr_xyz789
ax spaces remove-user sp_abc123 --user-id usr_xyz789 --force
```
