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

# Insights for a single repository.

> # Access control rules

- The requester must be a client, judge, triager or admin.



## OpenAPI

````yaml GET /api/v0/repositories/{repo_id}/insights
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}/insights:
    get:
      tags:
        - repositories
      summary: Insights for a single repository.
      description: |-
        # Access control rules

        - The requester must be a client, judge, triager or admin.
      operationId: repository_insights
      parameters:
        - name: since
          in: query
          description: |-
            Get the insights since a certain timestamp.

            Defaults to the entire lifetime of the repository.
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The repository's insights
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryInsights'
        '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: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CantinaError'
components:
  schemas:
    RepositoryInsights:
      type: object
      description: Insights into a repository.
      required:
        - criticalFindings
        - highFindings
        - mediumFindings
        - lowFindings
        - informationalFindings
        - gasOptimizationFindings
        - newFindings
        - inReviewFindings
        - disputedFindings
        - rejectedFindings
        - spamFindings
        - duplicateFindings
        - confirmedFindings
        - acknowledgedFindings
        - fixedFindings
        - withdrawnFindings
        - totalFindings
        - outline
        - reviewersJoined
        - reviewers
      properties:
        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
        newFindings:
          type: integer
          format: int32
        inReviewFindings:
          type: integer
          format: int32
        disputedFindings:
          type: integer
          format: int32
        rejectedFindings:
          type: integer
          format: int32
        spamFindings:
          type: integer
          format: int32
        duplicateFindings:
          type: integer
          format: int32
        confirmedFindings:
          type: integer
          format: int32
        acknowledgedFindings:
          type: integer
          format: int32
        fixedFindings:
          type: integer
          format: int32
        withdrawnFindings:
          type: integer
          format: int32
        totalFindings:
          type: integer
          format: int32
        totalRewards:
          type:
            - string
            - 'null'
          description: Total rewards assigned to findings in the repository.
        outline:
          $ref: '#/components/schemas/RepositoryFindingsOutline'
          description: Outline of the findings over status and severity
        avgResponseSeconds:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            Number of seconds it takes to get a response to a new finding on

            average.


            This will be null if the repository has no findings, or it has
            findings,

            but they have not yet received any feedback (a change or a comment).
        reviewersJoined:
          type: integer
          format: int32
        reviewers:
          type: array
          items:
            $ref: '#/components/schemas/RepositoryUser'
    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.
    RepositoryFindingsOutline:
      type: object
      description: Outline of the findings in a repository by status and severity
      additionalProperties:
        $ref: '#/components/schemas/RepositoryFindingsOutlineBySeverity'
      propertyNames:
        type: string
        description: |-
          Status of a [`Finding`].
          Note that the `in_review` status is only applicable within bounties.
        enum:
          - new
          - in_review
          - disputed
          - rejected
          - spam
          - duplicate
          - confirmed
          - acknowledged
          - fixed
          - withdrawn
    RepositoryUser:
      type: object
      description: User data in the context of a repository.
      required:
        - userId
        - name
        - username
        - repositoryRole
        - avatar
        - isBot
        - createdAt
      properties:
        userId:
          type: string
          format: uuid
          description: User id, not to be confused with a client id.
        name:
          type: string
        username:
          type: string
        teamId:
          type:
            - string
            - 'null'
          format: uuid
          description: |-
            Id of the team the reviewer is a part of.

            For non-reviewers, this will be null.
        pingsLeft:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Number of times the reviewer can ping the client.


            Visible to admins, company users, and reviewers only when viewing
            their own info.


            For non-reviewers, this will be null.
        reputation:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            Reputation of an auditor, always in the range of `0..=100`.


            Visible to admins, clients, judges and triagers only. Only returned
            in the

            finding's creator field (`Finding.created_by.reputation`), not in
            other

            places.


            For non-reviewers, this will be null.
        repositoryRole:
          $ref: '#/components/schemas/RepositoryRole'
        avatar:
          type: string
        isBot:
          type: boolean
        createdAt:
          type: string
          format: date-time
        disabledAt:
          type:
            - string
            - 'null'
          format: date-time
          description: User is disabled and doesn't have access to Cantina any more.
        deletedFromRepoAt:
          type:
            - string
            - 'null'
          format: date-time
          description: User is deleted from the repository.
    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
    RepositoryFindingsOutlineBySeverity:
      type: object
      description: Outline of the findings in a repository by severity
      required:
        - total
        - severities
      properties:
        total:
          type: integer
          format: int32
        severities:
          type: object
          description: Outline by severity
          additionalProperties:
            type: integer
            format: int32
          propertyNames:
            type: string
            description: Severity of a [`Finding`].
            enum:
              - critical
              - high
              - medium
              - low
              - informational
              - gas_optimization
    RepositoryRole:
      type: string
      description: Role of a user in the context of a repository.
      enum:
        - client
        - reviewer
        - judge
        - triager
        - admin

````