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

# Invite a user

> Invite a user to join the team specified in the URL. The authenticated user needs to be an `OWNER` in order to successfully invoke this endpoint. The user can be specified with an email or an ID. If both email and ID are provided, ID will take priority.



## OpenAPI

````yaml POST /teams/{teamId}/members
openapi: 3.1.0
info:
  version: 1.0.0
  title: Appz Api
servers:
  - url: https://api.youappz.dev
    description: Production API
security:
  - Bearer: []
paths:
  /teams/{teamId}/members:
    post:
      tags:
        - teams
      description: >-
        Invite a user to join the team specified in the URL. The authenticated
        user needs to be an `OWNER` in order to successfully invoke this
        endpoint. The user can be specified with an email or an ID. If both
        email and ID are provided, ID will take priority.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  description: The email address of the user to invite
                  body:
                    name: email
                    in: body
                  example: john@example.com
                role:
                  type: string
                  enum:
                    - OWNER
                    - MEMBER
                    - DEVELOPER
                    - BILLING
                    - VIEWER
                    - CONTRIBUTOR
                  description: The role of the user to invite
                  body:
                    name: role
                    in: body
                  example: MEMBER
                uid:
                  type: string
                  description: The id of the user to invite
                  body:
                    name: uid
                    in: body
                  example: kr1PsOIzqEL5Xg6M4VZcZosf
              required:
                - role
      responses:
        '200':
          description: The member was successfully added to the team
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invitation'
        '400':
          description: Returns a validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: number
                    example: 400
                  message:
                    type: string
                    example: >-
                      One of the provided values in the request body/query is
                      invalid
                required:
                  - code
                  - message
        '403':
          description: You do not have permission to access this resource.
        '404':
          description: The teams was not found
components:
  schemas:
    Invitation:
      type: object
      properties:
        id:
          type: string
        email:
          type:
            - string
            - 'null'
        teamId:
          type:
            - string
            - 'null'
        roleId:
          type:
            - number
            - 'null'
        createdBy:
          type:
            - number
            - 'null'
        createdAt:
          type: number
        updatedAt:
          type: number
      required:
        - id
        - email
        - teamId
        - roleId
        - createdBy
        - createdAt
        - updatedAt
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````