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
Theme

List organization roles

RoleListPage admin().organization().roles().list(params = RoleListParams.none(), requestOptions = RequestOptions.none())
GET
/organization/roles

Lists the roles configured for the organization.

List organization roles

package com.openai.example;

import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.admin.organization.roles.RoleListPage;
import com.openai.models.admin.organization.roles.RoleListParams;

public final class Main {
    private Main() {}

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

        RoleListPage page = client.admin().organization().roles().list();
    }
}
Response example
{
    "object": "list",
    "data": [
        {
            "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
        }
    ],
    "has_more": false,
    "next": null
}
Parameters
RoleListParams params
Optional<String> after

Cursor for pagination. Provide the value from the previous response’s next field to continue listing roles.

Optional<Long> limit

A limit on the number of roles to return. Defaults to 1000.

minimum0
maximum1000
Optional<Order> order

Sort order for the returned roles.

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": "list",
    "data": [
        {
            "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
        }
    ],
    "has_more": false,
    "next": null
}