List group organization role assignments
client.admin.organization.groups.roles.list(stringgroupID, RoleListParams { after, limit, order } query?, RequestOptionsoptions?): NextCursorPage<RoleListResponse { id, created_at, created_by, 8 more } >
GET/organization/groups/{group_id}/roles
Lists the organization roles assigned to a group within the organization.
List group organization role assignments
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 roleListResponse of client.admin.organization.groups.roles.list('group_id')) {
console.log(roleListResponse.id);
}{
"object": "list",
"data": [
{
"id": "role_01J1F8ROLE01",
"name": "API Group Manager",
"permissions": [
"api.groups.read",
"api.groups.write"
],
"resource_type": "api.organization",
"predefined_role": false,
"description": "Allows managing organization groups",
"created_at": 1711471533,
"updated_at": 1711472599,
"created_by": "user_abc123",
"created_by_user_obj": {
"id": "user_abc123",
"name": "Ada Lovelace",
"email": "ada@example.com"
},
"metadata": {}
}
],
"has_more": false,
"next": null
}
Returns Examples
{
"object": "list",
"data": [
{
"id": "role_01J1F8ROLE01",
"name": "API Group Manager",
"permissions": [
"api.groups.read",
"api.groups.write"
],
"resource_type": "api.organization",
"predefined_role": false,
"description": "Allows managing organization groups",
"created_at": 1711471533,
"updated_at": 1711472599,
"created_by": "user_abc123",
"created_by_user_obj": {
"id": "user_abc123",
"name": "Ada Lovelace",
"email": "ada@example.com"
},
"metadata": {}
}
],
"has_more": false,
"next": null
}