Skip to content
Primary navigation

Retrieve user

admin.organization.users.retrieve(user_id) -> OrganizationUser { id, added_at, object, 13 more }
GET/organization/users/{user_id}

Retrieves a user by their identifier.

ParametersExpand Collapse
user_id: String
ReturnsExpand Collapse
class OrganizationUser { id, added_at, object, 13 more }

Represents an individual user within an organization.

id: String

The identifier, which can be referenced in API endpoints

added_at: Integer

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

formatunixtime
object: :"organization.user"

The object type, which is always organization.user

api_key_last_used_at: Integer

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

formatunixtime
created: Integer

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

formatunixtime
developer_persona: String

The developer persona metadata for the user.

email: String

The email address of the user

is_default: bool

Whether this is the organization’s default user.

is_scale_tier_authorized_purchaser: bool

Whether the user is an authorized purchaser for Scale Tier.

is_scim_managed: bool

Whether the user is managed through SCIM.

is_service_account: bool

Whether the user is a service account.

name: String

The name of the user

projects: Projects{ data, object}

Projects associated with the user, if included.

data: Array[Data{ id, name, role}]
id: String
name: String
role: String
object: :list
role: String

owner or reader

technical_level: String

The technical level metadata for the user.

user: User{ id, object, banned, 5 more}

Nested user details.

id: String
object: :user
banned: bool
banned_at: Integer
formatunixtime
email: String
enabled: bool
name: String
picture: String

Retrieve user

require "openai"

openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

organization_user = openai.admin.organization.users.retrieve("user_id")

puts(organization_user)
{
    "object": "organization.user",
    "id": "user_abc",
    "name": "First Last",
    "email": "user@example.com",
    "role": "owner",
    "added_at": 1711471533
}
Returns Examples
{
    "object": "organization.user",
    "id": "user_abc",
    "name": "First Last",
    "email": "user@example.com",
    "role": "owner",
    "added_at": 1711471533
}