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

# Update collaborator access

> Change a user's access level to the repo



## OpenAPI

````yaml patch /repos/{repo_id}/collaborators/{user_id}
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /repos/{repo_id}/collaborators/{user_id}:
    parameters:
      - $ref: '#/components/parameters/RepoParam'
      - $ref: '#/components/parameters/UserIdParam'
    patch:
      tags:
        - Collaborators
      description: Change a user's access level to the repo
      operationId: src.handlers.collaboration.update_mode
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CollaborationRequest'
      responses:
        '200':
          $ref: '#/components/responses/OKEmpty'
      security:
        - OAuth2:
            - coreapi/read
        - OAuth2:
            - coreapi/write
components:
  parameters:
    RepoParam:
      in: path
      name: repo_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: >-
        The repo ID of the repository. Repo _name_ can be used instead of the
        ID, but usage of ID for permanent linking and API requests is preferred.
    UserIdParam:
      in: path
      name: user_id
      schema:
        type: string
        example: Google_1192874509253
        minLength: 3
      required: true
      description: A user's ID
  schemas:
    CollaborationRequest:
      type: object
      properties:
        mode:
          $ref: '#/components/schemas/AccessMode'
      required:
        - mode
    AccessMode:
      type: string
      enum:
        - READ
        - WRITE
        - ADMIN
        - OWNER
  responses:
    OKEmpty:
      description: Request completed successfully
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````