Claude Platform Docs

添加 RBAC 组成员

BetaRbacGroupMember Beta.Organization.RbacGroups.Members.Add(parameters, cancellationToken = default)
POST/v1/organizations/rbac_groups/{rbac_group_id}/members

将用户添加到 RBAC 组。当租户中的某个组织使用 SCIM 预配时,由身份提供商预配的组(来源类型为 "scim")的成员资格无法通过 API 修改。

RBAC Groups API 仅适用于 Claude Enterprise 组织。

Parameters
MemberAddParams parameters
required string rbacGroupID⁠Path parameter

ID of the RBAC Group.

required string userID

ID of the User.

Returns
class BetaRbacGroupMember { Type = "rbac_group_member"; CreatedAt; Email; /* 2 more */ }
JsonElement Type = "rbac_group_member"

Object type.

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

required DateTimeOffset CreatedAt

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

formatdate-time
required string Email

Email of the User.

required string RbacGroupID

ID of the RBAC Group.

required string UserID

ID of the User.

添加 RBAC 组成员
using System;
using Anthropic.Models.Beta.Organization.RbacGroups.Members;

MemberAddParams parameters = new()
{
    RbacGroupID = "rbac_group_id",
    UserID = "user_01WxYzAbCdEfGhJkMnPqRsTu",
};

var betaRbacGroupMember = await client.Beta.Organization.RbacGroups.Members.Add(parameters);

Console.WriteLine(betaRbacGroupMember);
Returns Examples
Response 200
{
  "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"
}