List project roles
GET/projects/{project_id}/roles
Lists the roles configured for a project.
Path Parameters
project_id: string
Query Parameters
after: optional string
Cursor for pagination. Provide the value from the previous response's next field to continue listing roles.
limit: optional number
A limit on the number of roles to return. Defaults to 1000.
minimum0
maximum1000
Returns
has_more: boolean
Whether more roles are available when paginating.
next: string
Cursor to fetch the next page of results, or null when there are no additional roles.
object: "list"
Always list.
List project roles
curl https://api.openai.com/v1/projects/proj_abc123/roles?limit=20 \
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
-H "Content-Type: application/json"
{
"object": "list",
"data": [
{
"object": "role",
"id": "role_01J1F8PROJ",
"name": "API Project Key Manager",
"description": "Allows managing API keys for the project",
"permissions": [
"api.organization.projects.api_keys.read",
"api.organization.projects.api_keys.write"
],
"resource_type": "api.project",
"predefined_role": false
}
],
"has_more": false,
"next": null
}
Returns Examples
{
"object": "list",
"data": [
{
"object": "role",
"id": "role_01J1F8PROJ",
"name": "API Project Key Manager",
"description": "Allows managing API keys for the project",
"permissions": [
"api.organization.projects.api_keys.read",
"api.organization.projects.api_keys.write"
],
"resource_type": "api.project",
"predefined_role": false
}
],
"has_more": false,
"next": null
}