Skip to content
Primary navigation

Create invite

$ openai admin:organization:invites create
POST/organization/invites

Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.

ParametersExpand Collapse
--email: string

Send an email to this address

--role: "reader" or "owner"

owner or reader

--project: optional array of object { id, role }

An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to the default project for compatibility with legacy behavior. If empty list is passed, the user will not be invited to any projects, including the default one.

ReturnsExpand Collapse
invite: object { id, created_at, email, 6 more }

Represents an individual invite to the organization.

id: string

The identifier, which can be referenced in API endpoints

created_at: number

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

email: string

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

object: "organization.invite"

The object type, which is always organization.invite

projects: array of object { id, role }

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

id: string

Project’s public ID

role: "member" or "owner"

Project membership role

"member"
"owner"
role: "owner" or "reader"

owner or reader

"owner"
"reader"
status: "accepted" or "expired" or "pending"

accepted,expired, or pending

"accepted"
"expired"
"pending"
accepted_at: optional number

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

expires_at: optional number

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

Create invite

openai admin:organization:invites create \
  --admin-api-key 'My Admin API Key' \
  --email email \
  --role reader
{
  "object": "organization.invite",
  "id": "invite-def",
  "email": "anotheruser@example.com",
  "role": "reader",
  "status": "pending",
  "created_at": 1711471533,
  "expires_at": 1711471533,
  "accepted_at": null,
  "projects": [
    {
      "id": "project-xyz",
      "role": "member"
    },
    {
      "id": "project-abc",
      "role": "owner"
    }
  ]
}
Returns Examples
{
  "object": "organization.invite",
  "id": "invite-def",
  "email": "anotheruser@example.com",
  "role": "reader",
  "status": "pending",
  "created_at": 1711471533,
  "expires_at": 1711471533,
  "accepted_at": null,
  "projects": [
    {
      "id": "project-xyz",
      "role": "member"
    },
    {
      "id": "project-abc",
      "role": "owner"
    }
  ]
}