Skip to content
Primary navigation

List project groups

admin.organization.projects.groups.list(strproject_id, GroupListParams**kwargs) -> SyncNextCursorPage[ProjectGroup]
GET/organization/projects/{project_id}/groups

Lists the groups that have access to a project.

ParametersExpand Collapse
project_id: str
after: Optional[str]

Cursor for pagination. Provide the ID of the last group from the previous response to fetch the next page.

limit: Optional[int]

A limit on the number of project groups to return. Defaults to 20.

minimum0
maximum100
order: Optional[Literal["asc", "desc"]]

Sort order for the returned groups.

One of the following:
"asc"
"desc"
ReturnsExpand Collapse
class ProjectGroup: …

Details about a group’s membership in a project.

created_at: int

Unix timestamp (in seconds) when the group was granted project access.

formatunixtime
group_id: str

Identifier of the group that has access to the project.

group_name: str

Display name of the group.

group_type: str

The type of the group.

object: Literal["project.group"]

Always project.group.

project_id: str

Identifier of the project.

List project groups

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.groups.list(
    project_id="project_id",
)
page = page.data[0]
print(page.group_id)
{
    "object": "list",
    "data": [
        {
            "object": "project.group",
            "project_id": "proj_abc123",
            "group_id": "group_01J1F8ABCDXYZ",
            "group_name": "Support Team",
            "created_at": 1711471533
        }
    ],
    "has_more": false,
    "next": null
}
Returns Examples
{
    "object": "list",
    "data": [
        {
            "object": "project.group",
            "project_id": "proj_abc123",
            "group_id": "group_01J1F8ABCDXYZ",
            "group_name": "Support Team",
            "created_at": 1711471533
        }
    ],
    "has_more": false,
    "next": null
}