---
title: RBAC Roles
url: https://platform.claude.com/docs/en/api/typescript/organization/rbac_roles
---

# RBAC Roles

## List RBAC Roles

- Signature: `client.organization.rbacRoles.list(query?: RBACRoleListParams, options?: RequestOptions): PageCursor<RBACRole>`
- Endpoint: `GET /v1/organizations/rbac_roles`

List RBAC Roles in the organization.

The RBAC Roles API is available to Claude Enterprise organizations only.

### Example request

```ts
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const rbacRole of client.organization.rbacRoles.list()) {
  console.log(rbacRole.id);
}
```

### Example response (200)

```json
{
  "data": [
    {
      "id": "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "display_name": "Project Editor",
      "source": {
        "type": "built_in"
      },
      "type": "rbac_role",
      "updated_at": "2024-10-30T23:58:27.427722Z"
    }
  ],
  "has_more": true,
  "next_page": "eyJjdXJzb3IiOiAicmJhY19yb2xlXzAxIn0"
}
```

### Parameters

```ts
// This page declares each type one time, in the first method that uses it.

interface RBACRoleListParams {
  /** Number of items to return per page. Defaults to `20`. Ranges from `1` to `1000`. */
  limit?: number; // query parameter, minimum: 1, maximum: 1000
  /** Optionally set to the `next_page` token from the previous response. */
  page?: string | null; // query parameter
}
```

### Returns

```ts
interface RBACRole {
  /** Object type. For RBAC Roles, this is always `"rbac_role"`. */
  type: "rbac_role";
  /** ID of the RBAC Role. */
  id: string;
  /** RFC 3339 datetime string indicating when the RBAC Role was created. */
  created_at: string; // format: date-time
  /** Name of the RBAC Role. For a built-in role, this is Anthropic's name for the access that the role grants. Anthropic may change this name, so to keep a lasting reference to a role, store its `id`. */
  display_name: string;
  /** Whether the RBAC Role is built-in or custom. More values of `type` may be added, so do not treat every role that is not `built_in` as `custom`. */
  source: RBACRoleSource;
  /** RFC 3339 datetime string indicating when the RBAC Role was last updated. */
  updated_at: string; // format: date-time
}
```

### Errors

Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=typescript).

- `OrganizationTypeNotSupportedError` (HTTP status 400, error code `organization_type_not_supported`)

  The endpoint does not support the organization's type. Each endpoint's description says which organization types it supports.

- `ParentOrganizationRequiredError` (HTTP status 400, error code `parent_organization_required`)

  The endpoint serves only organizations that belong to a parent organization, and this organization belongs to none.

### Types

```ts
type RBACRoleSource = RBACRoleSourceBuiltIn | RBACRoleSourceCustom;

interface RBACRoleSourceBuiltIn {
  /** Anthropic provisions the RBAC Role, and the organization's administrators cannot change or delete it. */
  type: "built_in";
}

interface RBACRoleSourceCustom {
  /** The organization's administrators can change and delete the RBAC Role. */
  type: "custom";
}
```

## Get RBAC Role

- Signature: `client.organization.rbacRoles.retrieve(rbacRoleID: string, options?: RequestOptions): RBACRole`
- Endpoint: `GET /v1/organizations/rbac_roles/{rbac_role_id}`

Retrieve an RBAC Role by ID.

The RBAC Roles API is available to Claude Enterprise organizations only.

### Example request

```ts
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});

const rbacRole = await client.organization.rbacRoles.retrieve("rbac_role_id");

console.log(rbacRole.id);
```

### Example response (200)

```json
{
  "id": "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "Project Editor",
  "source": {
    "type": "built_in"
  },
  "type": "rbac_role",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### Parameters

```ts
/** ID of the RBAC Role. */
rbacRoleID: string; // path parameter
```

### Errors

Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=typescript).

- `OrganizationTypeNotSupportedError` (HTTP status 400, error code `organization_type_not_supported`)

  The endpoint does not support the organization's type. Each endpoint's description says which organization types it supports.

- `ParentOrganizationRequiredError` (HTTP status 400, error code `parent_organization_required`)

  The endpoint serves only organizations that belong to a parent organization, and this organization belongs to none.

- `RBACRoleNotFoundError` (HTTP status 404, error code `rbac_role_not_found`)

  No RBAC Role with this ID was found.

## RBAC Roles › Permissions

### List RBAC Role Permissions

- Signature: `client.organization.rbacRoles.permissions.list(rbacRoleID: string, query?: PermissionListParams, options?: RequestOptions): PageCursor<RBACRolePermission>`
- Endpoint: `GET /v1/organizations/rbac_roles/{rbac_role_id}/permissions`

List the permissions an RBAC Role grants.

The RBAC Roles API is available to Claude Enterprise organizations only.

#### Example request

```ts
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const rbacRolePermission of client.organization.rbacRoles.permissions.list(
  "rbac_role_id"
)) {
  console.log(rbacRolePermission.action);
}
```

#### Example response (200)

```json
{
  "data": [
    {
      "action": "use",
      "resource": {
        "organization_id": "3c4f5e6d-7a8b-49c0-9d1e-2f3a4b5c6d7e",
        "type": "organization"
      },
      "type": "rbac_role_permission"
    }
  ],
  "has_more": true,
  "next_page": "eyJjdXJzb3IiOiAicmJhY19yb2xlXzAxIn0"
}
```

#### Parameters

```ts
/** ID of the RBAC Role. */
rbacRoleID: string; // path parameter

interface PermissionListParams {
  /** Number of items to return per page. Defaults to `20`. Ranges from `1` to `1000`. */
  limit?: number; // query parameter, minimum: 1, maximum: 1000
  /** Optionally set to the `next_page` token from the previous response. */
  page?: string | null; // query parameter
}
```

#### Returns

```ts
interface RBACRolePermission {
  /** Object type. For RBAC Role Permissions, this is always `"rbac_role_permission"`. */
  type: "rbac_role_permission";
  /** Action the permission grants on the resource. The vocabulary follows the resource: an `organization` grant carries a product-feature entitlement (for example `chat`), an admin-panel permission entitlement (`permission_*`), or a blanket capability-access mode — `capability_access_all` grants every product-feature entitlement except `inference_hooks_inspection`, which a role holds only through its own row, and `capability_access_all_ga` grants the subset of those for stable features as it stands at permission-check time; neither mode grants model-access entitlements. A consumer enumerating a role's per-feature grants should treat a blanket row as granting every product-feature entitlement it covers, or it will under-report the role's effective access. A `connector_tool` grant carries a tool-access action (`use` or `always_allow`); a `connector_scope` grant carries the scope action `grant` (the role may receive the named OAuth scope when tokens are minted for the connector); `connector` and `all_connectors` grants carry a tool-access action, the scope action, or an authentication-method action (`interactive` or `managed`). */
  action: string;
  /** What the permission applies to. A tagged union: `type` names the kind of resource and determines which identifier fields are present. */
  resource: RBACOrganizationPermissionResource | RBACConnectorToolPermissionResource | RBACConnectorScopePermissionResource | RBACConnectorPermissionResource | RBACAllConnectorsPermissionResource;
}
```

#### Errors

Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=typescript).

- `OrganizationTypeNotSupportedError` (HTTP status 400, error code `organization_type_not_supported`)

  The endpoint does not support the organization's type. Each endpoint's description says which organization types it supports.

- `ParentOrganizationRequiredError` (HTTP status 400, error code `parent_organization_required`)

  The endpoint serves only organizations that belong to a parent organization, and this organization belongs to none.

- `RBACRoleNotFoundError` (HTTP status 404, error code `rbac_role_not_found`)

  No RBAC Role with this ID was found.

#### Types

```ts
interface RBACOrganizationPermissionResource {
  /** Kind of resource the permission applies to. */
  type: "organization";
  /** UUID of the organization the permission applies to. */
  organization_id: string;
}

interface RBACConnectorToolPermissionResource {
  /** Kind of resource the permission applies to. */
  type: "connector_tool";
  /** ID of the connector the permission applies to. */
  connector_id: string;
  /** Published name of the connector tool the permission applies to. When the published name contains characters outside `[a-zA-Z0-9_-]` (or collides with a reserved form), it is server-encoded into a stable `{prefix}_{32-hex}` form — a shortened readable prefix of the name plus a hash — from which the published name is not recoverable. */
  tool_name: string;
}

interface RBACConnectorScopePermissionResource {
  /** Kind of resource the permission applies to. */
  type: "connector_scope";
  /** ID of the connector the permission applies to. */
  connector_id: string;
  /** OAuth scope the permission names — the role may receive this scope when tokens are minted for the connector. Subject to the same encoding rule as `tool_name`: a scope containing characters outside `[a-zA-Z0-9_-]` (or colliding with a reserved form) appears server-encoded in a stable `{prefix}_{32-hex}` form. OAuth scopes routinely contain `:` and `/`, so most appear encoded. */
  scope: string;
}

interface RBACConnectorPermissionResource {
  /** Kind of resource the permission applies to. */
  type: "connector";
  /** ID of the connector the permission applies to. */
  connector_id: string;
}

interface RBACAllConnectorsPermissionResource {
  /** Kind of resource the permission applies to. */
  type: "all_connectors";
}
```
