Skip to content
Primary navigation

Retrieve group

client.Admin.Organization.Groups.Get(ctx, groupID) (*Group, error)
GET/organization/groups/{group_id}

Retrieves a group.

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

Details about an organization group.

ID string

Identifier for the group.

CreatedAt int64

Unix timestamp (in seconds) when the group was created.

formatunixtime
GroupType GroupGroupType

The type of the group.

One of the following:
const GroupGroupTypeGroup GroupGroupType = "group"
const GroupGroupTypeTenantGroup GroupGroupType = "tenant_group"
IsScimManaged bool

Whether the group is managed through SCIM and controlled by your identity provider.

Name string

Display name of the group.

Retrieve 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.Get(context.TODO(), "group_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", group.ID)
}
{
    "id": "group_01J1F8ABCDXYZ",
    "name": "Support Team",
    "created_at": 1711471533,
    "is_scim_managed": false,
    "group_type": "group"
}
Returns Examples
{
    "id": "group_01J1F8ABCDXYZ",
    "name": "Support Team",
    "created_at": 1711471533,
    "is_scim_managed": false,
    "group_type": "group"
}