Skip to content
Primary navigation

Delete group

client.Admin.Organization.Groups.Delete(ctx, groupID) (*AdminOrganizationGroupDeleteResponse, error)
DELETE/organization/groups/{group_id}

Deletes a group from the organization.

ParametersExpand Collapse
groupID string
ReturnsExpand Collapse
type AdminOrganizationGroupDeleteResponse struct{…}

Confirmation payload returned after deleting a group.

ID string

Identifier of the deleted group.

Deleted bool

Whether the group was deleted.

Object GroupDeleted

Always group.deleted.

Delete group

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"),
  )
  group, err := client.Admin.Organization.Groups.Delete(context.TODO(), "group_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", group.ID)
}
{
    "object": "group.deleted",
    "id": "group_01J1F8ABCDXYZ",
    "deleted": true
}
Returns Examples
{
    "object": "group.deleted",
    "id": "group_01J1F8ABCDXYZ",
    "deleted": true
}