Skip to content
Primary navigation

List project users

admin.organization.projects.users.list(strproject_id, UserListParams**kwargs) -> SyncConversationCursorPage[ProjectUser]
GET/organization/projects/{project_id}/users

Returns a list of users in the project.

ParametersExpand Collapse
project_id: str
after: Optional[str]

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

limit: Optional[int]

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

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

List project users

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
)
page = client.admin.organization.projects.users.list(
    project_id="project_id",
)
page = page.data[0]
print(page.id)
{
    "object": "list",
    "data": [
        {
            "object": "organization.project.user",
            "id": "user_abc",
            "name": "First Last",
            "email": "user@example.com",
            "role": "owner",
            "added_at": 1711471533
        }
    ],
    "first_id": "user-abc",
    "last_id": "user-xyz",
    "has_more": false
}
Returns Examples
{
    "object": "list",
    "data": [
        {
            "object": "organization.project.user",
            "id": "user_abc",
            "name": "First Last",
            "email": "user@example.com",
            "role": "owner",
            "added_at": 1711471533
        }
    ],
    "first_id": "user-abc",
    "last_id": "user-xyz",
    "has_more": false
}