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

# Invite Users

> Invite a user to a team by email.

Requires teams:invite permission (team owners and admins) or
team:invite_all permission (super admin).



## OpenAPI

````yaml /openapi/api.json post /v1/teams/{team_id}/invites
openapi: 3.1.0
info:
  title: Vijil Console API (Combined)
  description: Combined OpenAPI specification for all vijil-console microservices.
  version: 0.1.0
servers: []
security: []
tags:
  - name: Teams
    description: Authentication, users, and team management
  - name: Agent Environment
    description: Agent, persona, policy, and harness management
  - name: Diamond
    description: Evaluation management and report retrieval
  - name: Dome
    description: Protection, guardrails, and telemetry
  - name: Red Team
    description: Red team campaigns
paths:
  /v1/teams/{team_id}/invites:
    post:
      tags:
        - Teams
        - teams
      summary: Invite Users
      description: |-
        Invite a user to a team by email.

        Requires teams:invite permission (team owners and admins) or
        team:invite_all permission (super admin).
      operationId: invite_users_v1_teams__team_id__invites_post
      parameters:
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Team Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteUserRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invitation'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    InviteUserRequest:
      properties:
        email:
          type: string
          minLength: 1
          title: Email
          description: Email address of the user to invite
        role:
          $ref: '#/components/schemas/TeamRole'
          description: Role to assign to the invited user
          default: MEMBER
      type: object
      required:
        - email
      title: InviteUserRequest
      description: Request model for inviting a user to a team (team_id comes from path).
    Invitation:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        team_id:
          type: string
          format: uuid
          title: Team Id
        email:
          type: string
          title: Email
        invited_by:
          type: string
          format: uuid
          title: Invited By
        role:
          $ref: '#/components/schemas/TeamRole'
        status:
          $ref: '#/components/schemas/InvitationStatus'
        created_at:
          type: integer
          title: Created At
        expires_at:
          type: integer
          title: Expires At
      type: object
      required:
        - id
        - team_id
        - email
        - invited_by
        - role
        - status
        - created_at
        - expires_at
      title: Invitation
      description: Team invitation domains model.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TeamRole:
      type: string
      enum:
        - OWNER
        - ADMIN
        - MEMBER
      title: TeamRole
      description: Team membership roles.
    InvitationStatus:
      type: string
      enum:
        - PENDING
        - ACCEPTED
        - DECLINED
        - EXPIRED
      title: InvitationStatus
      description: Invitation status.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````