Skip to content
Primary navigation

Retrieve project user

admin.organization.projects.users.retrieve(struser_id, UserRetrieveParams**kwargs) -> ProjectUser
GET/organization/projects/{project_id}/users/{user_id}

Retrieves a user in the project.

ParametersExpand Collapse
project_id: str
user_id: str
ReturnsExpand Collapse
class ProjectUser: …

Represents an individual user in a project.

id: str

The identifier, which can be referenced in API endpoints

added_at: int

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

formatunixtime
object: Literal["organization.project.user"]

The object type, which is always organization.project.user

role: str

owner or member

email: Optional[str]

The email address of the user

name: Optional[str]

The name of the user

Retrieve project user

import os
from openai import OpenAI

client = OpenAI(
    admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"),  # This is the default and can be omitted
)
project_user = client.admin.organization.projects.users.retrieve(
    user_id="user_id",
    project_id="project_id",
)
print(project_user.id)
{
    "object": "organization.project.user",
    "id": "user_abc",
    "name": "First Last",
    "email": "user@example.com",
    "role": "owner",
    "added_at": 1711471533
}
Returns Examples
{
    "object": "organization.project.user",
    "id": "user_abc",
    "name": "First Last",
    "email": "user@example.com",
    "role": "owner",
    "added_at": 1711471533
}