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

# RBAC Groups

## Create RBAC Group

`$client->beta->organization->rbacGroups->create(string name): RBACGroup`

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

### Parameters

- `name: string`

  Name of the RBAC Group. Not uniqueness-enforced.

### Returns

- `class RBACGroup`

  - `"rbac_group" type`

    Object type.

    For RBAC Groups, this is always `"rbac_group"`.

  - `string id`

    ID of the RBAC Group.

  - `\Datetime createdAt`

    RFC 3339 timestamp of when the RBAC Group was created.

  - `string name`

    Name of the RBAC Group. Not uniqueness-enforced.

  - `?list<string> roleIDs`

    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.

  - `SourceType sourceType`

    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.

  - `\Datetime updatedAt`

    RFC 3339 timestamp of when the RBAC Group was last updated.

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaRBACGroup = $client->beta->organization->rbacGroups->create(
  name: 'Engineering'
);

var_dump($betaRBACGroup);
```

#### 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"
}
```

## List RBAC Groups

`$client->beta->organization->rbacGroups->list(?int limit, ?string page): PageCursor<RBACGroup>`

**GET** `/v1/organizations/rbac_groups`

List RBAC Groups in the Claude Enterprise tenant.

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

### Parameters

- `limit?:optional int` (query parameter)

  Number of items to return per page.

  Defaults to `20`. Ranges from `1` to `1000`.

  default: 20

- `page?:optional string` (query parameter)

  Optionally set to the `next_page` token from the previous response.

### Returns

- `class RBACGroup`

  - `"rbac_group" type`

    Object type.

    For RBAC Groups, this is always `"rbac_group"`.

  - `string id`

    ID of the RBAC Group.

  - `\Datetime createdAt`

    RFC 3339 timestamp of when the RBAC Group was created.

  - `string name`

    Name of the RBAC Group. Not uniqueness-enforced.

  - `?list<string> roleIDs`

    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.

  - `SourceType sourceType`

    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.

  - `\Datetime updatedAt`

    RFC 3339 timestamp of when the RBAC Group was last updated.

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

$page = $client->beta->organization->rbacGroups->list(
  limit: 1, page: 'eyJjdXJzb3IiOiAicmJhY19ncm91cF8wMSJ9'
);

var_dump($page);
```

#### 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"
}
```

## Get RBAC Group

`$client->beta->organization->rbacGroups->retrieve(string rbacGroupID): RBACGroup`

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

### Parameters

- `rbacGroupID: string` (path parameter)

  ID of the RBAC Group.

### Returns

- `class RBACGroup`

  - `"rbac_group" type`

    Object type.

    For RBAC Groups, this is always `"rbac_group"`.

  - `string id`

    ID of the RBAC Group.

  - `\Datetime createdAt`

    RFC 3339 timestamp of when the RBAC Group was created.

  - `string name`

    Name of the RBAC Group. Not uniqueness-enforced.

  - `?list<string> roleIDs`

    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.

  - `SourceType sourceType`

    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.

  - `\Datetime updatedAt`

    RFC 3339 timestamp of when the RBAC Group was last updated.

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaRBACGroup = $client->beta->organization->rbacGroups->retrieve(
  'rbac_group_id'
);

var_dump($betaRBACGroup);
```

#### 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"
}
```

## Update RBAC Group

`$client->beta->organization->rbacGroups->update(string rbacGroupID, ?string name): RBACGroup`

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

### Parameters

- `rbacGroupID: string` (path parameter)

  ID of the RBAC Group.

- `name?:optional string`

  Name of the RBAC Group. Not uniqueness-enforced.

### Returns

- `class RBACGroup`

  - `"rbac_group" type`

    Object type.

    For RBAC Groups, this is always `"rbac_group"`.

  - `string id`

    ID of the RBAC Group.

  - `\Datetime createdAt`

    RFC 3339 timestamp of when the RBAC Group was created.

  - `string name`

    Name of the RBAC Group. Not uniqueness-enforced.

  - `?list<string> roleIDs`

    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.

  - `SourceType sourceType`

    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.

  - `\Datetime updatedAt`

    RFC 3339 timestamp of when the RBAC Group was last updated.

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaRBACGroup = $client->beta->organization->rbacGroups->update(
  'rbac_group_id', name: 'Engineering'
);

var_dump($betaRBACGroup);
```

#### 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"
}
```

## Delete RBAC Group

`$client->beta->organization->rbacGroups->delete(string rbacGroupID): RBACGroupDeleteResponse`

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

### Parameters

- `rbacGroupID: string` (path parameter)

  ID of the RBAC Group.

### Returns

- `class RBACGroupDeleteResponse`

  - `"rbac_group_deleted" type`

    Deleted object type.

    For RBAC Groups, this is always `"rbac_group_deleted"`.

  - `string id`

    ID of the RBAC Group.

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

$rbacGroup = $client->beta->organization->rbacGroups->delete('rbac_group_id');

var_dump($rbacGroup);
```

#### Response (200)

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

## Domain types

### Beta RBAC Group

- `class RBACGroup`

  - `"rbac_group" type`

    Object type.

    For RBAC Groups, this is always `"rbac_group"`.

  - `string id`

    ID of the RBAC Group.

  - `\Datetime createdAt`

    RFC 3339 timestamp of when the RBAC Group was created.

  - `string name`

    Name of the RBAC Group. Not uniqueness-enforced.

  - `?list<string> roleIDs`

    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.

  - `SourceType sourceType`

    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.

  - `\Datetime updatedAt`

    RFC 3339 timestamp of when the RBAC Group was last updated.

## RBAC Groups › Members

### List RBAC Group Members

`$client->beta->organization->rbacGroups->members->list(string rbacGroupID, ?int limit, ?string page): PageCursor<BetaRBACGroupMember>`

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

#### Parameters

- `rbacGroupID: string` (path parameter)

  ID of the RBAC Group.

- `limit?:optional int` (query parameter)

  Number of items to return per page.

  Defaults to `20`. Ranges from `1` to `1000`.

  default: 20

- `page?:optional string` (query parameter)

  Optionally set to the `next_page` token from the previous response.

#### Returns

- `class BetaRBACGroupMember`

  - `"rbac_group_member" type`

    Object type.

    For RBAC Group Members, this is always `"rbac_group_member"`.

  - `\Datetime createdAt`

    RFC 3339 timestamp of when the User was added to the RBAC Group.

  - `string email`

    Email of the User.

  - `string rbacGroupID`

    ID of the RBAC Group.

  - `string userID`

    ID of the User.

#### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

$page = $client->beta->organization->rbacGroups->members->list(
  'rbac_group_id', limit: 1, page: 'eyJjdXJzb3IiOiAicmJhY19ncm91cF8wMSJ9'
);

var_dump($page);
```

##### 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_01WCz1FkmYMm4gnmykNKUu3Q"
    }
  ],
  "has_more": false,
  "next_page": "eyJjdXJzb3IiOiAicmJhY19ncm91cF8wMSJ9"
}
```

### Add RBAC Group Member

`$client->beta->organization->rbacGroups->members->add(string rbacGroupID, string userID): BetaRBACGroupMember`

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

#### Parameters

- `rbacGroupID: string` (path parameter)

  ID of the RBAC Group.

- `userID: string`

  ID of the User.

#### Returns

- `class BetaRBACGroupMember`

  - `"rbac_group_member" type`

    Object type.

    For RBAC Group Members, this is always `"rbac_group_member"`.

  - `\Datetime createdAt`

    RFC 3339 timestamp of when the User was added to the RBAC Group.

  - `string email`

    Email of the User.

  - `string rbacGroupID`

    ID of the RBAC Group.

  - `string userID`

    ID of the User.

#### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaRBACGroupMember = $client->beta->organization->rbacGroups->members->add(
  'rbac_group_id', userID: 'user_01WCz1FkmYMm4gnmykNKUu3Q'
);

var_dump($betaRBACGroupMember);
```

##### 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_01WCz1FkmYMm4gnmykNKUu3Q"
}
```

### Remove RBAC Group Member

`$client->beta->organization->rbacGroups->members->remove(string userID, string rbacGroupID): MemberRemoveResponse`

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

#### Parameters

- `rbacGroupID: string` (path parameter)

  ID of the RBAC Group.

- `userID: string` (path parameter)

  ID of the User.

#### Returns

- `class MemberRemoveResponse`

  - `"rbac_group_member_deleted" type`

    Deleted object type. For RBAC Group Members, this is always `"rbac_group_member_deleted"`.

  - `string rbacGroupID`

    ID of the RBAC Group.

  - `string userID`

    ID of the User.

#### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;

$client = new Client(apiKey: 'my-anthropic-api-key');

$member = $client->beta->organization->rbacGroups->members->remove(
  'user_id', rbacGroupID: 'rbac_group_id'
);

var_dump($member);
```

##### Response (200)

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