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

# Role Bindings

> Manage role bindings with the AX CLI

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

The `ax role-bindings` commands let you create, retrieve, update, and delete role bindings on the Arize platform. A role binding assigns a role to a user on a specific resource. Only one binding per user per resource is allowed.

## `ax role-bindings list`

List role bindings for the authenticated user's account. `--resource-type` is required.

```bash theme={null}
ax role-bindings list --resource-type <type> [--user-id <id>] [--limit <n>] [--cursor <cursor>] [--output <fmt>] [--verbose]
```

| Option            | Description                                                         |
| ----------------- | ------------------------------------------------------------------- |
| `--resource-type` | Resource type to list bindings for: `SPACE` or `PROJECT` (required) |
| `--user-id`       | Filter by user ID (global ID)                                       |
| `--limit`, `-l`   | Maximum number of role bindings to return (default: 100)            |
| `--cursor`, `-c`  | Pagination cursor for next page                                     |
| `--output`, `-o`  | Output format (`table`, `json`, `csv`, `parquet`) or file path      |
| `--verbose`, `-v` | Enable verbose logs                                                 |

**Examples:**

```bash theme={null}
ax role-bindings list --resource-type PROJECT
ax role-bindings list --resource-type SPACE --user-id usr_abc123
```

## `ax role-bindings create`

Create a new role binding. Assigns a role to a user on the specified resource. If a binding already exists for the user on the resource, the command exits without error.

```bash theme={null}
ax role-bindings create --user-id <id> --role-id <id> --resource-type <type> --resource-id <id> [--output <fmt>] [--verbose]
```

| Option            | Description                                                                             |
| ----------------- | --------------------------------------------------------------------------------------- |
| `--user-id`       | Global ID of the user to bind the role to (required; prompted if omitted)               |
| `--role-id`       | Global ID of the role to assign (required; prompted if omitted)                         |
| `--resource-type` | Resource type to bind the role on: `SPACE` or `PROJECT` (required; prompted if omitted) |
| `--resource-id`   | Global ID of the resource to bind the role on (required; prompted if omitted)           |
| `--output`, `-o`  | Output format (`table`, `json`, `csv`, `parquet`) or file path                          |
| `--verbose`, `-v` | Enable verbose logs                                                                     |

**Example:**

```bash theme={null}
ax role-bindings create \
  --user-id usr_abc123 \
  --role-id role_xyz789 \
  --resource-type PROJECT \
  --resource-id proj_abc123
```

## `ax role-bindings get`

Get a role binding by ID.

```bash theme={null}
ax role-bindings get <binding-id> [--output <fmt>] [--verbose]
```

| Option            | Description                                                    |
| ----------------- | -------------------------------------------------------------- |
| `binding-id`      | Role binding ID (required positional argument)                 |
| `--output`, `-o`  | Output format (`table`, `json`, `csv`, `parquet`) or file path |
| `--verbose`, `-v` | Enable verbose logs                                            |

**Example:**

```bash theme={null}
ax role-bindings get rb_abc123
```

## `ax role-bindings update`

Update a role binding by replacing its assigned role.

```bash theme={null}
ax role-bindings update <binding-id> --role-id <id> [--output <fmt>] [--verbose]
```

| Option            | Description                                                    |
| ----------------- | -------------------------------------------------------------- |
| `binding-id`      | Role binding ID (required positional argument)                 |
| `--role-id`       | New role ID to assign (required; prompted if omitted)          |
| `--output`, `-o`  | Output format (`table`, `json`, `csv`, `parquet`) or file path |
| `--verbose`, `-v` | Enable verbose logs                                            |

**Example:**

```bash theme={null}
ax role-bindings update rb_abc123 --role-id role_new789
```

## `ax role-bindings delete`

Delete a role binding by ID. This operation is irreversible.

```bash theme={null}
ax role-bindings delete <binding-id> [--force] [--verbose]
```

| Option            | Description                                    |
| ----------------- | ---------------------------------------------- |
| `binding-id`      | Role binding ID (required positional argument) |
| `--force`, `-f`   | Skip confirmation prompt                       |
| `--verbose`, `-v` | Enable verbose logs                            |

**Examples:**

```bash theme={null}
ax role-bindings delete rb_abc123
ax role-bindings delete rb_abc123 --force
```
