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

# Invite admin / merchant-team or coaching users

> Invites people to a merchant account and emails each one an invitation. Use it to add **admin / merchant-team users** who manage the recruiting dashboard (`merchant_owner`, `merchant`, `merchant_selection`), **coaching-portal users** (`user`, `mentor`), or **interview candidates** (`candidate`). Candidate invites require an `interview_id` and are gated by the merchant's available interview credits; admin and coaching invites are not. Each user in the array is processed independently and returned with an individual result, so one failure does not block the rest. Callable with a merchant JWT (merchant_owner/merchant/admin) or a service-role key (requires merchant_id).



## OpenAPI

````yaml https://cool.jobmojito.com/functions/v1/openapi post /invite-users
openapi: 3.1.0
info:
  title: JobMojito API
  version: 1.0.0
  description: >-
    Public API for JobMojito, served by Supabase Edge Functions. Authenticate
    with a Supabase JWT access token via the Authorization header.
servers:
  - url: https://cool.jobmojito.com/functions/v1
    description: Production
security: []
tags:
  - name: Interviews
    description: >-
      Create, configure and manage interview / coaching / assessment
      definitions.
  - name: Results
    description: >-
      Interview results, transcripts, reports, re-attempt requests and
      analytics.
  - name: Candidates
    description: List and manage candidates.
  - name: Knowledge base
    description: Upload documents used to generate knowledge-base interviews.
  - name: Resume & Form verification
    description: Pre-screen candidates from resumes and forms.
  - name: Admin
    description: >-
      Account administration — invite team/coaching users, manage sub-merchants
      and avatar templates.
paths:
  /invite-users:
    post:
      tags:
        - Admin
      summary: Invite admin / merchant-team or coaching users
      description: >-
        Invites people to a merchant account and emails each one an invitation.
        Use it to add **admin / merchant-team users** who manage the recruiting
        dashboard (`merchant_owner`, `merchant`, `merchant_selection`),
        **coaching-portal users** (`user`, `mentor`), or **interview
        candidates** (`candidate`). Candidate invites require an `interview_id`
        and are gated by the merchant's available interview credits; admin and
        coaching invites are not. Each user in the array is processed
        independently and returned with an individual result, so one failure
        does not block the rest. Callable with a merchant JWT
        (merchant_owner/merchant/admin) or a service-role key (requires
        merchant_id).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteUsersRequest'
      responses:
        '200':
          description: The users array with per-item invitation results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteUsersResponse'
        '403':
          description: The caller does not have access to the requested merchant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Validation error, missing merchant_id for service role, or
            unauthenticated user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    InviteUsersRequest:
      type: object
      properties:
        users:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
                nullable: true
                description: >-
                  Email address of the person to invite. Validated per item; an
                  invalid/missing value produces a per-item error result, not a
                  request-level 422.
                example: hello@google.com
              name:
                type: string
                nullable: true
                description: Display name for the invited profile.
                example: mr. Brown
              type:
                type: string
                nullable: true
                description: >-
                  Invite type — selects which kind of account is created.
                  Defaults to 'user'. Admin / merchant-team roles (manage the
                  recruiting dashboard): `merchant_owner`, `merchant`,
                  `merchant_selection`. Coaching-portal users: `user`, `mentor`.
                  Interview candidate: `candidate` (requires `interview_id`). An
                  invalid value yields a per-item error result rather than a
                  request-level failure.
                example: merchant
              interview_id:
                type: string
                nullable: true
                format: uuid
                description: Interview/position id. Mandatory when type is 'candidate'.
                example: d1c00b60-7e75-4292-9190-7037b95b349a
            additionalProperties:
              nullable: true
          description: List of users to invite.
        force_invite:
          type: boolean
          nullable: true
          description: >-
            When true, re-sends the invite email for still-pending (invited)
            profiles that did not otherwise produce a result.
          example: false
        merchant_id:
          type: string
          nullable: true
          format: uuid
          description: >-
            Target merchant id. Required when calling with a service-role key.
            For admins / sub-merchant users it overrides the JWT merchant.
          example: 28106cba-1c27-4e53-b149-32113e5e8e31
        mojito_language_code:
          type: string
          nullable: true
          enum:
            - ar
            - bg
            - zh
            - hr
            - cs
            - da
            - nl
            - en
            - fil
            - fi
            - fr
            - de
            - el
            - hi
            - hu
            - id
            - it
            - ja
            - ko
            - ms
            - 'no'
            - pl
            - pt
            - br
            - ro
            - ru
            - sk
            - es
            - sv
            - ta
            - th
            - tr
            - uk
            - vi
          description: >-
            Language code applied to created profiles (one of the
            platform-languages.json codes). Defaults to 'en' when omitted.
          example: en
        message_from_recruiter:
          type: string
          nullable: true
          description: Optional custom message included in the invitation email.
      required:
        - users
    InviteUsersResponse:
      type: array
      items:
        type: object
        properties:
          email:
            type: string
          name:
            type: string
            nullable: true
          type:
            type: string
            nullable: true
          interview_id:
            type: string
            nullable: true
          result:
            type: string
            description: >-
              Outcome, e.g. 'Invited', 'Activated', 'SubMerchantAdded',
              'Skipped', or 'Error: <message>'.
          profile_id:
            type: string
            nullable: true
          profile_interview_id:
            type: string
            nullable: true
        required:
          - email
        additionalProperties:
          nullable: true
      description: The input users array, each augmented with the invitation result fields.
    Error:
      type: object
      properties:
        error:
          type: string
          example: Field is required.
        name:
          type: string
          example: interview_result_id
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase JWT access token, passed as `Authorization: Bearer <token>`.'

````