> ## 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.

# Role Bindings

> Assign and manage role bindings that grant users access to specific resources using the Arize Python SDK.

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

Role bindings assign a role to a user on a specific resource (`SPACE` or `PROJECT`). Attempting to create a binding when one already exists for the user on the resource raises an error (HTTP 409 Conflict).

## List Role Bindings

<Note>
  The `list` method is currently in **ALPHA**. The API may change without notice.
</Note>

List role bindings for your account, filtered by resource type. `resource_type` is required; optionally filter to a single user with `user_id`.

```python theme={null}
from arize.role_bindings.types import RoleBindingResourceType

resp = client.role_bindings.list(
    resource_type=RoleBindingResourceType.PROJECT,  # SPACE or PROJECT
    user_id="your-user-id",  # optional
    limit=50,
)

for binding in resp.role_bindings:
    print(binding.id, binding.user_id, binding.role_id)
```

For details on pagination, field introspection, and data conversion (to dict/JSON/DataFrame), see [Response Objects](/api-clients/python/version-8/overview#response-objects).

## Create a Role Binding

```python theme={null}
from arize.role_bindings.types import RoleBindingResourceType

binding = client.role_bindings.create(
    user_id="your-user-id",
    role_id="your-role-id",
    resource_type=RoleBindingResourceType.PROJECT,  # SPACE or PROJECT
    resource_id="your-project-id",
)

print(binding.id)
```

## Get a Role Binding

```python theme={null}
binding = client.role_bindings.get(binding_id="your-binding-id")

print(binding.user_id, binding.role_id)
```

## Update a Role Binding

Only the `role_id` can be changed. The user, resource type, and resource ID remain the same.

```python theme={null}
binding = client.role_bindings.update(
    binding_id="your-binding-id",
    role_id="your-new-role-id",
)

print(binding.role_id)
```

## Delete a Role Binding

```python theme={null}
client.role_bindings.delete(binding_id="your-binding-id")
```
