Claude Platform Docs

List Users

client.Beta.Organization.Users.List(ctx, query) (*Page[BetaOrganizationUser], error)
GET/v1/organizations/users

List the organization's members.

Parameters
query BetaOrganizationUserListParams
AfterID param.Field[string] Optional

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

BeforeID param.Field[string] Optional

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

Email param.Field[string] Optional

Filter by user email.

formatemail
Limit param.Field[int64] Optional

Number of items to return per page.

Defaults to 20. Ranges from 1 to 1000.

maximum1000
minimum1
Roles param.Field[[]string] Optional

Filter to items whose role equals one of the supplied values. Repeatable; values are OR'ed together.

Accepted values depend on the organization type: Console and API organizations accept user, developer, billing, admin, and claude_code_user; Claude Enterprise organizations accept user, owner, primary_owner, membership_admin, and managed.

Returns
type BetaOrganizationUser struct{…}

List Users

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.Users.List(context.TODO(), anthropic.BetaOrganizationUserListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
{
  "data": [
    {
      "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
      "added_at": "2024-10-30T23:58:27.427722Z",
      "email": "user@emaildomain.com",
      "name": "Jane Doe",
      "role": "admin",
      "type": "user"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}
Returns Examples
{
  "data": [
    {
      "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
      "added_at": "2024-10-30T23:58:27.427722Z",
      "email": "user@emaildomain.com",
      "name": "Jane Doe",
      "role": "admin",
      "type": "user"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}