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

# Create an invite

> Creates a clinic (Tele Clinic) or rep invite and returns its signup link. By default the invite is also emailed to `email`. Send an `external_invite_id` to make the call safe to retry: repeating it returns the same invite (`200`). Needs `invites:write`. With a test key nothing is created and no email is sent.



## OpenAPI

````yaml /rep-api/openapi.yaml post /invites
openapi: 3.0.3
info:
  title: VitaRelay Rep API
  version: 1.0.0
  description: >-
    The Rep API is for rep organizations (a Vita Rep, or a dual Rep + Clinic
    account) that recruit clinics and other reps. Create the invite you would
    otherwise send from the "Refer a Tele Clinic" form, get the signup link
    back, track whether it was accepted, and revoke it.
servers:
  - url: https://vitarelay.com/api/public/rep/v1
security:
  - bearerAuth: []
tags:
  - name: Invites
    description: Clinic and rep invites sent by your organization.
paths:
  /invites:
    post:
      tags:
        - Invites
      summary: Create an invite
      description: >-
        Creates a clinic (Tele Clinic) or rep invite and returns its signup
        link. By default the invite is also emailed to `email`. Send an
        `external_invite_id` to make the call safe to retry: repeating it
        returns the same invite (`200`). Needs `invites:write`. With a test key
        nothing is created and no email is sent.
      operationId: createInvite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInvite'
            example:
              type: clinic
              email: owner@jasonmeds.com
              phone: (229) 719-4222
              first_name: Jason
              last_name: Tests
              product_types:
                - 503a
                - rnd
                - supplements
              external_invite_id: crm-lead-4471
      responses:
        '200':
          description: >-
            Replay of an earlier call with the same `external_invite_id`; the
            original invite.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Invite'
        '201':
          description: The invite was created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Invite'
        '400':
          $ref: '#/components/responses/InvalidBody'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          description: >-
            `duplicate_request` — the `external_invite_id` was reused with a
            different body, or the same request is still in flight.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          $ref: '#/components/responses/ValidationFailed'
components:
  schemas:
    CreateInvite:
      type: object
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - clinic
            - rep
          default: clinic
          description: '`clinic` for a Tele Clinic, `rep` for a Rep Partner.'
        email:
          type: string
          format: email
          description: >-
            Required unless `send_email` is `false`. The invite email is sent
            here.
        phone:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        product_types:
          type: array
          description: >-
            Which product groups the invited organization can see. Omit for all.
            503B is never offered.
          items:
            type: string
            enum:
              - 503a
              - rnd
              - supplements
        send_email:
          type: boolean
          default: true
          description: Set `false` to get the link back without emailing the prospect.
        external_invite_id:
          type: string
          maxLength: 128
          description: Your own id for the invite. Makes the call safe to retry.
    Invite:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - clinic
            - rep
        status:
          type: string
          enum:
            - pending
            - accepted
            - expired
        invite_code:
          type: string
        invite_url:
          type: string
          description: The signup link, on your own branded domain when you have one.
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        product_types:
          type: array
          nullable: true
          items:
            type: string
        external_invite_id:
          type: string
          nullable: true
          description: Echoed on create and on a retry; not stored on later reads.
        expires_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  responses:
    InvalidBody:
      description: '`invalid_body` — the request body is not valid JSON.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        `insufficient_scope` (the key lacks the scope) or `not_available` (your
        organization is not a rep or dual Rep + Clinic account).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationFailed:
      description: >-
        `validation_failed` — a field is missing or invalid; the message says
        which.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        VitaRelay API key (`vr_live_...` or `vr_test_...`) with the `invites:*`
        scopes.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.