> ## 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 user information in the context of a repository.

> # Access control rules

- The requester must have access to the repository, they can update their
  own information.
- Repository admins can update any users' information.



## OpenAPI

````yaml PATCH /api/v0/repositories/{repo_id}/users/{user_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}/users/{user_id}:
    patch:
      tags:
        - repositories
      summary: Update the user information in the context of a repository.
      description: >-
        # Access control rules


        - The requester must have access to the repository, they can update
        their
          own information.
        - Repository admins can update any users' information.
      operationId: update_repo_user_info
      parameters:
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRepositoryUserInfo'
        required: true
      responses:
        '204':
          description: Update successful
        '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: Repository not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '500':
          description: Error getting info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    UpdateRepositoryUserInfo:
      type: object
      description: Update User information in the context of a repository.
      properties:
        notificationInterest:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/NotificationInterest'
              description: |-
                When the interests are deleted it will use the user's default
                notification interest.
        notificationFrequency:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/NotificationFrequency'
              description: |-
                When the frequency is deleted it will use the user's default
                notification frequency.
        immediateNotificationFindingSeverity:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ImmediateNotificationFindingSeverity'
              description: >-
                Specifies whether the user wants to receive immediate
                notifications for findings with specific

                severities.
        repositoryRole:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/RepositoryRole'
              description: >-
                Role the user has in the repository.


                Allowed changes:


                | From     | To client | To judge | To triager | To reviewer |
                To admin            |

                | -------- | --------- | -------- | ---------- | ----------- |
                ------------------- |

                | Client   | No-op     | Ok       | Ok         | No          |
                Not in competitions |

                | Judge    | Ok        | No-op    | Ok         | No          |
                Yes                 |

                | Triager  | Ok        | Ok       | No-op      | No          |
                Yes                 |

                | Reviewer | No        | No       | No         | No-op       |
                No                  |

                | Admin    | Ok        | Ok       | Ok         | No          |
                No-op               |
        notificationFindingAssetGroupIds:
          type:
            - array
            - 'null'
          items:
            type: string
            format: uuid
          description: Asset group IDs for filtering finding notifications.
        notificationFindingSafeHarbor:
          type:
            - boolean
            - 'null'
          description: Safe harbor asset notification preference.
    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.
    NotificationInterest:
      type: object
      description: |-
        A user's interest in notifications.

        Note that these are *interests*, it doesn't mean the user will or can
        get notifications for all these events.
      required:
        - system
        - findingCreated
        - findingUpdated
        - commentsAll
        - commentsReply
        - assigned
      properties:
        system:
          type: boolean
          description: User gets a notification created by the Cantina system.
        findingCreated:
          type: boolean
          description: User gets a notification when a new finding is created.
        findingUpdated:
          type: boolean
          description: |-
            User gets a notification when a finding to which they have access is
            updated.
        commentsAll:
          type: boolean
          description: >-
            User gets a notification when a comment is made on a resource they

            have access to, for example a file or finding comment.


            NOTE: `COMMENTS_ALL` and `COMMENTS_REPLY` should be used together
            and

            be seen as a single option:

            * `COMMENTS_ALL` on/set: all comments.

            * `COMMENTS_ALL` off/not set: no notification on comment creation.

            * `COMMENTS_REPLY` on/set: notification on replies and pings.

            * `COMMENTS_REPLY` off/not set: no notifications about comments at
            all.
        commentsReply:
          type: boolean
          description: |-
            Users get a notification when a comment is made on a resource they
            are participating in, for example a reply to the user's comment.
            They will also get a notifications for pings.
        assigned:
          type: boolean
          description: |-
            Users get a notification when a resource, e.g. a finding, is
            assigned to them.
    NotificationFrequency:
      type: string
      description: How frequently notification digests emails are send.
      enum:
        - immediate
        - daily
        - default
    ImmediateNotificationFindingSeverity:
      type: object
      description: Per-severity immediate notification preferences for findings.
      required:
        - critical
        - high
        - medium
        - low
        - informational
        - gasOptimization
      properties:
        critical:
          type: boolean
        high:
          type: boolean
        medium:
          type: boolean
        low:
          type: boolean
        informational:
          type: boolean
        gasOptimization:
          type: boolean
    RepositoryRole:
      type: string
      description: Role of a user in the context of a repository.
      enum:
        - client
        - reviewer
        - judge
        - triager
        - admin
    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

````