> ## 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.
  - name: Audit Logs
    description: >-
      Read-only access to your organization's audit trail for compliance, ETL
      and SIEM ingestion. Events are immutable, retained for 180 days, and cover
      security-relevant actions: user management, access control, credentials,
      scan triggers, configuration changes and data exports. Secrets and tokens
      are redacted and never appear in any response format.
  - name: Container Scanning
    description: >-
      Container image vulnerability scanning across AWS ECR, Azure ACR, and GCP
      GAR registries. List tracked containers with their latest scan, then fetch
      the full vulnerability findings of a scan — the same data shown on the
      Cloud Security → Container Scanning page. Authenticate with a CodeAnt API
      token (requires the `view_cloud_security: read` permission when token
      scoping is configured).
  - name: Security Hotlist
    description: >-
      The organization-wide security Hotlist: every SCA, SAST, secrets, IaC,
      cloud (CSPM) and AI-exploitation finding, deduplicated and priority-scored
      into one ranked list with live ticket, assignee and SLA state. Query it
      with filters, facets and cursor pagination, or export the full filtered
      list as an Excel workbook. Authenticate with a CodeAnt API token (requires
      the `view_code_security: read` permission when token scoping is
      configured).
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: >-
        CodeAnt API token (`cdt_...`), created on the Settings → API Tokens
        page. Pass via `Authorization: Bearer <token>` header.

````