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

# Invite a New User

> Sends an invitation to an email address that has not been used yet as a Voucherify user login.

You can specify the projects to which the invited user will be assigned and define their roles.



## OpenAPI

````yaml /openapi/management.json post /management/v1/projects/users/invite
openapi: 3.0.1
info:
  title: Voucherify API - Management
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /management/v1/projects/users/invite:
    post:
      tags:
        - Management
      summary: Invite a New User
      description: >-
        Sends an invitation to an email address that has not been used yet as a
        Voucherify user login.


        You can specify the projects to which the invited user will be assigned
        and define their roles.
      operationId: invite-user
      parameters: []
      requestBody:
        description: >-
          Defines the details of the invitation, the project, and roles to which
          the user will be assigned.
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/ManagementProjectsUsersInviteCreateRequestBody
        required: true
      responses:
        '204':
          description: Returns no content if the invitation has been sent successfully.
        '400':
          description: Returns an error if the payload includes an incorrect role.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/e_400_invalid_payload'
              examples:
                Invalid payload:
                  value:
                    code: 400
                    key: used_incorrect_role
                    message: Used incorrect role
                    details: The role 'VICE_ADMIN' is incorrect
                    request_id: v-0f0f63a9f00cdbd981
        '404':
          description: Returns an error if the project does not exist or has been deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Not Found:
                  value:
                    code: 404
                    key: not_found
                    message: Resource not found
                    details: Cannot find project with id proj_4r3Ul0St
                    request_id: v-0f0f62fe19ccdbd8bc
                    resource_id: proj_4r3Ul0St
                    resource_type: project
        '409':
          description: Returns an error if the email address belongs to a Voucherify user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Duplicate Code:
                  value:
                    code: 409
                    key: duplicate_found
                    message: Duplicated resource found
                    details: Duplicated user exists with email your.email@domain.com
                    resource_id: your.email@domain.com
                    resource_type: user
      security:
        - X-Management-Id: []
          X-Management-Token: []
components:
  schemas:
    ManagementProjectsUsersInviteCreateRequestBody:
      type: object
      description: Request body schema for **POST** `/management/v1/projects/users/invite`.
      properties:
        email:
          type: string
          description: >-
            Email address to which the invitation will be sent. Must be a valid
            email address.
          example: alex.doe@your-domain-name.com
        first_name:
          type: string
          description: >-
            First name of the person who will receive the invitation. The name
            will be used in the user profile.
          example: Alex
        last_name:
          type: string
          description: >-
            Last name of the person who will receive the invitation. The name
            will be used in the user profile.
          example: Doe
        projects:
          type: object
          title: Project and Role
          description: >-
            In the key, provide the project ID to which the new user will be
            assigned. In the value, provide the role which the user will have in
            the project. The predefined Voucherify roles are: `ADMIN`, `USER`,
            `VIEWER`, `MERCHANT`, `USER_RESTRICTED` (for the Areas and Stores,
            an Enterprise feature). Send a custom role ID (Enterprise feature)
            to assign a custom role. To find the custom role ID: If you are an
            admin, go to Voucherify Dashboard, Team settings, and Roles tab.
            Click on a custom role. The custom role ID is in the URL in the
            format `role_XyZ7aB9cD2eF4gH1iJ0kL5mN6oP8qR3s`.
          additionalProperties:
            type: string
            title: project_id
            description: >-
              Defines the project to which the user will be assigned and the
              role in the project.
          example:
            proj_ExPr0jID: USER
            proj_ExPr0jId: role_XyZ7aB9cD2eF4gH1iJ0kL5mN6oP8qR3s
      required:
        - email
        - first_name
        - last_name
        - projects
    e_400_invalid_payload:
      title: Invalid Payload
      type: object
      description: 'Error: Bad Request &rarr; Invalid Payload'
      properties:
        code:
          type: integer
          default: 400
          description: Error's HTTP status code.
        key:
          type: string
          default: invalid_payload
          description: Short string describing the kind of error which occurred.
        message:
          type: string
          default: Invalid payload
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        request_id:
          type: string
          example: v-0a884c6be8c3756f42
          description: >-
            This ID is useful when troubleshooting and/or finding the root cause
            of an error response by our support team.
    Error:
      title: Error Object
      type: object
      description: Error details
      properties:
        code:
          type: integer
          description: Error's HTTP status code.
        key:
          type: string
          description: Short string describing the kind of error which occurred.
        message:
          type: string
          description: A human-readable message providing a short description of the error.
        details:
          type: string
          description: A human-readable message providing more details about the error.
        request_id:
          type: string
          example: v-0a885062c80375740f
          description: >-
            This ID is useful when troubleshooting and/or finding the root cause
            of an error response by our support team.
        resource_id:
          type: string
          description: >-
            Unique resource ID that can be used in another endpoint to get more
            details.
          example: rf_0c5d710a87c8a31f86
        resource_type:
          type: string
          description: The resource type.
          example: voucher
        error:
          type: object
          description: Includes additional information about the error.
          properties:
            message:
              type: string
              description: The message configured by the user in a validation rule.
      required:
        - code
        - message
  securitySchemes:
    X-Management-Id:
      type: apiKey
      name: X-Management-Id
      in: header
    X-Management-Token:
      type: apiKey
      name: X-Management-Token
      in: header

````