Skip to content
Primary navigation

Create group

admin.organization.groups.create(GroupCreateParams**kwargs) -> Group
POST/organization/groups

Creates a new group in the organization.

ParametersExpand Collapse
name: str

Human readable name for the group.

minLength1
maxLength255
ReturnsExpand Collapse
class Group: …

Details about an organization group.

id: str

Identifier for the group.

created_at: int

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

formatunixtime
group_type: str

The type of the group.

is_scim_managed: bool

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

name: str

Display name of the group.

Create group

import os
from openai import OpenAI

client = OpenAI(
    admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"),  # This is the default and can be omitted
)
group = client.admin.organization.groups.create(
    name="x",
)
print(group.id)
{
    "object": "group",
    "id": "group_01J1F8ABCDXYZ",
    "name": "Support Team",
    "created_at": 1711471533,
    "is_scim_managed": false
}
Returns Examples
{
    "object": "group",
    "id": "group_01J1F8ABCDXYZ",
    "name": "Support Team",
    "created_at": 1711471533,
    "is_scim_managed": false
}