GET
/projects/{project_id}/users/{user_id}/roles/{role_id}Retrieve a project role assigned to a user
Retrieves a project role assigned to a user. Use project_id, user_id, and role_id to identify the role assignment and its project context.
project_idstringrequired
The unique identifier of the project to inspect.
user_idstringrequired
The unique identifier of the user whose role assignment to retrieve.
role_idstringrequired
The unique identifier of the project role assigned to the user.
200Returns role details, including its identifier, name, permissions, resource type, whether it is predefined, description, creation and update timestamps, creator details, metadata, and available assignment sources.
idstringrequired
Identifier for the role.
namestringrequired
Name of the role.
permissionsarray<string>required
Permissions associated with the role.
resource_typestringrequired
Resource type the role applies to.
predefined_rolebooleanrequired
Whether the role is predefined by OpenAI.
descriptionstringrequired
Description of the role.
created_atintegerrequired
When the role was created.
updated_atintegerrequired
When the role was last updated.
created_bystringrequired
Identifier of the actor who created the role.
created_by_user_objobjectrequired
User details for the actor that created the role, when available.
metadataobjectrequired
Arbitrary metadata stored on the role.
assignment_sourcesarray<object>required
Principals from which the role assignment is inherited, when available.
400Returned when the request parameters are invalid or the requested operation cannot be performed.
errorobjectrequired
403Returned when the caller does not have permission to retrieve the role assignment.
errorobjectrequired
Details about the permission error.
404Returned when the endpoint is unavailable or a requested resource cannot be found in the organization or project.
errorobjectrequired
429Returned when the request exceeds a rate limit.
errorobjectrequired
Error handling
A 400 is returned when the request parameters are invalid or the operation cannot be performed, and a 403 is returned when the authenticated user lacks permission. A 404 is returned when the endpoint is unavailable or a requested resource is not found; a 429 indicates that a rate limit was exceeded. The project_id path parameter, user_id path parameter, and role_id path parameter must identify the project, user, and role assignment to retrieve.