Claude Platform Docs

移除使用者

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

從組織中移除成員。

Parameters
userID string⁠Path parameter

ID of the User.

Returns
type BetaOrganizationUserRemoveResponse struct { Type: "user_deleted"; ID }
Type UserDeleted

Deleted object type.

For Users, this is always "user_deleted".

defaultuser_deleted
ID string

ID of the 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)
}
Returns Examples
Response 200
{
  "id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
  "type": "user_deleted"
}