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

# Allows an auditor, who is a team leader to join a repository as a team.

> Admins can also use this route to invite a given team to join a repository.
Note: The team leader directly becomes a member of the team, while an invite is
created for other team members, which they need to accept to become a member.

# Access control rules

- The requester must be an admin or an auditor who is a team leader.
- The repository being joined must be a public content or public bounty and
  status is either upcoming or live.



## OpenAPI

````yaml POST /api/v0/repositories/{repo_id}/join-team
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}/join-team:
    post:
      tags:
        - repositories
      summary: Allows an auditor, who is a team leader to join a repository as a team.
      description: >-
        Admins can also use this route to invite a given team to join a
        repository.

        Note: The team leader directly becomes a member of the team, while an
        invite is

        created for other team members, which they need to accept to become a
        member.


        # Access control rules


        - The requester must be an admin or an auditor who is a team leader.

        - The repository being joined must be a public content or public bounty
        and
          status is either upcoming or live.
      operationId: join_public_repository_as_team
      parameters:
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JoinRepoAsTeam'
        required: true
      responses:
        '204':
          description: Team successfully joined
          headers:
            Location:
              schema:
                type: string
              description: The location where the repository team can be found
        '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 joining repository
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    JoinRepoAsTeam:
      type: object
      required:
        - teamId
      properties:
        teamId:
          type: string
          format: uuid
        invites:
          type: array
          items:
            type: string
            format: uuid
    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

````