POST/projects/{project_id}/roles/{role_id}

Update a project role

Updates an existing project role's name, permissions, or description. Provide the fields you want to change; each body field can be omitted or set to null when it does not need an update.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters · 3 body fields
project_idstringrequired
The ID of the project to update.
role_idstringrequired
The ID of the role to update.

Fields to update on the project role; provide the values for fields you want to change.

permissionsarray<string>optional
Updated set of permissions for the role.
descriptionstringoptional
New description for the role.
role_namestringoptional
New name for the role.

5 status codes
200Returns the updated role with its 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.
400Returned when the request parameters are invalid or the requested operation cannot be performed.
errorobjectrequired
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 400 is returned when the request parameters are invalid or the operation cannot be performed, and a 403 is returned when you lack permission. A 404 is returned when the endpoint is unavailable or a requested resource is not found; 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 update.