> ## 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}/members/{memberId}

> This endpoint replaces the permissions of a team member.

> [!WARNING]
>
> The whole permission set is replaced. Every permission that is not sent is set to `false`.


## OpenAPI

````yaml PUT /v1/teams/{teamId}/members/{memberId}
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}/members/{memberId}:
    put:
      tags:
        - Teams
      description: >-
        Replaces the permissions of a team member. Only the owner of the team
        can do this. The whole permission set is replaced: every permission that
        is not sent is set to `false`.
      parameters:
        - name: teamId
          in: path
          required: true
          description: ID of the team the member belongs to
          schema:
            type: string
        - name: memberId
          in: path
          required: true
          description: User ID of the member (`members[].user._id` of the team).
          schema:
            type: string
      requestBody:
        description: New permissions of the member
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - permissions
              additionalProperties: false
              properties:
                permissions:
                  $ref: '#/components/schemas/TeamPermissionsInput'
      responses:
        '200':
          description: Permissions updated.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
                    description: Human readable confirmation message.
                    example: Permissões do membro atualizadas com sucesso!
        '400':
          description: >-
            `permissions` is missing, is not an object, or contains an unknown
            permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Validation error As permissões são obrigatórias.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            Team not found, you are not the owner of the team, or the user is
            not a member of the team.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Member not found in this team.
        '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.