Skip to content
Primary navigation

Retrieve project user

client.admin.organization.projects.users.retrieve(stringuserID, UserRetrieveParams { project_id } params, RequestOptionsoptions?): ProjectUser { id, added_at, object, 3 more }
GET/organization/projects/{project_id}/users/{user_id}

Retrieves a user in the project.

ParametersExpand Collapse
userID: string
params: UserRetrieveParams { project_id }
project_id: string

The ID of the project.

ReturnsExpand Collapse
ProjectUser { id, added_at, object, 3 more }

Represents an individual user in a project.

id: string

The identifier, which can be referenced in API endpoints

added_at: number

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

formatunixtime
object: "organization.project.user"

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

role: string

owner or member

email?: string | null

The email address of the user

name?: string | null

The name of the user

Retrieve project user

import OpenAI from 'openai';

const client = new OpenAI({
  adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});

const projectUser = await client.admin.organization.projects.users.retrieve('user_id', {
  project_id: 'project_id',
});

console.log(projectUser.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
}