Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Create group

client.admin.organization.groups.create(body, options?): Group { id, created_at, group_type, 2 more }
POST
/organization/groups

Creates a new group in the organization.

Parameters
body: GroupCreateParams { name }
name: string

Human readable name for the group.

minLength1
maxLength255
Returns
Group { id, created_at, group_type, 2 more }

Details about an organization group.

id: string

Identifier for the group.

created_at: number

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

formatunixtime
group_type: "group" | "tenant_group"

The type of the group.

is_scim_managed: boolean

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

name: string

Display name of the group.

Create group

import OpenAI from 'openai';

const client = new OpenAI({
  adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});

const group = await client.admin.organization.groups.create({ name: 'x' });

console.log(group.id);
{
    "object": "group",
    "id": "group_01J1F8ABCDXYZ",
    "name": "Support Team",
    "created_at": 1711471533,
    "group_type": "group",
    "is_scim_managed": false
}
Returns Examples
{
    "object": "group",
    "id": "group_01J1F8ABCDXYZ",
    "name": "Support Team",
    "created_at": 1711471533,
    "group_type": "group",
    "is_scim_managed": false
}