Skip to content
Primary navigation

Update organization role

admin.organization.roles.update(role_id, **kwargs) -> Role { id, description, name, 4 more }
POST/organization/roles/{role_id}

Updates an existing organization role.

ParametersExpand Collapse
role_id: String
description: String

New description for the role.

permissions: Array[String]

Updated set of permissions for the role.

role_name: String

New name for the role.

ReturnsExpand Collapse
class Role { id, description, name, 4 more }

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

id: String

Identifier for the role.

description: String

Optional description of the role.

name: String

Unique name for the role.

object: :role

Always role.

permissions: Array[String]

Permissions granted by the role.

predefined_role: bool

Whether the role is predefined and managed by OpenAI.

resource_type: String

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

Update organization role

require "openai"

openai = OpenAI::Client.new(admin_api_key: "My Admin API Key")

role = openai.admin.organization.roles.update("role_id")

puts(role)
{
    "object": "role",
    "id": "role_01J1F8ROLE01",
    "name": "API Group Manager",
    "description": "Allows managing organization groups",
    "permissions": [
        "api.groups.read",
        "api.groups.write"
    ],
    "resource_type": "api.organization",
    "predefined_role": false
}
Returns Examples
{
    "object": "role",
    "id": "role_01J1F8ROLE01",
    "name": "API Group Manager",
    "description": "Allows managing organization groups",
    "permissions": [
        "api.groups.read",
        "api.groups.write"
    ],
    "resource_type": "api.organization",
    "predefined_role": false
}