Claude Platform Docs

Dapatkan Peran RBAC

client.Beta.Organization.RBACRoles.Get(ctx, rbacRoleID) (*BetaRBACRole, error)
GET/v1/organizations/rbac_roles/{rbac_role_id}

Ambil Peran RBAC berdasarkan ID.

API Peran RBAC hanya tersedia untuk organisasi Claude Enterprise.

Parameters
rbacRoleID string⁠Path parameter

ID of the RBAC Role.

Returns
type BetaRBACRole struct { Type: "rbac_role"; ID; CreatedAt; /* 3 more */ }
Type RBACRole

Object type.

For RBAC Roles, this is always "rbac_role".

defaultrbac_role
ID string

ID of the RBAC Role.

CreatedAt Time

RFC 3339 datetime string indicating when the RBAC Role was created.

formatdate-time
DisplayName string

Name of the RBAC Role. For a role created by Anthropic, this name can differ from the label claude.ai shows, and Anthropic may change the name. To keep a lasting reference to a role, store its id.

UpdatedAt Time

RFC 3339 datetime string indicating when the RBAC Role was last updated.

formatdate-time
Name string⁠Deprecated

Deprecated: use display_name instead. Name of the RBAC Role; always the same value as display_name.

Use `display_name` instead; `name` always has the same value.
Dapatkan Peran RBAC
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	betaRBACRole, err := client.Beta.Organization.RBACRoles.Get(context.TODO(), "rbac_role_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaRBACRole.ID)
}
Returns Examples
Response 200
{
  "id": "rbac_role_016J8xVtKpDq3Wy9ZmN2hR4s",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "display_name": "Project Editor",
  "name": "Project Editor",
  "type": "rbac_role",
  "updated_at": "2024-10-30T23:58:27.427722Z"
}