Claude Platform Docs

Listar membros do workspace

client.Beta.Organization.Workspaces.Members.List(ctx, workspaceID, query) (*Page[BetaWorkspaceMember], error)
GET/v1/organizations/workspaces/{workspace_id}/members

Listar membros do workspace

Parameters
workspaceID string⁠Path parameter

ID of the Workspace.

query BetaOrganizationWorkspaceMemberListParams
AfterID param.Opt[string] OptionalQuery parameter

ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.

BeforeID param.Opt[string] OptionalQuery parameter

ID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.

Limit param.Opt[int64] OptionalQuery parameter

Number of items to return per page.

Defaults to 20. Ranges from 1 to 1000.

minimum1
maximum1000
Returns
type BetaWorkspaceMember struct { Type: "workspace_member"; UserID; WorkspaceID; WorkspaceRole }
Type WorkspaceMember

Object type.

For Workspace Members, this is always "workspace_member".

defaultworkspace_member
UserID string

ID of the User.

WorkspaceID string

ID of the Workspace.

WorkspaceRole BetaWorkspaceRole

Role of the Workspace Member.

One of the following:
const BetaWorkspaceRoleWorkspaceAdmin BetaWorkspaceRole = "workspace_admin"
const BetaWorkspaceRoleWorkspaceBilling BetaWorkspaceRole = "workspace_billing"
const BetaWorkspaceRoleWorkspaceDeveloper BetaWorkspaceRole = "workspace_developer"
const BetaWorkspaceRoleWorkspaceRestrictedDeveloper BetaWorkspaceRole = "workspace_restricted_developer"
const BetaWorkspaceRoleWorkspaceUser BetaWorkspaceRole = "workspace_user"
Listar membros do workspace
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"),
	)
	page, err := client.Beta.Organization.Workspaces.Members.List(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationWorkspaceMemberListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
Returns Examples
Response 200
{
  "data": [
    {
      "type": "workspace_member",
      "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
      "workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      "workspace_role": "workspace_admin"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}