> ## 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 repository access for a company user.

> # Access control rules

- Company manager of the company.
- Admins can list all companies. Requires `manage_companies` permissions.



## OpenAPI

````yaml PATCH /api/v0/companies/{company_id}/user/{user_id}/repositories
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/companies/{company_id}/user/{user_id}/repositories:
    patch:
      tags:
        - companies
      summary: Update the repository access for a company user.
      description: >-
        # Access control rules


        - Company manager of the company.

        - Admins can list all companies. Requires `manage_companies`
        permissions.
      operationId: update_company_user_repositories_access
      parameters:
        - name: company_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: List of company repositories the users should be a part of
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCompanyUserRepositoryAccess'
        required: true
      responses:
        '204':
          description: Updated the repositories access
        '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'
        '500':
          description: Error retrieving company repositories
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    UpdateCompanyUserRepositoryAccess:
      type: object
      required:
        - repositories
      properties:
        repositories:
          type: array
          items:
            type: string
            format: uuid
          description: Repositories the user is part of
    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.
    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

````