Skip to content
Primary navigation

Groups

List groups
admin.organization.groups.list(**kwargs) -> NextCursorPage<Group { id, created_at, group_type, 2 more } >
GET/organization/groups
Create group
admin.organization.groups.create(**kwargs) -> Group { id, created_at, group_type, 2 more }
POST/organization/groups
Update group
admin.organization.groups.update(group_id, **kwargs) -> GroupUpdateResponse { id, created_at, is_scim_managed, name }
POST/organization/groups/{group_id}
Delete group
admin.organization.groups.delete(group_id) -> GroupDeleteResponse { id, deleted, object }
DELETE/organization/groups/{group_id}
ModelsExpand Collapse
class Group { id, created_at, group_type, 2 more }

Details about an organization group.

id: String

Identifier for the group.

created_at: Integer

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

formatunixtime
group_type: String

The type of the group.

is_scim_managed: bool

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

name: String

Display name of the group.

class GroupUpdateResponse { id, created_at, is_scim_managed, name }

Response returned after updating a group.

id: String

Identifier for the group.

created_at: Integer

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

formatunixtime
is_scim_managed: bool

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

name: String

Updated display name for the group.

class GroupDeleteResponse { id, deleted, object }

Confirmation payload returned after deleting a group.

id: String

Identifier of the deleted group.

deleted: bool

Whether the group was deleted.

object: :"group.deleted"

Always group.deleted.

GroupsUsers

List group users
admin.organization.groups.users.list(group_id, **kwargs) -> NextCursorPage<OrganizationGroupUser { id, email, name } >
GET/organization/groups/{group_id}/users
Add group user
admin.organization.groups.users.create(group_id, **kwargs) -> UserCreateResponse { group_id, object, user_id }
POST/organization/groups/{group_id}/users
Remove group user
admin.organization.groups.users.delete(user_id, **kwargs) -> UserDeleteResponse { deleted, object }
DELETE/organization/groups/{group_id}/users/{user_id}
ModelsExpand Collapse
class 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

The email address of the user.

name: String

The name of the user.

class 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.

class UserDeleteResponse { deleted, object }

Confirmation payload returned after removing a user from a group.

deleted: bool

Whether the group membership was removed.

object: :"group.user.deleted"

Always group.user.deleted.

GroupsRoles

List group organization role assignments
admin.organization.groups.roles.list(group_id, **kwargs) -> NextCursorPage<RoleListResponse { id, created_at, created_by, 8 more } >
GET/organization/groups/{group_id}/roles
Assign organization role to group
admin.organization.groups.roles.create(group_id, **kwargs) -> RoleCreateResponse { group, object, role }
POST/organization/groups/{group_id}/roles
Unassign organization role from group
admin.organization.groups.roles.delete(role_id, **kwargs) -> RoleDeleteResponse { deleted, object }
DELETE/organization/groups/{group_id}/roles/{role_id}
ModelsExpand Collapse
class 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: Integer

When the role was created.

formatunixtime
created_by: String

Identifier of the actor who created the role.

created_by_user_obj: Hash[Symbol, untyped]

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

description: String

Description of the role.

metadata: Hash[Symbol, untyped]

Arbitrary metadata stored on the role.

name: String

Name of the role.

permissions: Array[String]

Permissions associated with the role.

predefined_role: bool

Whether the role is predefined by OpenAI.

resource_type: String

Resource type the role applies to.

updated_at: Integer

When the role was last updated.

formatint64
class 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: Integer

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

formatunixtime
name: String

Display name of the group.

object: :group

Always group.

scim_managed: bool

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.

class RoleDeleteResponse { deleted, object }

Confirmation payload returned after unassigning a role.

deleted: bool

Whether the assignment was removed.

object: String

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