List invites
client.admin.organization.invites.list(InviteListParams { after, limit } query?, RequestOptionsoptions?): ConversationCursorPage<Invite { id, created_at, email, 6 more } >
GET/organization/invites
List invites
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 invite of client.admin.organization.invites.list()) {
console.log(invite.id);
}{
"object": "list",
"data": [
{
"object": "organization.invite",
"id": "invite-abc",
"email": "user@example.com",
"role": "owner",
"status": "accepted",
"created_at": 1711471533,
"expires_at": 1711471533,
"accepted_at": 1711471533
}
],
"first_id": "invite-abc",
"last_id": "invite-abc",
"has_more": false
}
Returns Examples
{
"object": "list",
"data": [
{
"object": "organization.invite",
"id": "invite-abc",
"email": "user@example.com",
"role": "owner",
"status": "accepted",
"created_at": 1711471533,
"expires_at": 1711471533,
"accepted_at": 1711471533
}
],
"first_id": "invite-abc",
"last_id": "invite-abc",
"has_more": false
}