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

# Get the leaderboard for the competition (per team)

> # Access control rules

- Unauthenticated requests can only view leaderboard for completed or published public contests.
- Otherwise the requester must have access to the repository.



## OpenAPI

````yaml GET /api/v0/repositories/{repo_id}/leaderboard/teams
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}/leaderboard/teams:
    get:
      tags:
        - repositories
      summary: Get the leaderboard for the competition (per team)
      description: >-
        # Access control rules


        - Unauthenticated requests can only view leaderboard for completed or
        published public contests.

        - Otherwise the requester must have access to the repository.
      operationId: teams_leaderboard
      parameters:
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Repository leaderboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryLeaderboard'
        '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: Leaderboard not available or repository doesn't exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
        '500':
          description: Error accessing leaderboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    RepositoryLeaderboard:
      type: object
      description: Competition specific leaderboard.
      required:
        - ranking
      properties:
        ranking:
          type: array
          items:
            $ref: '#/components/schemas/RepositoryLeaderboardRanking'
          description: Ranking of each team, ordered by reward, then findings found.
    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.
    RepositoryLeaderboardRanking:
      type: object
      description: Ranking of a reviewing on the [`RepositoryLeaderboard`].
      required:
        - position
        - team
        - criticalFindings
        - highFindings
        - mediumFindings
        - lowFindings
        - informationalFindings
        - gasOptimizationFindings
      properties:
        position:
          type: integer
          format: int64
        team:
          $ref: '#/components/schemas/RepositoryTeam'
        reward:
          type:
            - string
            - 'null'
          description: >-
            Reward may be null if the auditor only participated in competitions
            that

            have no (monetary) rewards.
        criticalFindings:
          type: integer
          format: int32
        highFindings:
          type: integer
          format: int32
        mediumFindings:
          type: integer
          format: int32
        lowFindings:
          type: integer
          format: int32
        informationalFindings:
          type: integer
          format: int32
        gasOptimizationFindings:
          type: integer
          format: int32
    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
    RepositoryTeam:
      type: object
      description: Team participating in a repository.
      required:
        - id
        - members
      properties:
        id:
          type: string
          format: uuid
          description: Id of the team.
        name:
          type:
            - string
            - 'null'
          description: |-
            Name of the team.

            This only will have a value if the reviewer is participating with a
            team, i.e. for solos this will be null.
        handle:
          type:
            - string
            - 'null'
          description: |-
            Handle of the team.

            Similar to the name, this will be null for solo teams.
        members:
          type: array
          items:
            $ref: '#/components/schemas/RepositoryTeamMember'
        badges:
          type: array
          items:
            $ref: '#/components/schemas/Badge'
          description: Aggregate of the members badges.
    RepositoryTeamMember:
      type: object
      description: Team member that is a part of a repository team.
      required:
        - id
        - name
        - username
        - avatar
        - role
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        username:
          type: string
        avatar:
          type: string
        role:
          $ref: '#/components/schemas/TeamMemberRole'
        createdAt:
          type: string
          format: date-time
    Badge:
      type: object
      required:
        - id
        - name
        - image
        - description
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        image:
          type: string
        description:
          type: string
    TeamMemberRole:
      type: string
      description: Role of a user in a team.
      enum:
        - leader
        - member
        - invited

````