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
Theme

Create group

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

Creates a new group in the organization.

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)
Response example
{
    "object": "group",
    "id": "group_01J1F8ABCDXYZ",
    "name": "Support Team",
    "created_at": 1711471533,
    "group_type": "group",
    "is_scim_managed": false
}
Parameters
name: str

Human readable name for the group.

minLength1
maxLength255
Returns
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: Literal["group", "tenant_group"]

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.

Returns Examples
Response example
{
    "object": "group",
    "id": "group_01J1F8ABCDXYZ",
    "name": "Support Team",
    "created_at": 1711471533,
    "group_type": "group",
    "is_scim_managed": false
}