Claude Platform Docs

Remove User

client.Beta.Organization.Users.Remove(ctx, userID) (*BetaOrganizationUserRemoveResponse, error)
DELETE/v1/organizations/users/{user_id}

Remove a member from the organization.

Parameters
userID string

ID of the User.

Returns
type BetaOrganizationUserRemoveResponse struct{…}
ID string

ID of the User.

Type UserDeleted

Deleted object type.

For Users, this is always "user_deleted".

defaultuser_deleted

Remove 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"),
	)
	user, err := client.Beta.Organization.Users.Remove(context.TODO(), "user_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", user.ID)
}
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "type": "user_deleted"
}
Returns Examples
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "type": "user_deleted"
}