Skip to content
Primary navigation

Update group

client.Admin.Organization.Groups.Update(ctx, groupID, body) (*AdminOrganizationGroupUpdateResponse, error)
POST/organization/groups/{group_id}

Updates a group’s information.

ParametersExpand Collapse
groupID string
body AdminOrganizationGroupUpdateParams
Name param.Field[string]

New display name for the group.

minLength1
maxLength255
ReturnsExpand Collapse
type AdminOrganizationGroupUpdateResponse struct{…}

Response returned after updating a group.

ID string

Identifier for the group.

CreatedAt int64

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

formatunixtime
IsScimManaged bool

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

Name string

Updated display name for the group.

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