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

# List scans

> Returns scans for a repository/ref with an optional commit SHA filter. Use this to check whether a scan for a given commit has finished and what its status is.



## OpenAPI

````yaml https://app.cysmiq.com/docs/tenant/openapi.json get /{tenant_slug}/scans
openapi: 3.1.0
info:
  title: Cysmiq
  version: v1
  description: Tenant API
servers:
  - url: https://app.cysmiq.com/api/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Token
    description: Token introspection and authentication context.
  - name: Organizations
    description: Read-only organizational unit (org) data.
  - name: Repositories
    description: Read-only repository data.
  - name: Applications
    description: Read-only application data.
  - name: Scans
    description: Read-only scan status data for CI integrations.
  - name: Vulnerabilities
    description: Read-only vulnerability data for CI and reporting.
  - name: Policy Violations
    description: Read-only policy violation data for CI and reporting.
paths:
  /{tenant_slug}/scans:
    get:
      tags:
        - Scans
      summary: List scans
      description: >-
        Returns scans for a repository/ref with an optional commit SHA filter.
        Use this to check whether a scan for a given commit has finished and
        what its status is.
      operationId: listScans
      parameters:
        - name: repo
          in: query
          required: true
          schema:
            type: string
            maxLength: 255
        - name: ref
          in: query
          schema:
            type:
              - string
              - 'null'
            maxLength: 255
        - name: sha
          in: query
          schema:
            type:
              - string
              - 'null'
            pattern: ^[0-9a-fA-F]{7,40}$
        - name: status
          in: query
          schema:
            type:
              - string
              - 'null'
            maxLength: 255
        - name: limit
          in: query
          schema:
            type:
              - integer
              - 'null'
            minimum: 1
            maximum: 200
        - name: cursor
          in: query
          schema:
            type:
              - string
              - 'null'
        - name: tenant_slug
          in: path
          required: true
          description: Workspace slug for the tenant context.
          schema:
            type: string
          example: acme
      responses:
        '200':
          description: Scan list response.
          content:
            application/json:
              schema:
                type: object
                examples:
                  - repository:
                      id: repo_01hxyz
                      full_name: acme/widgets
                    reference:
                      ref: main
                      sha: a1b2c3d4
                    filters:
                      sha: a1b2c3d4
                      status:
                        - completed
                    summary:
                      total: 1
                      by_status:
                        completed: 1
                    items:
                      - id: scan_01hxyz
                        status: completed
                        result:
                          source: pr_evaluation
                          status: failure
                          conclusion: failure
                          label: PR failed
                          summary: 2 introduced/reopened actionable findings
                          context: Cysmiq PR Assessment
                          evaluation_id: pre_01hxyz
                          evaluation_key: repo_01hxyz:refs/pull/12/head:a1b2c3d4
                          target_id: pret_01hxyz
                          result_version: 3
                          status_reason: null
                          counts:
                            introduced: 2
                            reopened: 0
                            introduced_actionable: 2
                            fixed: 1
                            persisted: 4
                        ref: main
                        sha: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
                        started_at: '2026-01-14T17:40:00Z'
                        finished_at: '2026-01-14T17:45:00Z'
                    next_cursor: null
                properties:
                  repository:
                    type: object
                    properties:
                      id:
                        type: string
                      full_name:
                        type:
                          - string
                          - 'null'
                    required:
                      - id
                      - full_name
                  reference:
                    type:
                      - object
                      - 'null'
                    properties:
                      ref:
                        type: string
                      sha:
                        type:
                          - string
                          - 'null'
                    required:
                      - ref
                      - sha
                  filters:
                    type: object
                    properties:
                      sha: {}
                      status:
                        type:
                          - array
                          - 'null'
                        items:
                          type: string
                    required:
                      - sha
                      - status
                  summary:
                    type: object
                    properties:
                      total:
                        type: string
                      by_status:
                        type: string
                    required:
                      - total
                      - by_status
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        status:
                          anyOf:
                            - type: string
                            - type: 'null'
                        result: {}
                        ref:
                          type:
                            - string
                            - 'null'
                        sha:
                          type:
                            - string
                            - 'null'
                        started_at:
                          type: string
                        finished_at:
                          type: string
                      required:
                        - id
                        - status
                        - result
                        - ref
                        - sha
                        - started_at
                        - finished_at
                  next_cursor:
                    type: string
                required:
                  - repository
                  - reference
                  - filters
                  - summary
                  - items
                  - next_cursor
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationFailedError'
        '429':
          $ref: '#/components/responses/RateLimitedError'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailableError'
components:
  responses:
    UnauthorizedError:
      description: Authentication is required or the token is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            authenticationRequired:
              value:
                code: AUTHENTICATION_REQUIRED
                message: Unauthenticated.
    ForbiddenError:
      description: The token is authenticated but not permitted for this tenant or action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            tokenInvalidForTenant:
              value:
                code: TOKEN_INVALID_FOR_TENANT
                message: Token not valid for this tenant.
            tokenAbilityDenied:
              value:
                code: TOKEN_ABILITY_DENIED
                message: Forbidden.
    NotFoundError:
      description: The workspace or requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            tenantNotFound:
              value:
                code: TENANT_NOT_FOUND
                message: Workspace not found
            resourceNotFound:
              value:
                code: RESOURCE_NOT_FOUND
                message: Not found.
    ValidationFailedError:
      description: >-
        The request could not be processed because validation failed or filter
        values were unsupported.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            validationFailed:
              value:
                code: VALIDATION_FAILED
                message: The given data was invalid.
                details:
                  errors:
                    severity:
                      - The selected severity is invalid.
            invalidFilterValue:
              value:
                code: INVALID_FILTER_VALUE
                message: 'Invalid filter value(s): critical'
                details:
                  invalid_values:
                    - critical
    RateLimitedError:
      description: The request exceeded the tenant API rate limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            rateLimited:
              value:
                code: RATE_LIMITED
                message: Too Many Attempts.
    InternalError:
      description: The server encountered an unexpected error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            internalError:
              value:
                code: INTERNAL_ERROR
                message: Internal server error
    ServiceUnavailableError:
      description: The workspace or service is temporarily unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
          examples:
            serviceUnavailable:
              value:
                code: SERVICE_UNAVAILABLE
                message: Service Unavailable
  schemas:
    ApiError:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable error message.
        details:
          type: object
          description: Optional structured error details.
          additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      description: 'Use a Cysmiq API token in the Authorization header: Bearer {token}.'
      scheme: bearer
      bearerFormat: Token

````