POST
/projects/{project_id}/rolesCreate a project role
Creates a custom role for a project. Supply role_name and permissions, and optionally include description to document the role's purpose.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
project_idstringrequired
The ID of the project where you want to create the role.
Parameters for the project role you want to create.
role_namestringrequired
Unique name for the role.
permissionsarray<string>required
Permissions to grant to the role.
descriptionstringoptional
Optional description of the role.
200Returns the created role with its identifier, name, description, granted permissions, resource type, and predefined-role status.
objectstringrequired
Always `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.
429Returned when the request was rejected because a rate limit was exceeded.
errorobjectrequired
Error handling
A 429 is returned when the request exceeds the applicable rate limit. role_name and permissions are required, and description may be a string or null.