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

# /v1/teams/{teamId}/invite

> This endpoint invites a user to a team.

> [!NOTE]
>
> The invited e-mail must belong to an existing CamposCloud account. Invites are accepted through the link sent by e-mail and expire after 2 days.


## OpenAPI

````yaml POST /v1/teams/{teamId}/invite
openapi: 3.1.0
info:
  title: CamposCloud API Documentation
  description: >-
    This documentation provides an overview of the CamposCloud API, including
    authentication, endpoints, and data structures. It is designed to help
    developers integrate with the CamposCloud platform effectively.
  version: 1.0.0
servers:
  - url: https://api.camposcloud.com
security:
  - bearerAuth: []
paths:
  /v1/teams/{teamId}/invite:
    post:
      tags:
        - Teams
      description: >-
        Invites a user to a team. Only the owner of the team can do this. The
        e-mail must belong to an existing CamposCloud account; the user receives
        an e-mail with a link to accept the invite (invites cannot be accepted
        through this API). Invites expire after 2 days.
      parameters:
        - name: teamId
          in: path
          required: true
          description: ID of the team to invite the user to
          schema:
            type: string
      requestBody:
        description: User to invite
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              additionalProperties: false
              properties:
                email:
                  type: string
                  format: email
                  description: E-mail address of the CamposCloud account to invite.
                  example: invited@example.com
                permissions:
                  $ref: '#/components/schemas/TeamPermissionsInput'
                  description: >-
                    Permissions the user receives when accepting the invite.
                    When omitted, the member has no permissions.
      responses:
        '200':
          description: Invite sent.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
                    description: Human readable confirmation message.
                    example: Convite enviado com sucesso!
        '400':
          description: >-
            Validation failed, the user is the owner or already a member of the
            team, or the user was already invited.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Este usuário já foi convidado para esta equipe.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            Team not found, you are not the owner of the team, or no account
            uses this e-mail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Usuário não encontrado com o e-email fornecido.
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    TeamPermissionsInput:
      type: object
      description: >-
        Permissions to grant. Every permission that is left out is set to
        `false`. Unknown keys are rejected with `400`.
      additionalProperties: false
      properties:
        canCreateApplication:
          type: boolean
          description: Create applications in the team.
          default: false
        canDeleteApplication:
          type: boolean
          description: Delete applications of the team.
          default: false
        canUpdateApplicationSettings:
          type: boolean
          description: Update the settings of applications of the team.
          default: false
        canChangeStatusApplication:
          type: boolean
          description: Start, stop and restart applications of the team.
          default: false
        canManageApplicationBackup:
          type: boolean
          description: Manage backups of applications of the team.
          default: false
        canEditApplicationFiles:
          type: boolean
          description: Upload and edit files of applications of the team.
          default: false
        canSeeApplicationFiles:
          type: boolean
          description: List, read and download files of applications of the team.
          default: false
        canDeleteApplicationFiles:
          type: boolean
          description: Delete files of applications of the team.
          default: false
        canCreateDatabase:
          type: boolean
          description: Create databases in the team.
          default: false
        canDeleteDatabase:
          type: boolean
          description: Delete databases of the team.
          default: false
        canUpdateDatabaseSettings:
          type: boolean
          description: Update the settings of databases of the team.
          default: false
        canChangeStatusDatabase:
          type: boolean
          description: Start, stop and restart databases of the team.
          default: false
      example:
        canSeeApplicationFiles: true
        canEditApplicationFiles: true
        canChangeStatusApplication: true
    Error:
      type: object
      description: >-
        Every error returned by the API has this shape. The message can be in
        English or in Portuguese depending on the endpoint.
      required:
        - error
      properties:
        error:
          type: string
          description: Human readable description of the error.
          example: Application not found.
  responses:
    Unauthorized:
      description: >-
        The `Authorization` header is missing or malformed, or the API token is
        invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid developer token
    TooManyRequests:
      description: >-
        A rate limit was exceeded. See the `RateLimit-*` and `Retry-After`
        response headers.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too many requests, please try again later
    InternalError:
      description: >-
        Unexpected error. On endpoints that do not document a `400` for it, this
        is also returned when an ID in the URL is not a valid identifier.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Internal server error. Please try again later.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your CamposCloud API token, sent as `Authorization: Bearer <token>`.'

````

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