> ## 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 Secrets Scan Results

> Retrieves the secrets scanning results for a specific repository and commit



## OpenAPI

````yaml /openapi.json post /api/analysis/results/secrets
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/results/secrets:
    post:
      tags:
        - Analysis
      summary: Get Secrets Scan Results
      description: >-
        Retrieves the secrets scanning results for a specific repository and
        commit
      operationId: getSecretsResults
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecretsRequest'
            examples:
              github:
                summary: GitHub repository example
                value:
                  repo: owner/repository
                  commit_id: abc123def456
                  access_token: ghp_xxxxxxxxxxxx
                  service: github
      responses:
        '200':
          description: Secrets scan results retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecretsResponse'
              example:
                results:
                  secrets:
                    - type: Secret Keyword
                      filename: /mnt/lambda/owner/repository/abc123def456/src/config.py
                      hashed_secret: 9d4e1e23bd5b727046a9e3b4b7db57bd8d6ee684
                      is_verified: false
                      line_number: 14
                      confidence_score: FALSE_POSITIVE
                  secretsCount: 1
                status: done
                commit_id: abc123def456
        '401':
          description: Invalid access token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Access token invalid
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Error retrieving secrets scan results
components:
  schemas:
    SecretsRequest:
      type: object
      required:
        - repo
        - access_token
        - service
      properties:
        repo:
          type: string
          description: Repository identifier (format varies by service)
          example: owner/repository
        commit_id:
          type: string
          description: >-
            Git commit SHA or identifier. Either commit_id or branch is
            required. If both are provided, commit_id takes precedence.
          example: abc123def456
        branch:
          type: string
          description: >-
            Git branch name. When provided without commit_id, the service
            resolves the latest commit from scan history for this branch. Either
            commit_id or branch is required.
          example: main
        access_token:
          type: string
          description: Authentication token for the service
          example: ghp_xxxxxxxxxxxx
        service:
          type: string
          description: Version control service provider
          enum:
            - github
            - azuredevops
            - gitlab
            - bitbucket
          example: github
        gitlab_base_url:
          type: string
          description: Base URL for the service (optional for GitHub, required for GitLab)
          example: https://gitlab.com
    SecretsResponse:
      type: object
      description: >-
        Secrets scanning response containing detected secrets and sensitive
        information
      properties:
        results:
          type: object
          description: Secrets scanning results
          properties:
            secrets:
              type: array
              description: List of secrets detected
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: Type of secret detected
                    example: Secret Keyword
                  filename:
                    type: string
                    description: Full file path where secret was found
                    example: /mnt/lambda/owner/repository/abc123def456/src/config.py
                  hashed_secret:
                    type: string
                    description: SHA-1 hash of the detected secret
                    example: 9d4e1e23bd5b727046a9e3b4b7db57bd8d6ee684
                  is_verified:
                    type: boolean
                    description: Whether the secret has been verified
                    example: false
                  line_number:
                    type: integer
                    description: Line number where secret was found
                    example: 14
                  confidence_score:
                    type: string
                    description: Confidence level of the detection
                    enum:
                      - TRUE_POSITIVE
                      - FALSE_POSITIVE
                      - UNKNOWN
                    example: FALSE_POSITIVE
            secretsCount:
              type: integer
              description: Total number of secrets found
              example: 1
        status:
          type: string
          description: Status of the secrets scan
          enum:
            - pending
            - processing
            - done
            - failed
          example: done
        commit_id:
          type: string
          description: Git commit SHA that was analyzed
          example: abc123def456
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message

````