Skip to content
Primary navigation

Users

List users
admin.organization.users.list(UserListParams**kwargs) -> SyncConversationCursorPage[OrganizationUser]
GET/organization/users
Retrieve user
admin.organization.users.retrieve(struser_id) -> OrganizationUser
GET/organization/users/{user_id}
Modify user
admin.organization.users.update(struser_id, UserUpdateParams**kwargs) -> OrganizationUser
POST/organization/users/{user_id}
Delete user
admin.organization.users.delete(struser_id) -> UserDeleteResponse
DELETE/organization/users/{user_id}
ModelsExpand Collapse
class OrganizationUser:

Represents an individual user within an organization.

id: str

The identifier, which can be referenced in API endpoints

added_at: int

The Unix timestamp (in seconds) of when the user was added.

formatunixtime
object: Literal["organization.user"]

The object type, which is always organization.user

api_key_last_used_at: Optional[int]

The Unix timestamp (in seconds) of the user’s last API key usage.

formatunixtime
created: Optional[int]

The Unix timestamp (in seconds) of when the user was created.

formatunixtime
developer_persona: Optional[str]

The developer persona metadata for the user.

email: Optional[str]

The email address of the user

is_default: Optional[bool]

Whether this is the organization’s default user.

is_scale_tier_authorized_purchaser: Optional[bool]

Whether the user is an authorized purchaser for Scale Tier.

is_scim_managed: Optional[bool]

Whether the user is managed through SCIM.

is_service_account: Optional[bool]

Whether the user is a service account.

name: Optional[str]

The name of the user

projects: Optional[Projects]

Projects associated with the user, if included.

data: List[ProjectsData]
id: Optional[str]
name: Optional[str]
role: Optional[str]
object: Literal["list"]
role: Optional[str]

owner or reader

technical_level: Optional[str]

The technical level metadata for the user.

user: Optional[User]

Nested user details.

id: str
object: Literal["user"]
banned: Optional[bool]
banned_at: Optional[int]
formatunixtime
email: Optional[str]
enabled: Optional[bool]
name: Optional[str]
picture: Optional[str]
class UserDeleteResponse:
id: str
deleted: bool
object: Literal["organization.user.deleted"]

UsersRoles

List user organization role assignments
admin.organization.users.roles.list(struser_id, RoleListParams**kwargs) -> SyncNextCursorPage[RoleListResponse]
GET/organization/users/{user_id}/roles
Assign organization role to user
admin.organization.users.roles.create(struser_id, RoleCreateParams**kwargs) -> RoleCreateResponse
POST/organization/users/{user_id}/roles
Unassign organization role from user
admin.organization.users.roles.delete(strrole_id, RoleDeleteParams**kwargs) -> RoleDeleteResponse
DELETE/organization/users/{user_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.

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.

formatint64
class RoleCreateResponse:

Role assignment linking a user to a role.

object: Literal["user.role"]

Always user.role.

role: Role

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

Represents an individual user within an organization.

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.