List organization roles
client.admin.organization.roles.list(RoleListParams { after, limit, order } query?, RequestOptionsoptions?): NextCursorPage<Role { id, description, name, 4 more } >
GET/organization/roles
List organization roles
import OpenAI from 'openai';
const client = new OpenAI({
adminAPIKey: process.env['OPENAI_ADMIN_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const role of client.admin.organization.roles.list()) {
console.log(role.id);
}{
"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
}
Returns Examples
{
"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
}