> ## Documentation Index
> Fetch the complete documentation index at: https://developers.qomon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Invite users by their emails

> Send an invitation to the specified mail addresses.

<Info>Invitations are sent asynchronously, so the response will only indicate that the invitation request has been received, not that the emails have been sent. To check the status of invitations, use `GET /users/invitation` to retrieve the list of invitations and their details.</Info>


## OpenAPI

````yaml /src/autogen/users-openapi3.0.yaml post /users/invitation
openapi: 3.1.0
info:
  description: >-
    This OpenAPI 3.1 specification describes the public API of the Qomon
    platform. It is generated from the code and serves both as documentation for
    API consumers and as a contract for future development.
  title: Qomon API Reference
  version: 0.0.1
servers:
  - description: Production
    url: https://incoming.qomon.app
security:
  - bearerAuth: []
tags:
  - description: List and manage users in the current space.
    name: Users
  - description: Create, read, update and delete teams.
    name: Teams
  - description: List roles available in the current space.
    name: Roles
  - description: Invite users by email and manage their invitations.
    name: Invitations
  - description: Send global messages to teams.
    name: Notifications
paths:
  /users/invitation:
    post:
      tags:
        - Invitations
      summary: Invite users by their emails
      description: Send an invitation to the specified mail addresses.
      operationId: create-invitations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataEnvelopeCreateInvitationsPayload'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatusEnvelopeCreateInvitationsData'
          description: Created
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
components:
  schemas:
    DataEnvelopeCreateInvitationsPayload:
      additionalProperties: true
      properties:
        data:
          $ref: '#/components/schemas/CreateInvitationsPayload'
      required:
        - data
      type: object
    StatusEnvelopeCreateInvitationsData:
      additionalProperties: true
      properties:
        data:
          $ref: '#/components/schemas/CreateInvitationsData'
        status:
          description: Operation result.
          examples:
            - success
          type: string
      required:
        - status
        - data
      type: object
    ErrorModel:
      additionalProperties: true
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    CreateInvitationsPayload:
      additionalProperties: true
      properties:
        invitations:
          items:
            $ref: '#/components/schemas/InvitationEntry'
          type:
            - array
            - 'null'
      required:
        - invitations
      type: object
    CreateInvitationsData:
      additionalProperties: true
      properties:
        invitations:
          items:
            $ref: '#/components/schemas/Invitation'
          type:
            - array
            - 'null'
        msg:
          examples:
            - invitations created successfully
          type: string
      required:
        - msg
      type: object
    ErrorDetail:
      additionalProperties: true
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    InvitationEntry:
      additionalProperties: true
      properties:
        email:
          description: Email to invite.
          examples:
            - example@mail.com
          type: string
        role_id:
          description: >-
            Role ID. If not provided, the 'user' role will be assigned by
            default.
          examples:
            - 8
          format: int64
          minimum: 0
          type: integer
        team_ids:
          description: Team IDs to assign when the invitation is accepted.
          examples:
            - - 11
              - 12
          items:
            format: int64
            minimum: 0
            type: integer
          type:
            - array
            - 'null'
      required:
        - email
      type: object
    Invitation:
      additionalProperties: true
      properties:
        created_at:
          format: date-time
          type: string
        email:
          examples:
            - johndoe@mail.com
          type: string
        group_id:
          examples:
            - 101
          format: int64
          minimum: 0
          type: integer
        id:
          examples:
            - 101
          format: int64
          minimum: 0
          type: integer
        last_sent:
          format: date-time
          type: string
        mobile_phone:
          examples:
            - '0123456789'
          type: string
        role:
          $ref: '#/components/schemas/InvitationRole'
        role_id:
          examples:
            - 5
          format: int64
          minimum: 0
          type: integer
        team_ids:
          examples:
            - - 11
              - 12
          items:
            format: int64
            minimum: 0
            type: integer
          type:
            - array
            - 'null'
        user_id:
          examples:
            - 2345
          format: int64
          minimum: 0
          type: integer
      type: object
    InvitationRole:
      additionalProperties: true
      properties:
        id:
          examples:
            - 5
          format: int64
          minimum: 0
          type: integer
        name:
          type: string
        order:
          format: int64
          minimum: 0
          type: integer
        type:
          enum:
            - superadmin
            - admin
            - manager
            - user
            - custom
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: opaque
      description: >-
        OAuth2 access token. Pass the token in the Authorization header as
        `Bearer <token>`. The token is looked up in Redis to resolve the caller
        identity.
      scheme: bearer
      type: http

````