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

# Update repository team.

> # Access control rules

- The requester must have access to the repository.
- Reviewers that are team leaders can update anything.
- Reviewers that are team members can remove themselves from the team.
- Admins can change anything.



## OpenAPI

````yaml PATCH /api/v0/repositories/{repo_id}/teams/{team_id}
openapi: 3.1.0
info:
  title: Cantina Client API
  description: >-
    Endpoints available to client organizations. For an overview and
    authentication, see
    https://docs.cantina.xyz/for-organizations/getting-started/api-access.
  license:
    name: Cantina
    identifier: Cantina
  version: 0.1.0
servers: []
security: []
paths:
  /api/v0/repositories/{repo_id}/teams/{team_id}:
    patch:
      tags:
        - repositories
      summary: Update repository team.
      description: |-
        # Access control rules

        - The requester must have access to the repository.
        - Reviewers that are team leaders can update anything.
        - Reviewers that are team members can remove themselves from the team.
        - Admins can change anything.
      operationId: update_repo_team
      parameters:
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: team_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRepoTeam'
        required: true
      responses:
        '204':
          description: Repository team successfully updated
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '401':
          description: Access not authorised
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '403':
          description: Access forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '500':
          description: Error updating repository team
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    UpdateRepoTeam:
      type: object
      properties:
        acceptInvite:
          type:
            - boolean
            - 'null'
          description: |-
            Whether to accept or reject the invite to join a repo team.
            Can only be updated by the auditor that has the invite.
        members:
          type: array
          items:
            $ref: '#/components/schemas/UpdateTeamMembers'
          description: |-
            The auditors that will be invited/removed from the team.
            Can only be updated by a team leader or an admin.
    CantinaError:
      type: object
      description: Error returned by the Cantina API.
      required:
        - type
        - msg
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        msg:
          type: string
          description: Error message for the user.
    UpdateTeamMembers:
      oneOf:
        - type: object
          description: |-
            The user id of the auditor to invite to the team.
            Only a team leader can create an invite.
          required:
            - id
            - action
          properties:
            id:
              type: string
              format: uuid
            action:
              type: string
              enum:
                - invite
        - type: object
          description: The user id of the auditor to remove from the team.
          required:
            - id
            - action
          properties:
            id:
              type: string
              format: uuid
            action:
              type: string
              enum:
                - remove
        - type: object
          description: >-
            Currently it is only possible to move a reviewer from a repository
            "solo"

            team to a (not solo) repository team.

            Moving between (not repository) teams is not supported.

            Moving between not-solo repository teams is also not supported.

            Only allowed to be performed by admins.
          required:
            - id
            - action
          properties:
            id:
              type: string
              format: uuid
            action:
              type: string
              enum:
                - move
    ErrorType:
      type: string
      description: Type of error.
      enum:
        - email_not_verified
        - auth_invalid
        - auth_expired
        - auth_token_missing
        - auth_id_missing
        - invalid_password
        - disabled_user
        - tc_not_accepted
        - evicted
        - unauthorized
        - bad_request
        - not_found
        - forbidden
        - gone
        - payload_too_large
        - service_unavailable
        - internal_error

````