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

client.Admin.Organization.Invites.Get(ctx, inviteID) (*Invite, error)
GET/organization/invites/{invite_id}

Retrieves an invite.

ParametersExpand Collapse
inviteID string
ReturnsExpand Collapse
type Invite struct{…}

Represents an individual invite to the organization.

ID string

The identifier, which can be referenced in API endpoints

CreatedAt int64

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

formatunixtime
Email string

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

Object OrganizationInvite

The object type, which is always organization.invite

Projects []InviteProject

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

Role InviteRole

owner or reader

Status InviteStatus

accepted,expired, or pending

AcceptedAt int64Optional

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

formatunixtime
ExpiresAt int64Optional

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

formatunixtime

Retrieve invite

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
  "github.com/openai/openai-go/option"
)

func main() {
  client := openai.NewClient(
    option.WithAdminAPIKey("My Admin API Key"),
  )
  invite, err := client.Admin.Organization.Invites.Get(context.TODO(), "invite_id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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": []
}