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

# Invite Teammate

> Invite a teammate to the company.

Returns **201 Created** if the teammate is newly created and successfully invited.

Returns **200 OK** if a teammate with this email already exists but has never logged into Alpharun (occurs if recordings were uploaded for the teammate before they were invited). An invitation email will be sent, but the teammate's properties are not updated (use the Update Teammate endpoint to update them).

Returns **409 Conflict** if a teammate with this email already exists and has already logged in.



## OpenAPI

````yaml POST /teammates
openapi: 3.0.1
info:
  title: Alpharun API
  description: Alpharun REST API reference
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.alpharun.com/api/v1
security:
  - bearerAuth: []
paths:
  /teammates:
    post:
      description: >-
        Invite a teammate to the company.


        Returns **201 Created** if the teammate is newly created and
        successfully invited.


        Returns **200 OK** if a teammate with this email already exists but has
        never logged into Alpharun (occurs if recordings were uploaded for the
        teammate before they were invited). An invitation email will be sent,
        but the teammate's properties are not updated (use the Update Teammate
        endpoint to update them).


        Returns **409 Conflict** if a teammate with this email already exists
        and has already logged in.
      requestBody:
        required: true
        description: >-
          Teammate invitation details. Optional parameters (first_name,
          last_name, manager_id, group_ids) are only set when creating a new
          teammate, not when re-inviting.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TeammateCreationPayload'
      responses:
        '200':
          description: >-
            Existing teammate was re-invited (use PATCH to update their
            properties)
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      teammate:
                        $ref: '#/components/schemas/Teammate'
              example:
                data:
                  teammate:
                    id: 550e8400-e29b-41d4-a716-446655440000
                    first_name: Jane
                    last_name: Smith
                    email: jane.smith@example.com
                    manager_id: null
                    teammate_group_ids: []
        '201':
          description: New teammate was created and invitation sent
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      teammate:
                        $ref: '#/components/schemas/Teammate'
              example:
                data:
                  teammate:
                    id: 550e8400-e29b-41d4-a716-446655440000
                    first_name: John
                    last_name: Doe
                    email: john.doe@example.com
                    manager_id: 660e8400-e29b-41d4-a716-446655440001
                    teammate_group_ids:
                      - 770e8400-e29b-41d4-a716-446655440002
        '400':
          description: >-
            Bad request (invalid email format, invalid group IDs, or teammate
            cannot be their own manager)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Teammate exists and has already logged in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TeammateCreationPayload:
      type: object
      required:
        - email
        - role
      properties:
        email:
          type: string
          format: email
          description: Email address of the teammate to invite
        first_name:
          type: string
          description: First name of the teammate (only set when creating a new teammate)
        last_name:
          type: string
          description: Last name of the teammate (only set when creating a new teammate)
        role:
          type: string
          enum:
            - editor
            - reviewer
            - team_member
          description: Role to assign to the teammate
        manager_id:
          type: string
          description: >-
            Manager identifier, which can be a UUID or an email using the format
            `alt:email:<email>` (only set when creating a new teammate)
        group_ids:
          type: array
          items:
            type: string
            format: uuid
          description: >-
            List of teammate group IDs to add the teammate to (only set when
            creating a new teammate)
    Teammate:
      type: object
      required:
        - id
        - first_name
        - last_name
        - email
        - manager_id
        - teammate_group_ids
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the teammate
        first_name:
          type: string
          description: First name of the teammate
        last_name:
          type: string
          description: Last name of the teammate
        email:
          type: string
          format: email
          description: Email address of the teammate
        manager_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the teammate's manager, or null if no manager is assigned
        teammate_group_ids:
          type: array
          items:
            type: string
            format: uuid
          description: List of teammate group IDs the teammate belongs to
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````