Invites

Invite and manage invitations for an organization. Invited users are automatically added to the Default project.source

List invites

get https://api.openai.com/v1/organization/invites

Returns a list of invites in the organization.source

Query parameters

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

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.source

Returns

A list of Invite objects.source

Example request
1
2
3
curl https://api.openai.com/v1/organization/invites?after=invite-abc&limit=20 \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json"
Response

Create invite

post https://api.openai.com/v1/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.source

Request body

Send an email to this addresssource

owner or readersource

Returns

The created Invite object.source

Example request
1
2
3
4
5
6
7
curl -X POST https://api.openai.com/v1/organization/invites \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "email": "user@example.com",
      "role": "owner"
  }'
Response

Retrieve invite

get https://api.openai.com/v1/organization/invites/{invite_id}

Retrieves an invite.source

Path parameters

The ID of the invite to retrieve.source

Returns

The Invite object matching the specified ID.source

Example request
1
2
3
curl https://api.openai.com/v1/organization/invites/invite-abc \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json"
Response

Delete invite

delete https://api.openai.com/v1/organization/invites/{invite_id}

Delete an invite. If the invite has already been accepted, it cannot be deleted.source

Path parameters

The ID of the invite to delete.source

Returns

Confirmation that the invite has been deletedsource

Example request
1
2
3
curl -X DELETE https://api.openai.com/v1/organization/invites/invite-abc \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
  -H "Content-Type: application/json"
Response

The invite object

Represents an individual invite to the organization.source

The object type, which is always organization.invitesource

The identifier, which can be referenced in API endpointssource

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

owner or readersource

accepted,expired, or pendingsource

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

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

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

OBJECT The invite object
1
2
3
4
5
6
7
8
9
10
{
  "object": "organization.invite",
  "id": "invite-abc",
  "email": "user@example.com",
  "role": "owner",
  "status": "accepted",
  "invited_at": 1711471533,
  "expires_at": 1711471533,
  "accepted_at": 1711471533
}