---
title: "Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization."
url: "https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1/operations/inviteUser"
---

> Full API specification: https://kongair.terwilligar.com/apis/openai-api-2-3-0/versions/ea92d048-c746-4ead-a6a8-da28d93137d1.md

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

`POST` `/organization/invites`

Operation ID: `inviteUser`

## Request body (required)

Content types: `application/json`

## Responses

- `200` - User invited successfully.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: OpenAI API
  version: 2.3.0
servers:
  - url: https://api.openai.com/v1
paths:
  /organization/invites:
    post:
      summary: Create an invite for a user to the organization. The invite must be
        accepted by the user before they have access to the organization.
      operationId: inviteUser
      tags:
        - Invites
      requestBody:
        description: The invite request payload.
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InviteRequest"
      responses:
        "200":
          description: User invited successfully.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invite"
      x-oaiMeta:
        name: Create invite
        group: administration
        returns: The created [Invite](/docs/api-reference/invite/object) object.
        examples:
          request:
            curl: |
              curl -X POST https://api.openai.com/v1/organization/invites \
                -H "Authorization: Bearer $OPENAI_ADMIN_KEY" \
                -H "Content-Type: application/json" \
                -d '{
                    "email": "anotheruser@example.com",
                    "role": "reader",
                    "projects": [
                      {
                        "id": "project-xyz",
                        "role": "member"
                      },
                      {
                        "id": "project-abc",
                        "role": "owner"
                      }
                    ]
                }'
          response: |
            {
              "object": "organization.invite",
              "id": "invite-def",
              "email": "anotheruser@example.com",
              "role": "reader",
              "status": "pending",
              "invited_at": 1711471533,
              "expires_at": 1711471533,
              "accepted_at": null,
              "projects": [
                {
                  "id": "project-xyz",
                  "role": "member"
                },
                {
                  "id": "project-abc",
                  "role": "owner"
                }
              ]
            }
security:
  - ApiKeyAuth: []
components:
  schemas:
    InviteRequest:
      type: object
      properties:
        email:
          type: string
          description: Send an email to this address
        role:
          type: string
          enum:
            - reader
            - owner
          description: "`owner` or `reader`"
        projects:
          type: array
          description: 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:
            type: object
            properties:
              id:
                type: string
                description: Project's public ID
              role:
                type: string
                enum:
                  - member
                  - owner
                description: Project membership role
            required:
              - id
              - role
      required:
        - email
        - role
    Invite:
      type: object
      description: Represents an individual `invite` to the organization.
      properties:
        object:
          type: string
          enum:
            - organization.invite
          description: The object type, which is always `organization.invite`
          x-stainless-const: true
        id:
          type: string
          description: The identifier, which can be referenced in API endpoints
        email:
          type: string
          description: The email address of the individual to whom the invite was sent
        role:
          type: string
          enum:
            - owner
            - reader
          description: "`owner` or `reader`"
        status:
          type: string
          enum:
            - accepted
            - expired
            - pending
          description: "`accepted`,`expired`, or `pending`"
        invited_at:
          type: integer
          description: The Unix timestamp (in seconds) of when the invite was sent.
        expires_at:
          type: integer
          description: The Unix timestamp (in seconds) of when the invite expires.
        accepted_at:
          type: integer
          description: The Unix timestamp (in seconds) of when the invite was accepted.
        projects:
          type: array
          description: The projects that were granted membership upon acceptance of the
            invite.
          items:
            type: object
            properties:
              id:
                type: string
                description: Project's public ID
              role:
                type: string
                enum:
                  - member
                  - owner
                description: Project membership role
      required:
        - object
        - id
        - email
        - role
        - status
        - invited_at
        - expires_at
      x-oaiMeta:
        name: The invite object
        example: |
          {
            "object": "organization.invite",
            "id": "invite-abc",
            "email": "user@example.com",
            "role": "owner",
            "status": "accepted",
            "invited_at": 1711471533,
            "expires_at": 1711471533,
            "accepted_at": 1711471533,
            "projects": [
              {
                "id": "project-xyz",
                "role": "member"
              }
            ]
          }
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
```
