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 invites

admin.organization.invites.list(**kwargs) -> SyncConversationCursorPage[Invite]
GET
/organization/invites

Returns a list of invites in the organization.

List invites

import os
from openai import OpenAI

client = OpenAI(
    admin_api_key=os.environ.get("OPENAI_ADMIN_KEY"),  # This is the default and can be omitted
)
page = client.admin.organization.invites.list()
page = page.data[0]
print(page.id)
Response example
{
  "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,
      "projects": []
    }
  ],
  "first_id": "invite-abc",
  "last_id": "invite-abc",
  "has_more": false
}
Parameters
after: Optional[str]

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

limit: Optional[int]

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Returns
class Invite: …

Represents an individual invite to the organization.

id: str

The identifier, which can be referenced in API endpoints

created_at: int

The Unix timestamp (in seconds) of when the invite was sent.

formatunixtime
email: str

The email address of the individual to whom the invite was sent

object: Literal["organization.invite"]

The object type, which is always organization.invite

projects: List[Project]

The projects that were granted membership upon acceptance of the invite.

role: Literal["owner", "reader"]

owner or reader

status: Literal["accepted", "expired", "pending"]

accepted,expired, or pending

accepted_at: Optional[int]

The Unix timestamp (in seconds) of when the invite was accepted.

formatunixtime
expires_at: Optional[int]

The Unix timestamp (in seconds) of when the invite expires.

formatunixtime
Returns Examples
Response example
{
  "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,
      "projects": []
    }
  ],
  "first_id": "invite-abc",
  "last_id": "invite-abc",
  "has_more": false
}