NAME

OpenAPI::Client::OpenAI::Path::organization-roles - Documentation for the /organization/roles path.

OPERATIONS

GET /organization/roles

list-roles

$client->list_roles({
    body => { ... },
});

Lists the roles configured for the organization.

Path/query parameters

  • limit (in query, optional, integer) - A limit on the number of roles to return. Defaults to 1000.

    Default: 1000

  • after (in query, optional, string) - Cursor for pagination. Provide the value from the previous response's next field to continue listing roles.

  • order (in query, optional, string) - Sort order for the returned roles.

    Allowed values: asc, desc

    Default: asc

Responses

200 - Roles listed successfully.

Content-Type: application/json

Example:

{
   "data" : [
      {
         "description" : "Allows managing organization groups",
         "id" : "role_01J1F8ROLE01",
         "name" : "API Group Manager",
         "object" : "role",
         "permissions" : [
            "api.groups.read",
            "api.groups.write"
         ],
         "predefined_role" : false,
         "resource_type" : "api.organization"
      }
   ],
   "has_more" : false,
   "next" : null,
   "object" : "list"
}

POST /organization/roles

create-role

$client->create_role({
    body => { ... },
});

Creates a custom role for the organization.

Responses

200 - Role created successfully.

Content-Type: application/json

Example:

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

SCHEMAS

PublicCreateOrganizationRoleBody

Properties:

  • description (anyOf) - Optional description of the role.

  • permissions (array of string, required) - Permissions to grant to the role.

  • role_name (string, required) - Unique name for the role.

PublicRoleListResource

Properties:

  • data (array of Role, required) - Roles returned in the current page.

  • has_more (boolean, required) - Whether more roles are available when paginating.

  • next (anyOf, required) - Cursor to fetch the next page of results, or null when there are no additional roles.

  • object (string, required) - Always list .

    Allowed values: list

Role

Properties:

  • description (anyOf, required) - Optional description of the role.

  • id (string, required) - Identifier for the role.

  • name (string, required) - Unique name for the role.

  • object (string, required) - Always role .

    Allowed values: role

  • permissions (array of string, required) - Permissions granted by the role.

  • predefined_role (boolean, required) - Whether the role is predefined and managed by OpenAI.

  • resource_type (string, required) - Resource type the role is bound to (for example api.organization or api.project ).

SEE ALSO

OpenAPI::Client::OpenAI::Path

COPYRIGHT AND LICENSE

Copyright (C) 2023-2026 by Nelson Ferraz

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.0 or, at your option, any later version of Perl 5 you may have available.