List groups
client.admin.organization.groups.list(GroupListParams { after, limit, order } query?, RequestOptionsoptions?): NextCursorPage<Group { id, created_at, group_type, 2 more } >
GET/organization/groups
List groups
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 group of client.admin.organization.groups.list()) {
console.log(group.id);
}{
"object": "list",
"data": [
{
"object": "group",
"id": "group_01J1F8ABCDXYZ",
"name": "Support Team",
"created_at": 1711471533,
"is_scim_managed": false
}
],
"has_more": false,
"next": null
}
Returns Examples
{
"object": "list",
"data": [
{
"object": "group",
"id": "group_01J1F8ABCDXYZ",
"name": "Support Team",
"created_at": 1711471533,
"is_scim_managed": false
}
],
"has_more": false,
"next": null
}