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

Retrieve invite

admin.organization.invites.retrieve(strinvite_id) -> Invite
GET/organization/invites/{invite_id}

Retrieves an invite.

ParametersExpand Collapse
invite_id: str
ReturnsExpand Collapse
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

Retrieve invite

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
)
invite = client.admin.organization.invites.retrieve(
    "invite_id",
)
print(invite.id)
{
    "object": "organization.invite",
    "id": "invite-abc",
    "email": "user@example.com",
    "role": "owner",
    "status": "accepted",
    "created_at": 1711471533,
    "expires_at": 1711471533,
    "accepted_at": 1711471533,
    "projects": []
}
Returns Examples
{
    "object": "organization.invite",
    "id": "invite-abc",
    "email": "user@example.com",
    "role": "owner",
    "status": "accepted",
    "created_at": 1711471533,
    "expires_at": 1711471533,
    "accepted_at": 1711471533,
    "projects": []
}