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

> # Access control rules

- The requester must be an repository admin or client.



## OpenAPI

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

        - The requester must be an repository admin or client.
      operationId: update_repo
      parameters:
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRepository'
        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:
    UpdateRepository:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
        engagementId:
          type:
            - string
            - 'null'
          format: uuid
        timeframe:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RangeFromDateTime'
        kind:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RepositoryKind'
        status:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RepositoryStatus'
        currencyCode:
          type:
            - string
            - 'null'
        totalRewardPot:
          type:
            - string
            - 'null'
        primaryPot:
          type:
            - string
            - 'null'
        additionalPotSplit:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/AdditionalReward'
        stakeAmount:
          type:
            - string
            - 'null'
        submissionFee:
          type:
            - string
            - 'null'
        assetGroups:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/UpdateRepositoryAssetGroup'
        safeHarbor:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/UpdateSafeHarbor'
        instructions:
          type:
            - string
            - 'null'
        allowedSeverities:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/FindingSeverity'
        consideredSeverities:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/FindingSeverity'
        pointCalculation:
          type:
            - string
            - 'null'
          format: uuid
        allowedLabels:
          type: array
          items:
            $ref: '#/components/schemas/UpdateRepositoryLabel'
        showAllFindings:
          type:
            - boolean
            - 'null'
          description: Show all findings to researchers during judging and escalations
        publicMetadata:
          type:
            - boolean
            - 'null'
        kycRequired:
          type:
            - boolean
            - 'null'
        companyUserAccess:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RepositoryCompanyUserAccess'
        requiredCtfAddress:
          type:
            - string
            - 'null'
    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.
    RangeFromDateTime:
      type: object
      description: Represent a range where the start is always set but the end is optional.
      required:
        - start
      properties:
        start:
          type: string
          format: date-time
        end:
          type:
            - string
            - 'null'
          format: date-time
    RepositoryKind:
      type: string
      enum:
        - scoping
        - collaborative_review
        - private_contest
        - public_contest
        - private_bounty
        - public_bounty
    RepositoryStatus:
      type: string
      description: Status of a repository.
      enum:
        - draft
        - upcoming
        - live
        - judging
        - escalations
        - escalations_ended
        - complete
        - published
    AdditionalReward:
      type: object
      description: Additional reward in a [`Repository`].
      required:
        - teamId
        - amount
        - isTip
      properties:
        teamId:
          type: string
          format: uuid
          description: The repository team to award it to.
        amount:
          type: string
          description: Amount of the reward.
        isTip:
          type: boolean
          description: |-
            Whether or not it's considered a tip.
            If so, it will be exlcuded from the `additional_pot` value.
    UpdateRepositoryAssetGroup:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/NewAssetGroup'
              description: Create a new asset group.
            - type: object
              required:
                - action
              properties:
                action:
                  type: string
                  enum:
                    - create
          description: Create a new asset group.
        - allOf:
            - $ref: '#/components/schemas/UpdateAssetGroup'
              description: Update an existing asset group.
            - type: object
              required:
                - action
              properties:
                action:
                  type: string
                  enum:
                    - update
          description: Update an existing asset group.
        - type: object
          description: Delete an existing asset group from repository.
          required:
            - id
            - action
          properties:
            id:
              type: string
              format: uuid
            action:
              type: string
              enum:
                - delete
        - type: object
          description: Create a new subgroup.
          required:
            - assetGroupId
            - subGroup
            - action
          properties:
            assetGroupId:
              type: string
              format: uuid
            subGroup:
              $ref: '#/components/schemas/NewAssetSubGroup'
            action:
              type: string
              enum:
                - create_sub_group
        - allOf:
            - $ref: '#/components/schemas/UpdateAssetSubGroup'
              description: Update an existing subgroup.
            - type: object
              required:
                - action
              properties:
                action:
                  type: string
                  enum:
                    - update_sub_group
          description: Update an existing subgroup.
        - type: object
          description: Delete an existing subgroup.
          required:
            - id
            - action
          properties:
            id:
              type: string
              format: uuid
            action:
              type: string
              enum:
                - delete_sub_group
        - type: object
          description: Move a subgroup to another asset group.
          required:
            - id
            - assetGroupId
            - action
          properties:
            id:
              type: string
              format: uuid
            assetGroupId:
              type: string
              format: uuid
              description: Asset group to move the subgroup into.
            action:
              type: string
              enum:
                - move_sub_group
        - type: object
          description: Create an asset in an existing asset group.
          required:
            - assetGroupId
            - asset
            - action
          properties:
            assetGroupId:
              type: string
              format: uuid
            asset:
              $ref: '#/components/schemas/NewAsset'
            action:
              type: string
              enum:
                - create_asset
        - type: object
          description: Move an asset to another asset group or subgroup.
          required:
            - id
            - assetGroupId
            - action
          properties:
            id:
              type: string
              format: uuid
            assetGroupId:
              type: string
              format: uuid
              description: Asset group to move the asset into.
            action:
              type: string
              enum:
                - move_asset
        - allOf:
            - $ref: '#/components/schemas/UpdateAsset'
              description: Update an existing asset part of a group or subgroup.
            - type: object
              required:
                - action
              properties:
                action:
                  type: string
                  enum:
                    - update_asset
          description: Update an existing asset part of a group or subgroup.
        - type: object
          description: Delete existing asset from an asset group in repository.
          required:
            - id
            - action
          properties:
            id:
              type: string
              format: uuid
            action:
              type: string
              enum:
                - delete_asset
        - type: object
          description: Replace asset group rewards.
          required:
            - assetGroupId
            - rewards
            - action
          properties:
            assetGroupId:
              type: string
              format: uuid
            rewards:
              type: array
              items:
                $ref: '#/components/schemas/NewAssetGroupReward'
            action:
              type: string
              enum:
                - replace_asset_group_reward
      description: Update asset groups.
    UpdateSafeHarbor:
      type: object
      required:
        - description
        - reward
        - returnAddresses
      properties:
        description:
          type: string
        cap:
          type:
            - string
            - 'null'
        reward:
          type: string
        returnAddresses:
          type: array
          items:
            $ref: '#/components/schemas/UpdateSafeHarborReturnAddress'
        assets:
          type: array
          items:
            $ref: '#/components/schemas/UpdateSafeHarborAsset'
    FindingSeverity:
      type: string
      description: Severity of a [`Finding`].
      enum:
        - critical
        - high
        - medium
        - low
        - informational
        - gas_optimization
    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.
    RepositoryCompanyUserAccess:
      type: string
      description: Company user access level for a repository.
      enum:
        - open
        - restricted
    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
    NewAssetGroup:
      type: object
      required:
        - name
        - description
        - outOfScope
        - rewards
        - assets
      properties:
        name:
          type: string
        description:
          type: string
        outOfScope:
          type: boolean
        rewards:
          type: array
          items:
            $ref: '#/components/schemas/NewAssetGroupReward'
        assets:
          type: array
          items:
            $ref: '#/components/schemas/NewAsset'
        subGroups:
          type: array
          items:
            $ref: '#/components/schemas/NewAssetSubGroup'
    UpdateAssetGroup:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
        name:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        outOfScope:
          type:
            - boolean
            - 'null'
    NewAssetSubGroup:
      type: object
      required:
        - name
        - assets
      properties:
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        assets:
          type: array
          items:
            $ref: '#/components/schemas/NewAsset'
    UpdateAssetSubGroup:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
        name:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
    NewAsset:
      type: object
      required:
        - name
        - description
      properties:
        name:
          type: string
        description:
          type: string
        reference:
          type: string
    UpdateAsset:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
        name:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        reference:
          type:
            - string
            - 'null'
    NewAssetGroupReward:
      type: object
      required:
        - severity
      properties:
        severity:
          $ref: '#/components/schemas/FindingSeverity'
        minReward:
          type:
            - string
            - 'null'
        maxReward:
          type:
            - string
            - 'null'
    UpdateSafeHarborReturnAddress:
      oneOf:
        - type: object
          required:
            - address
            - chain
            - action
          properties:
            address:
              type: string
            chain:
              $ref: '#/components/schemas/SafeHarborAddressChain'
            action:
              type: string
              enum:
                - create
        - type: object
          required:
            - id
            - address
            - chain
            - action
          properties:
            id:
              type: string
              format: uuid
            address:
              type: string
            chain:
              $ref: '#/components/schemas/SafeHarborAddressChain'
            action:
              type: string
              enum:
                - update
    UpdateSafeHarborAsset:
      oneOf:
        - type: object
          required:
            - name
            - description
            - action
          properties:
            name:
              type: string
            description:
              type: string
            action:
              type: string
              enum:
                - create
        - type: object
          required:
            - id
            - name
            - description
            - action
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            description:
              type: string
            action:
              type: string
              enum:
                - update
    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.
    SafeHarborAddressChain:
      type: string
      enum:
        - ethereum
        - bsc
        - polygon
        - arbitrum
        - optimism
        - base
        - avalanche_c
        - polygon_zk_evm
        - gnosis
        - zk_sync
    ColorLabel:
      type: string
      description: The color of a label
      enum:
        - red
        - yellow
        - purple
        - violet
        - blue
        - green
        - grey

````