Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Update project role

Role admin().organization().projects().roles().update(params, requestOptions = RequestOptions.none())
POST
/projects/{project_id}/roles/{role_id}

Updates an existing project role.

Update project role

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.admin.organization.projects.roles.RoleUpdateParams;
import com.openai.models.admin.organization.roles.Role;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        OpenAIClient client = OpenAIOkHttpClient.fromEnv();

        RoleUpdateParams params = RoleUpdateParams.builder()
            .projectId("project_id")
            .roleId("role_id")
            .build();
        Role role = client.admin().organization().projects().roles().update(params);
    }
}
Response example
{
    "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
}
Parameters
RoleUpdateParams params
String projectId
Optional<String> roleId
Optional<String> description

New description for the role.

Optional<List<String>> permissions

Updated set of permissions for the role.

Optional<String> roleName

New name for the role.

Returns
class Role:

Details about a role that can be assigned through the public Roles API.

String id

Identifier for the role.

Optional<String> description

Optional description of the role.

String name

Unique name for the role.

JsonValue; object_
constant
constant

Always role.

List<String> permissions

Permissions granted by the role.

boolean predefinedRole

Whether the role is predefined and managed by OpenAI.

String resourceType

Resource type the role is bound to (for example api.organization or api.project).

Returns Examples
Response example
{
    "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
}