> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Scan History

> Retrieves the scan history for a repository, returning the last analysis results for each commit that has been scanned



## OpenAPI

````yaml /openapi.json post /api/analysis/scan-history
openapi: 3.0.3
info:
  title: CodeAnt AI API
  description: >-
    API for code analysis (SAST, SCA, secrets, IaC) and developer productivity
    metrics. Supports GitHub, GitLab, Bitbucket, and Azure DevOps.
  version: 1.0.0
servers:
  - url: https://api.codeant.ai
    description: Production server
security: []
tags:
  - name: Analysis
    description: Code analysis operations
  - name: Agent Analysis
    description: >-
      AI-powered agent analysis operations. Uses LLM-based code exploration
      agents to perform deep security threat hunting, bug finding, and custom
      analysis with reflection-based false positive filtering.
  - name: Developer Metrics — Teams
    description: >-
      Manage developer teams: create, update, delete teams and manage team
      membership. Teams are used to organize developers and scope metrics.
  - name: Developer Metrics
    description: >-
      Developer productivity and activity metrics: active developers, PR
      throughput, individual comparisons, and AI-generated summaries. All
      endpoints support GitHub, GitLab, Bitbucket, and Azure DevOps.
paths:
  /api/analysis/scan-history:
    post:
      tags:
        - Analysis
      summary: Get Scan History
      description: >-
        Retrieves the scan history for a repository, returning the last analysis
        results for each commit that has been scanned
      operationId: getScanHistory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanHistoryRequest'
            examples:
              github:
                summary: GitHub repository example
                value:
                  repo: owner/repository
                  platform: github
                  org: owner
                  github_base_url: https://github.com
              gitlab:
                summary: GitLab repository example
                value:
                  repo: group/repository
                  platform: gitlab
                  org: group
                  gitlab_base_url: https://gitlab.com
              azuredevops:
                summary: Azure DevOps repository example
                value:
                  repo: organization/project/repository
                  platform: azuredevops
                  org: organization
                  azure_devops_base_url: https://dev.azure.com
      responses:
        '200':
          description: Scan history retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanHistoryResponse'
              example:
                repo: owner/repository
                last_analysis_results:
                  - commit_id: abc123def456
                    branch: main
                    timestamp: '2025-01-15T10:30:00Z'
                    status: completed
        '400':
          description: Missing required parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: 'Missing required parameter: repo'
        '401':
          description: Invalid or missing access token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: >-
                  Access token invalid or does not have access to this
                  organization
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Internal server error
      security:
        - BearerAuth: []
components:
  schemas:
    ScanHistoryRequest:
      type: object
      required:
        - repo
        - platform
        - org
      properties:
        repo:
          type: string
          description: Repository identifier (format varies by platform)
          example: owner/repository
        platform:
          type: string
          description: Version control platform
          enum:
            - github
            - azuredevops
            - gitlab
            - bitbucket
          example: github
        org:
          type: string
          description: Organization or workspace name
          example: owner
        github_base_url:
          type: string
          description: GitHub base URL (for self-hosted instances)
          default: https://github.com
        gitlab_base_url:
          type: string
          description: GitLab base URL (for self-hosted instances)
          default: https://gitlab.com
        azure_devops_base_url:
          type: string
          description: Azure DevOps base URL
          default: https://dev.azure.com
        bitbucket_base_url:
          type: string
          description: Bitbucket base URL (for self-hosted instances)
          default: https://api.bitbucket.org/2.0
    ScanHistoryResponse:
      type: object
      properties:
        repo:
          type: string
          description: Repository identifier
        last_analysis_results:
          type: array
          description: List of last analysis results for each scanned commit
          items:
            type: object
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Access token for the git provider (GitHub PAT, GitLab PAT, Bitbucket App
        Password, Azure DevOps PAT). Pass via `Authorization: Bearer <token>`
        header.

````