GET/projects/{project_id}/roles/{role_id}

Retrieve a project role

Retrieves a project role by its identifier. Use project_id and role_id to identify the project and role whose details you need.

2 parameters
project_idstringrequired
The ID of the project.
role_idstringrequired
The ID of the role to retrieve.

4 status codes
200Returns the project role's identifier, name, description, granted permissions, resource type, and predefined status.
objectstringrequired
Always `role`.
Allowed:role
idstringrequired
Identifier for the role.
namestringrequired
Unique name for the role.
descriptionstringrequired
Optional description of the role.
permissionsarray<string>required
Permissions granted by the role.
resource_typestringrequired
Resource type the role is bound to (for example `api.organization` or `api.project`).
predefined_rolebooleanrequired
Whether the role is predefined and managed by OpenAI.
403Returned when you do not have permission to perform this operation.
errorobjectrequired
Details about the permission error.
404Returned when the endpoint is unavailable or a requested resource is not found in the organization or project.
errorobjectrequired
429Returned when the request is rejected because a rate limit was exceeded.
errorobjectrequired

Error handling

A 403 is returned when you lack permission, a 404 is returned when the endpoint is unavailable or a requested resource is not found, and a 429 is returned when the rate limit is exceeded. The project_id path parameter and role_id path parameter must identify the project and role to retrieve.