Claude Platform Docs

Get User

client.Beta.Organization.Users.Get(ctx, userID) (*BetaOrganizationUser, error)
GET/v1/organizations/users/{user_id}

Retrieve a member of the organization by user ID.

Parameters
userID string

ID of the User.

Returns
type BetaOrganizationUser struct{…}

Get User

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"),
	)
	betaOrganizationUser, err := client.Beta.Organization.Users.Get(context.TODO(), "user_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaOrganizationUser.ID)
}
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "added_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "name": "Jane Doe",
  "role": "admin",
  "type": "user"
}
Returns Examples
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "added_at": "2024-10-30T23:58:27.427722Z",
  "email": "user@emaildomain.com",
  "name": "Jane Doe",
  "role": "admin",
  "type": "user"
}