Skip to content
Primary navigation

Groups

List groups
admin.organization.groups.list(GroupListParams**kwargs) -> SyncNextCursorPage[Group]
GET/organization/groups
Create group
admin.organization.groups.create(GroupCreateParams**kwargs) -> Group
POST/organization/groups
Retrieve group
admin.organization.groups.retrieve(strgroup_id) -> Group
GET/organization/groups/{group_id}
Update group
admin.organization.groups.update(strgroup_id, GroupUpdateParams**kwargs) -> GroupUpdateResponse
POST/organization/groups/{group_id}
Delete group
admin.organization.groups.delete(strgroup_id) -> GroupDeleteResponse
DELETE/organization/groups/{group_id}
ModelsExpand 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: Literal["group", "tenant_group"]

The type of the group.

One of the following:
"group"
"tenant_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.

class GroupUpdateResponse:

Response returned after updating a group.

id: str

Identifier for the group.

created_at: int

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: str

Updated display name for the group.

class GroupDeleteResponse:

Confirmation payload returned after deleting a group.

id: str

Identifier of the deleted group.

deleted: bool

Whether the group was deleted.

object: Literal["group.deleted"]

Always group.deleted.

GroupsUsers

List group users
admin.organization.groups.users.list(strgroup_id, UserListParams**kwargs) -> SyncNextCursorPage[OrganizationGroupUser]
GET/organization/groups/{group_id}/users
Add group user
admin.organization.groups.users.create(strgroup_id, UserCreateParams**kwargs) -> UserCreateResponse
POST/organization/groups/{group_id}/users
Retrieve group user
admin.organization.groups.users.retrieve(struser_id, UserRetrieveParams**kwargs) -> UserRetrieveResponse
GET/organization/groups/{group_id}/users/{user_id}
Remove group user
admin.organization.groups.users.delete(struser_id, UserDeleteParams**kwargs) -> UserDeleteResponse
DELETE/organization/groups/{group_id}/users/{user_id}
ModelsExpand Collapse
class OrganizationGroupUser:

Represents an individual user returned when inspecting group membership.

id: str

The identifier, which can be referenced in API endpoints

email: Optional[str]

The email address of the user.

name: str

The name of the user.

class UserCreateResponse:

Confirmation payload returned after adding a user to a group.

group_id: str

Identifier of the group the user was added to.

object: Literal["group.user"]

Always group.user.

user_id: str

Identifier of the user that was added.

class UserRetrieveResponse:

Details about a user returned from an organization group membership lookup.

id: str

Identifier for the user.

email: Optional[str]

Email address of the user, or null for users without an email.

is_service_account: Optional[bool]

Whether the user is a service account.

name: str

Display name of the user.

picture: Optional[str]

URL of the user’s profile picture, if available.

user_type: Literal["user", "tenant_user"]

The type of user.

One of the following:
"user"
"tenant_user"
class UserDeleteResponse:

Confirmation payload returned after removing a user from a group.

deleted: bool

Whether the group membership was removed.

object: Literal["group.user.deleted"]

Always group.user.deleted.

GroupsRoles

List group organization role assignments
admin.organization.groups.roles.list(strgroup_id, RoleListParams**kwargs) -> SyncNextCursorPage[RoleListResponse]
GET/organization/groups/{group_id}/roles
Assign organization role to group
admin.organization.groups.roles.create(strgroup_id, RoleCreateParams**kwargs) -> RoleCreateResponse
POST/organization/groups/{group_id}/roles
Retrieve group organization role
admin.organization.groups.roles.retrieve(strrole_id, RoleRetrieveParams**kwargs) -> RoleRetrieveResponse
GET/organization/groups/{group_id}/roles/{role_id}
Unassign organization role from group
admin.organization.groups.roles.delete(strrole_id, RoleDeleteParams**kwargs) -> RoleDeleteResponse
DELETE/organization/groups/{group_id}/roles/{role_id}
ModelsExpand Collapse
class RoleListResponse:

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

id: str

Identifier for the role.

assignment_sources: Optional[List[AssignmentSource]]

Principals from which the role assignment is inherited, when available.

principal_id: str
principal_type: str
created_at: Optional[int]

When the role was created.

formatunixtime
created_by: Optional[str]

Identifier of the actor who created the role.

created_by_user_obj: Optional[Dict[str, object]]

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

description: Optional[str]

Description of the role.

metadata: Optional[Dict[str, object]]

Arbitrary metadata stored on the role.

name: str

Name of the role.

permissions: List[str]

Permissions associated with the role.

predefined_role: bool

Whether the role is predefined by OpenAI.

resource_type: str

Resource type the role applies to.

updated_at: Optional[int]

When the role was last updated.

formatunixtime
class RoleCreateResponse:

Role assignment linking a group to a role.

group: Group

Summary information about a group returned in role assignment responses.

id: str

Identifier for the group.

created_at: int

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

formatunixtime
name: str

Display name of the group.

object: Literal["group"]

Always group.

scim_managed: bool

Whether the group is managed through SCIM.

object: Literal["group.role"]

Always group.role.

role: Role

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

class RoleRetrieveResponse:

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

id: str

Identifier for the role.

assignment_sources: Optional[List[AssignmentSource]]

Principals from which the role assignment is inherited, when available.

principal_id: str
principal_type: str
created_at: Optional[int]

When the role was created.

formatunixtime
created_by: Optional[str]

Identifier of the actor who created the role.

created_by_user_obj: Optional[Dict[str, object]]

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

description: Optional[str]

Description of the role.

metadata: Optional[Dict[str, object]]

Arbitrary metadata stored on the role.

name: str

Name of the role.

permissions: List[str]

Permissions associated with the role.

predefined_role: bool

Whether the role is predefined by OpenAI.

resource_type: str

Resource type the role applies to.

updated_at: Optional[int]

When the role was last updated.

formatunixtime
class RoleDeleteResponse:

Confirmation payload returned after unassigning a role.

deleted: bool

Whether the assignment was removed.

object: str

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