> ## 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.

# Batch add company users to a repository.

> Adds multiple company users to a repository with role assignment based on repository type:

**Public and Private Competitions:**
- All company users (managers and members) become repository clients

**Collaborative Reviews and Bounties:**
- Company managers become repository admins
- Company members become repository clients

All users must be verified company users (not unverified_member) of the repository's company.
Users already in the repository are ignored.

# Access control rules

- Repository admin only. Requires repository admin permissions.



## OpenAPI

````yaml POST /api/v0/repositories/{repo_id}/add-company-users
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}/add-company-users:
    post:
      tags:
        - repositories
      summary: Batch add company users to a repository.
      description: >-
        Adds multiple company users to a repository with role assignment based
        on repository type:


        **Public and Private Competitions:**

        - All company users (managers and members) become repository clients


        **Collaborative Reviews and Bounties:**

        - Company managers become repository admins

        - Company members become repository clients


        All users must be verified company users (not unverified_member) of the
        repository's company.

        Users already in the repository are ignored.


        # Access control rules


        - Repository admin only. Requires repository admin permissions.
      operationId: batch_add_company_users
      parameters:
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchAddCompanyUsers'
        required: true
      responses:
        '204':
          description: Company users successfully added
        '400':
          description: Invalid input or no valid company users found
          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 adding users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    BatchAddCompanyUsers:
      type: object
      description: Request to batch add company users to a repository
      required:
        - companyUserIds
      properties:
        companyUserIds:
          type: array
          items:
            type: string
            format: uuid
          description: Array of company users ids to add to the repository
          uniqueItems: true
    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

````