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