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

# RBAC Groups

## Create RBAC Group

- Signature: `client.organization.rbacGroups.create(body: RBACGroupCreateParams, options?: RequestOptions): RBACGroup`
- Endpoint: `POST /v1/organizations/rbac_groups`

Create an RBAC Group in the Claude Enterprise tenant. Groups created via the API have source type `"direct"`.

The RBAC Groups 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 rbacGroup = await client.organization.rbacGroups.create({ name: "Engineering" });

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

### Example response (200)

```json
{
  "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "name": "Engineering",
  "role_ids": [
    "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
  ],
  "source_type": "direct",
  "type": "rbac_group",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### Parameters

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

interface RBACGroupCreateParams {
  /** Name of the RBAC Group. Not uniqueness-enforced. */
  name: string; // minLength: 1, maxLength: 255
}
```

### Returns

```ts
interface RBACGroup {
  /** Object type. For RBAC Groups, this is always `"rbac_group"`. */
  type: "rbac_group";
  /** ID of the RBAC Group. */
  id: string;
  /** RFC 3339 timestamp of when the RBAC Group was created. */
  created_at: string; // format: date-time
  /** Name of the RBAC Group. Not uniqueness-enforced. */
  name: string;
  /** RBAC Role IDs attached to this RBAC Group. Role attachment is managed in the admin settings and is read-only on this API. `null` means role data was temporarily unavailable — retry to distinguish from an empty list. */
  role_ids: Array<string> | null;
  /** How the RBAC Group was created: `"direct"` for groups created directly (for example, in the organization's admin settings), `"scim"` for groups provisioned by the identity provider. */
  source_type: "direct" | "scim";
  /** RFC 3339 timestamp of when the RBAC Group 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).

- `SandboxEgressRestrictedError` (HTTP status 403, error code `sandbox_egress_restricted`)

  The request came from a Claude sandbox with restricted network access, which is not allowed to make this request. Send it from outside the sandbox, or from a sandbox with unrestricted network access.

## List RBAC Groups

- Signature: `client.organization.rbacGroups.list(query?: RBACGroupListParams, options?: RequestOptions): PageCursor<RBACGroup>`
- Endpoint: `GET /v1/organizations/rbac_groups`

List RBAC Groups in the Claude Enterprise tenant.

The RBAC Groups 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 rbacGroup of client.organization.rbacGroups.list()) {
  console.log(rbacGroup.id);
}
```

### Example response (200)

```json
{
  "data": [
    {
      "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "name": "Engineering",
      "role_ids": [
        "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
      ],
      "source_type": "direct",
      "type": "rbac_group",
      "updated_at": "2024-10-30T23:58:27.427722Z"
    }
  ],
  "has_more": false,
  "next_page": "eyJjdXJzb3IiOiAicmJhY19ncm91cF8wMSJ9"
}
```

### Parameters

```ts
interface RBACGroupListParams {
  /** 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
}
```

## Get RBAC Group

- Signature: `client.organization.rbacGroups.retrieve(rbacGroupID: string, options?: RequestOptions): RBACGroup`
- Endpoint: `GET /v1/organizations/rbac_groups/{rbac_group_id}`

Retrieve an RBAC Group by ID.

The RBAC Groups 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 rbacGroup = await client.organization.rbacGroups.retrieve("rbac_group_id");

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

### Example response (200)

```json
{
  "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "name": "Engineering",
  "role_ids": [
    "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
  ],
  "source_type": "direct",
  "type": "rbac_group",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### Parameters

```ts
/** ID of the RBAC Group. */
rbacGroupID: string; // path parameter
```

## Update RBAC Group

- Signature: `client.organization.rbacGroups.update(rbacGroupID: string, body: RBACGroupUpdateParams, options?: RequestOptions): RBACGroup`
- Endpoint: `POST /v1/organizations/rbac_groups/{rbac_group_id}`

Update an RBAC Group's name. Groups provisioned by an identity provider (source type `"scim"`) cannot be modified via the API while an organization in the tenant uses SCIM provisioning.

The RBAC Groups 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 rbacGroup = await client.organization.rbacGroups.update("rbac_group_id", {});

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

### Example response (200)

```json
{
  "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "name": "Engineering",
  "role_ids": [
    "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s"
  ],
  "source_type": "direct",
  "type": "rbac_group",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}
```

### Parameters

```ts
/** ID of the RBAC Group. */
rbacGroupID: string; // path parameter

interface RBACGroupUpdateParams {
  /** Name of the RBAC Group. Not uniqueness-enforced. */
  name?: string | null; // minLength: 1, maxLength: 255
}
```

### Errors

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

- `SandboxEgressRestrictedError` (HTTP status 403, error code `sandbox_egress_restricted`)

  The request came from a Claude sandbox with restricted network access, which is not allowed to make this request. Send it from outside the sandbox, or from a sandbox with unrestricted network access.

## Delete RBAC Group

- Signature: `client.organization.rbacGroups.delete(rbacGroupID: string, options?: RequestOptions): DeletedRBACGroup`
- Endpoint: `DELETE /v1/organizations/rbac_groups/{rbac_group_id}`

Delete an RBAC Group. Groups provisioned by an identity provider (source type `"scim"`) cannot be deleted via the API while an organization in the tenant uses SCIM provisioning.

The RBAC Groups 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 deletedRBACGroup = await client.organization.rbacGroups.delete("rbac_group_id");

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

### Example response (200)

```json
{
  "id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "type": "rbac_group_deleted"
}
```

### Parameters

```ts
/** ID of the RBAC Group. */
rbacGroupID: string; // path parameter
```

### Returns

```ts
interface DeletedRBACGroup {
  /** Deleted object type. For RBAC Groups, this is always `"rbac_group_deleted"`. */
  type: "rbac_group_deleted";
  /** ID of the RBAC Group. */
  id: string;
}
```

### Errors

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

- `RBACGroupGrantsOwnerAccessError` (HTTP status 400, error code `rbac_group_grants_owner_access`)

  A role attached to an RBAC Group in the request grants owner access, so this API does not add members to that group (directly or through an invite), remove its members, or delete it. Make the change in the organization's admin settings in Claude.

- `RBACGroupOwnerAccessUnconfirmedError` (HTTP status 400, error code `rbac_group_owner_access_unconfirmed`)

  The API could not finish checking whether an RBAC Group in the request grants owner access, so it made no change. Retrying the same request will not help. Make the change in the organization's admin settings in Claude.

- `SandboxEgressRestrictedError` (HTTP status 403, error code `sandbox_egress_restricted`)

  The request came from a Claude sandbox with restricted network access, which is not allowed to make this request. Send it from outside the sandbox, or from a sandbox with unrestricted network access.

## Errors

### RBACGroupGrantsOwnerAccessError

HTTP status 400, error code `rbac_group_grants_owner_access`

- `class RBACGroupGrantsOwnerAccessError extends BadRequestError`

  A role attached to an RBAC Group in the request grants owner access, so this API does not add members to that group (directly or through an invite), remove its members, or delete it. Make the change in the organization's admin settings in Claude.

  - `errorCode: "rbac_group_grants_owner_access"`

  - `details: RBACGroupGrantsOwnerAccessErrorDetails`

    - `error_code: "rbac_group_grants_owner_access"`

### RBACGroupOwnerAccessUnconfirmedError

HTTP status 400, error code `rbac_group_owner_access_unconfirmed`

- `class RBACGroupOwnerAccessUnconfirmedError extends BadRequestError`

  The API could not finish checking whether an RBAC Group in the request grants owner access, so it made no change. Retrying the same request will not help. Make the change in the organization's admin settings in Claude.

  - `errorCode: "rbac_group_owner_access_unconfirmed"`

  - `details: RBACGroupOwnerAccessUnconfirmedErrorDetails`

    - `error_code: "rbac_group_owner_access_unconfirmed"`

## RBAC Groups › Members

### List RBAC Group Members

- Signature: `client.organization.rbacGroups.members.list(rbacGroupID: string, query?: MemberListParams, options?: RequestOptions): PageCursor<RBACGroupMember>`
- Endpoint: `GET /v1/organizations/rbac_groups/{rbac_group_id}/members`

List members of an RBAC Group.

The RBAC Groups 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 rbacGroupMember of client.organization.rbacGroups.members.list(
  "rbac_group_id"
)) {
  console.log(rbacGroupMember.rbac_group_id);
}
```

#### Example response (200)

```json
{
  "data": [
    {
      "created_at": "2024-10-30T23:58:27.427722Z",
      "email": "user@emaildomain.com",
      "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
      "type": "rbac_group_member",
      "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu"
    }
  ],
  "has_more": false,
  "next_page": "eyJjdXJzb3IiOiAicmJhY19ncm91cF8wMSJ9"
}
```

#### Parameters

```ts
/** ID of the RBAC Group. */
rbacGroupID: string; // path parameter

interface MemberListParams {
  /** 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 RBACGroupMember {
  /** Object type. For RBAC Group Members, this is always `"rbac_group_member"`. */
  type: "rbac_group_member";
  /** RFC 3339 timestamp of when the User was added to the RBAC Group. */
  created_at: string; // format: date-time
  /** Email of the User. */
  email: string;
  /** ID of the RBAC Group. */
  rbac_group_id: string;
  /** ID of the User. */
  user_id: string;
}
```

### Add RBAC Group Member

- Signature: `client.organization.rbacGroups.members.add(rbacGroupID: string, body: MemberAddParams, options?: RequestOptions): RBACGroupMember`
- Endpoint: `POST /v1/organizations/rbac_groups/{rbac_group_id}/members`

Add a User to an RBAC Group. Membership of groups provisioned by an identity provider (source type `"scim"`) cannot be modified via the API while an organization in the tenant uses SCIM provisioning.

The RBAC Groups 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 rbacGroupMember = await client.organization.rbacGroups.members.add("rbac_group_id", {
  user_id: "user_01WxYzAbCdEfGhJkMnPqRsTu"
});

console.log(rbacGroupMember.rbac_group_id);
```

#### Example response (200)

```json
{
  "created_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "type": "rbac_group_member",
  "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu"
}
```

#### Parameters

```ts
/** ID of the RBAC Group. */
rbacGroupID: string; // path parameter

interface MemberAddParams {
  /** ID of the User. */
  user_id: string;
}
```

#### Errors

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

- `RBACGroupGrantsOwnerAccessError` (HTTP status 400, error code `rbac_group_grants_owner_access`)

  A role attached to an RBAC Group in the request grants owner access, so this API does not add members to that group (directly or through an invite), remove its members, or delete it. Make the change in the organization's admin settings in Claude.

- `RBACGroupOwnerAccessUnconfirmedError` (HTTP status 400, error code `rbac_group_owner_access_unconfirmed`)

  The API could not finish checking whether an RBAC Group in the request grants owner access, so it made no change. Retrying the same request will not help. Make the change in the organization's admin settings in Claude.

- `SandboxEgressRestrictedError` (HTTP status 403, error code `sandbox_egress_restricted`)

  The request came from a Claude sandbox with restricted network access, which is not allowed to make this request. Send it from outside the sandbox, or from a sandbox with unrestricted network access.

### Remove RBAC Group Member

- Signature: `client.organization.rbacGroups.members.remove(userID: string, params: MemberRemoveParams, options?: RequestOptions): DeletedRBACGroupMember`
- Endpoint: `DELETE /v1/organizations/rbac_groups/{rbac_group_id}/members/{user_id}`

Remove a User from an RBAC Group. Membership of groups provisioned by an identity provider (source type `"scim"`) cannot be modified via the API while an organization in the tenant uses SCIM provisioning.

The RBAC Groups 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 deletedRBACGroupMember = await client.organization.rbacGroups.members.remove("user_id", {
  rbac_group_id: "rbac_group_id"
});

console.log(deletedRBACGroupMember.rbac_group_id);
```

#### Example response (200)

```json
{
  "rbac_group_id": "rbac_group_012rppKaSVsmTo6NqRDXQXNF",
  "type": "rbac_group_member_deleted",
  "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu"
}
```

#### Parameters

```ts
/** ID of the User. */
userID: string; // path parameter

interface MemberRemoveParams {
  /** ID of the RBAC Group. */
  rbac_group_id: string; // path parameter
}
```

#### Returns

```ts
interface DeletedRBACGroupMember {
  /** Deleted object type. For RBAC Group Members, this is always `"rbac_group_member_deleted"`. */
  type: "rbac_group_member_deleted";
  /** ID of the RBAC Group. */
  rbac_group_id: string;
  /** ID of the User. */
  user_id: string;
}
```

#### Errors

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

- `RBACGroupGrantsOwnerAccessError` (HTTP status 400, error code `rbac_group_grants_owner_access`)

  A role attached to an RBAC Group in the request grants owner access, so this API does not add members to that group (directly or through an invite), remove its members, or delete it. Make the change in the organization's admin settings in Claude.

- `RBACGroupOwnerAccessUnconfirmedError` (HTTP status 400, error code `rbac_group_owner_access_unconfirmed`)

  The API could not finish checking whether an RBAC Group in the request grants owner access, so it made no change. Retrying the same request will not help. Make the change in the organization's admin settings in Claude.

- `SandboxEgressRestrictedError` (HTTP status 403, error code `sandbox_egress_restricted`)

  The request came from a Claude sandbox with restricted network access, which is not allowed to make this request. Send it from outside the sandbox, or from a sandbox with unrestricted network access.

## Types

```ts
/** A role attached to an RBAC Group in the request grants owner access, so this API does not add members to that group (directly or through an invite), remove its members, or delete it. Make the change in the organization's admin settings in Claude. */
interface RBACGroupGrantsOwnerAccessErrorDetails {
  error_code: "rbac_group_grants_owner_access";
}

/** The API could not finish checking whether an RBAC Group in the request grants owner access, so it made no change. Retrying the same request will not help. Make the change in the organization's admin settings in Claude. */
interface RBACGroupOwnerAccessUnconfirmedErrorDetails {
  error_code: "rbac_group_owner_access_unconfirmed";
}
```
