Skip to content
Primary navigation

Groups

List groups
client.admin.organization.groups.list(GroupListParams { after, limit, order } query?, RequestOptionsoptions?): NextCursorPage<Group { id, created_at, group_type, 2 more } >
GET/organization/groups
Create group
client.admin.organization.groups.create(GroupCreateParams { name } body, RequestOptionsoptions?): Group { id, created_at, group_type, 2 more }
POST/organization/groups
Update group
client.admin.organization.groups.update(stringgroupID, GroupUpdateParams { name } body, RequestOptionsoptions?): GroupUpdateResponse { id, created_at, is_scim_managed, name }
POST/organization/groups/{group_id}
Delete group
client.admin.organization.groups.delete(stringgroupID, RequestOptionsoptions?): GroupDeleteResponse { id, deleted, object }
DELETE/organization/groups/{group_id}
ModelsExpand Collapse
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: string

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.

GroupUpdateResponse { id, created_at, is_scim_managed, name }

Response returned after updating a group.

id: string

Identifier for the group.

created_at: number

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

formatunixtime
is_scim_managed: boolean

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

name: string

Updated display name for the group.

GroupDeleteResponse { id, deleted, object }

Confirmation payload returned after deleting a group.

id: string

Identifier of the deleted group.

deleted: boolean

Whether the group was deleted.

object: "group.deleted"

Always group.deleted.

GroupsUsers

List group users
client.admin.organization.groups.users.list(stringgroupID, UserListParams { after, limit, order } query?, RequestOptionsoptions?): NextCursorPage<OrganizationGroupUser { id, email, name } >
GET/organization/groups/{group_id}/users
Add group user
client.admin.organization.groups.users.create(stringgroupID, UserCreateParams { user_id } body, RequestOptionsoptions?): UserCreateResponse { group_id, object, user_id }
POST/organization/groups/{group_id}/users
Remove group user
client.admin.organization.groups.users.delete(stringuserID, UserDeleteParams { group_id } params, RequestOptionsoptions?): UserDeleteResponse { deleted, object }
DELETE/organization/groups/{group_id}/users/{user_id}
ModelsExpand Collapse
OrganizationGroupUser { id, email, name }

Represents an individual user returned when inspecting group membership.

id: string

The identifier, which can be referenced in API endpoints

email: string | null

The email address of the user.

name: string

The name of the user.

UserCreateResponse { group_id, object, user_id }

Confirmation payload returned after adding a user to a group.

group_id: string

Identifier of the group the user was added to.

object: "group.user"

Always group.user.

user_id: string

Identifier of the user that was added.

UserDeleteResponse { deleted, object }

Confirmation payload returned after removing a user from a group.

deleted: boolean

Whether the group membership was removed.

object: "group.user.deleted"

Always group.user.deleted.

GroupsRoles

List group organization role assignments
client.admin.organization.groups.roles.list(stringgroupID, RoleListParams { after, limit, order } query?, RequestOptionsoptions?): NextCursorPage<RoleListResponse { id, created_at, created_by, 8 more } >
GET/organization/groups/{group_id}/roles
Assign organization role to group
client.admin.organization.groups.roles.create(stringgroupID, RoleCreateParams { role_id } body, RequestOptionsoptions?): RoleCreateResponse { group, object, role }
POST/organization/groups/{group_id}/roles
Unassign organization role from group
client.admin.organization.groups.roles.delete(stringroleID, RoleDeleteParams { group_id } params, RequestOptionsoptions?): RoleDeleteResponse { deleted, object }
DELETE/organization/groups/{group_id}/roles/{role_id}
ModelsExpand Collapse
RoleListResponse { id, created_at, created_by, 8 more }

Detailed information about a role assignment entry returned when listing assignments.

id: string

Identifier for the role.

created_at: number | null

When the role was created.

formatunixtime
created_by: string | null

Identifier of the actor who created the role.

created_by_user_obj: Record<string, unknown> | null

User details for the actor that created the role, when available.

description: string | null

Description of the role.

metadata: Record<string, unknown> | null

Arbitrary metadata stored on the role.

name: string

Name of the role.

permissions: Array<string>

Permissions associated with the role.

predefined_role: boolean

Whether the role is predefined by OpenAI.

resource_type: string

Resource type the role applies to.

updated_at: number | null

When the role was last updated.

formatint64
RoleCreateResponse { group, object, role }

Role assignment linking a group to a role.

group: Group { id, created_at, name, 2 more }

Summary information about a group returned in role assignment responses.

id: string

Identifier for the group.

created_at: number

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

formatunixtime
name: string

Display name of the group.

object: "group"

Always group.

scim_managed: boolean

Whether the group is managed through SCIM.

object: "group.role"

Always group.role.

role: Role { id, description, name, 4 more }

Details about a role that can be assigned through the public Roles API.

RoleDeleteResponse { deleted, object }

Confirmation payload returned after unassigning a role.

deleted: boolean

Whether the assignment was removed.

object: string

Identifier for the deleted assignment, such as group.role.deleted or user.role.deleted.