> ## 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 the labels of a single repository.

> # Access control rules

- The requester must be:
  - an admin or a client
  - a reviewer if the repository is a collaborative reviewer
  - a triager if the repository is a bounty
  - a judge if the reppository is a competition



## OpenAPI

````yaml PATCH /api/v0/repositories/{repo_id}/labels
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}/labels:
    patch:
      tags:
        - repositories
      summary: Update the labels of a single repository.
      description: |-
        # Access control rules

        - The requester must be:
          - an admin or a client
          - a reviewer if the repository is a collaborative reviewer
          - a triager if the repository is a bounty
          - a judge if the reppository is a competition
      operationId: update_repo_labels
      parameters:
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/UpdateRepositoryLabel'
        required: true
      responses:
        '204':
          description: Repository 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
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    UpdateRepositoryLabel:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/NewLabel'
              description: Create a new label for a repository.
            - type: object
              required:
                - action
              properties:
                action:
                  type: string
                  enum:
                    - create
          description: Create a new label for a repository.
        - allOf:
            - $ref: '#/components/schemas/UpdateLabel'
              description: Update existing repository label.
            - type: object
              required:
                - action
              properties:
                action:
                  type: string
                  enum:
                    - update
          description: Update existing repository label.
        - type: object
          description: Archive existing label from repository.
          required:
            - id
            - action
          properties:
            id:
              type: string
              format: uuid
            action:
              type: string
              enum:
                - archive
      description: Delete or add labels to a repository.
    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.
    NewLabel:
      type: object
      required:
        - name
        - color
        - reviewerRead
        - reviewerUse
      properties:
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        color:
          $ref: '#/components/schemas/ColorLabel'
        reviewerRead:
          type: boolean
          description: |-
            Reviewer can view the label when set on a finding.
            Note that admins, clients, judges and triagers can view all labels.
        reviewerUse:
          type: boolean
          description: >-
            Reviewer can set or remove the label from a finding.

            Note that admins, clients, judges and triagers can set and remove
            all

            labels.
    UpdateLabel:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
        name:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        color:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ColorLabel'
        reviewerRead:
          type:
            - boolean
            - 'null'
          description: |-
            Reviewer can view the label when set on a finding.
            Note that admins, clients, judges and triagers can view all labels.
        reviewerUse:
          type:
            - boolean
            - 'null'
          description: >-
            Reviewer can set or remove the label from a finding.

            Note that admins, clients, judges and triagers can set and remove
            all

            labels.
    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
    ColorLabel:
      type: string
      description: The color of a label
      enum:
        - red
        - yellow
        - purple
        - violet
        - blue
        - green
        - grey

````