Delete user
client.Admin.Organization.Users.Delete(ctx, userID) (*AdminOrganizationUserDeleteResponse, error)
DELETE/organization/users/{user_id}
Delete user
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAdminAPIKey("My Admin API Key"),
)
user, err := client.Admin.Organization.Users.Delete(context.TODO(), "user_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", user.ID)
}
{
"object": "organization.user.deleted",
"id": "user_abc",
"deleted": true
}
Returns Examples
{
"object": "organization.user.deleted",
"id": "user_abc",
"deleted": true
}