# 组

## 列出合规组

**get** `/v1/compliance/groups`

列出合规组

### 查询参数

- `limit: optional number`

  最大结果数（默认值：500，最大值：1000）

- `name_prefix: optional string`

  按名称前缀筛选组

- `page: optional string`

  来自先前响应 `next_page` 字段的不透明分页令牌。传递此值以检索下一页结果。客户端应将此值视为不透明字符串，不要尝试解析或解释其内容，因为格式可能会在不另行通知的情况下更改。

### 请求头参数

- `"x-api-key": optional string`

### 返回值

- `data: array of object { id, created_at, description, 4 more }`

  组列表

  - `id: string`

    组标识符（标签 ID）

  - `created_at: string`

    组创建时间戳（ISO 8601）

  - `description: string`

    组描述

  - `name: string`

    组名称

  - `roles: array of string`

    分配给此组的角色 ID。

  - `source_type: string`

    组的创建方式（'direct' 或 'scim'）

  - `updated_at: string`

    组最后更新时间戳（ISO 8601）

- `has_more: boolean`

  是否存在更多记录超出当前结果集

- `next_page: string`

  用于检索下一页的令牌。在下一次请求中将此值用作 'page' 参数

### 示例

```http
curl https://api.anthropic.com/v1/compliance/groups \
    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"
```

#### 响应

```json
{
  "data": [
    {
      "id": "id",
      "created_at": "created_at",
      "description": "description",
      "name": "name",
      "roles": [
        "string"
      ],
      "source_type": "source_type",
      "updated_at": "updated_at"
    }
  ],
  "has_more": true,
  "next_page": "next_page"
}
```

## 获取合规组

**get** `/v1/compliance/groups/{group_id}`

获取合规组

### 路径参数

- `group_id: string`

  组 ID（标签 ID，例如 rbac_group_abc123）

### 请求头参数

- `"x-api-key": optional string`

### 返回值

- `id: string`

  组标识符（标签 ID）

- `created_at: string`

  组创建时间戳（ISO 8601）

- `description: string`

  组描述

- `name: string`

  组名称

- `roles: array of string`

  分配给此组的角色 ID。

- `source_type: string`

  组的创建方式（'direct' 或 'scim'）

- `updated_at: string`

  组最后更新时间戳（ISO 8601）

### 示例

```http
curl https://api.anthropic.com/v1/compliance/groups/$GROUP_ID \
    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"
```

#### 响应

```json
{
  "id": "id",
  "created_at": "created_at",
  "description": "description",
  "name": "name",
  "roles": [
    "string"
  ],
  "source_type": "source_type",
  "updated_at": "updated_at"
}
```

## 领域类型

### Group List Response

- `GroupListResponse object { id, created_at, description, 4 more }`

  用于合规响应的组信息。

  - `id: string`

    组标识符（标签 ID）

  - `created_at: string`

    组创建时间戳（ISO 8601）

  - `description: string`

    组描述

  - `name: string`

    组名称

  - `roles: array of string`

    分配给此组的角色 ID。

  - `source_type: string`

    组的创建方式（'direct' 或 'scim'）

  - `updated_at: string`

    组最后更新时间戳（ISO 8601）

### Group Retrieve Response

- `GroupRetrieveResponse object { id, created_at, description, 4 more }`

  用于合规响应的组信息。

  - `id: string`

    组标识符（标签 ID）

  - `created_at: string`

    组创建时间戳（ISO 8601）

  - `description: string`

    组描述

  - `name: string`

    组名称

  - `roles: array of string`

    分配给此组的角色 ID。

  - `source_type: string`

    组的创建方式（'direct' 或 'scim'）

  - `updated_at: string`

    组最后更新时间戳（ISO 8601）

# 成员

## 列出合规组成员

**get** `/v1/compliance/groups/{group_id}/members`

列出合规组成员

### 路径参数

- `group_id: string`

  组 ID（标签 ID，例如 rbac_group_abc123）

### 查询参数

- `limit: optional number`

  最大结果数（默认值：500，最大值：1000）

- `page: optional string`

  来自先前响应 `next_page` 字段的不透明分页令牌。传递此值以检索下一页结果。客户端应将此值视为不透明字符串，不要尝试解析或解释其内容，因为格式可能会在不另行通知的情况下更改。

### 请求头参数

- `"x-api-key": optional string`

### 返回值

- `data: array of object { created_at, email, updated_at, user_id }`

  组成员列表

  - `created_at: string`

    成员关系创建时间戳（ISO 8601）

  - `email: string`

    成员电子邮件地址

  - `updated_at: string`

    成员关系最后更新时间戳（ISO 8601）

  - `user_id: string`

    成员用户标识符（标签 ID）

- `has_more: boolean`

  是否存在更多记录超出当前结果集

- `next_page: string`

  用于检索下一页的令牌。在下一次请求中将此值用作 'page' 参数

### 示例

```http
curl https://api.anthropic.com/v1/compliance/groups/$GROUP_ID/members \
    -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"
```

#### 响应

```json
{
  "data": [
    {
      "created_at": "created_at",
      "email": "email",
      "updated_at": "updated_at",
      "user_id": "user_id"
    }
  ],
  "has_more": true,
  "next_page": "next_page"
}
```

## 领域类型

### Member List Response

- `MemberListResponse object { created_at, email, updated_at, user_id }`

  用于合规响应的组成员。

  - `created_at: string`

    成员关系创建时间戳（ISO 8601）

  - `email: string`

    成员电子邮件地址

  - `updated_at: string`

    成员关系最后更新时间戳（ISO 8601）

  - `user_id: string`

    成员用户标识符（标签 ID）
