Create invite

POSThttps:/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.

Request body

  • email
    string
    Required
    Send an email to this address
  • role
    string
    Required

    owner or reader

    • reader
      string
    • owner
      string
  • projects
    array
    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.
    • items
      object
      • id
        string
        Required
        Project's public ID
      • role
        string
        Required
        Project membership role
        • member
          string
        • owner
          string

Response

The created Invite object.

Example request
1
curl -X POST https://api.openai.com/v1/organization/invites \
2
-H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
3
-H "Content-Type: application/json" \
4
-d '{
5
"email": "anotheruser@example.com",
6
"role": "reader",
7
"projects": [
8
{
9
"id": "project-xyz",
10
"role": "member"
11
},
12
{
13
"id": "project-abc",
14
"role": "owner"
15
}
16
]
17
}'
Example response
1
{
2
"object": "organization.invite",
3
"id": "invite-def",
4
"email": "anotheruser@example.com",
5
"role": "reader",
6
"status": "pending",
7
"invited_at": 1711471533,
8
"expires_at": 1711471533,
9
"accepted_at": null,
10
"projects": [
11
{
12
"id": "project-xyz",
13
"role": "member"
14
},
15
{
16
"id": "project-abc",
17
"role": "owner"
18
}
19
]
20
}
Built with