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

# List Scans

> List scan jobs (source and hosted) ordered by `(created_at DESC, job_id DESC)` with **opaque cursor pagination**. Supports filtering by visibility, status, scan type, repository name, `source_url`, `source_version`, and vulnerability count. Use `latest_only=true` to collapse repeated scans of the same `(source_url, source_version)` to the newest row per combo.

## Pagination

```
GET /mcp-hub/scans?limit=20                       # first page
GET /mcp-hub/scans?limit=20&cursor=<next_cursor>  # subsequent pages
```

The response includes `next_cursor` (an opaque base64url string). Pass it back verbatim as the `cursor` query parameter to fetch the next page. When `next_cursor` is `null` you have reached the end of the result set. The cursor is treated as **opaque**; do not decode or construct it manually.

By default `total` is **not** returned. Pass `?include_total=true` to opt in — it costs a separate COUNT(\*) round-trip per request and is intended only for UIs that need a "Showing X of N" counter.

**Enterprise data-license feature:** requires MCP Hub API access enabled for your organization, otherwise returns `403`. Contact support@enkryptai.com.



## OpenAPI

````yaml GET /mcp-hub/scans
openapi: 3.0.0
info:
  title: Enkrypt AI APIs
  version: 2.0.0
servers:
  - url: https://api.enkryptai.com
security:
  - apiKeyAuth: []
tags:
  - name: Guardrails
  - name: Code of Conduct
  - name: Endpoints
  - name: Redteam
    description: >-
      Red Team API: submit red-team / threat-modeling / playground / eval runs,
      then poll run status, records, results and compliance. Also two-phase
      threat modeling (categories + data), dataset retrieval, model health,
      findings and risk mitigation. The previous task-based Red Team API is
      under **Archived**.
  - name: Deployments
  - name: AI Proxy
  - name: Leaderboard
  - name: Archived
  - name: MCP Hub
    description: >-
      MCP Hub vulnerability scanning APIs. Submitting scans (the POST endpoints)
      is open to all authenticated callers. The scan **retrieval** APIs — Get
      Scan Job Status, Get Complete Scan Results, List Scans, and Get MCP Hub
      Scan Statistics (the GET endpoints) — are an **enterprise data-license
      feature**: they require your organization to have MCP Hub API access
      enabled by Enkrypt, otherwise they return `403`. Contact us at
      support@enkryptai.com to enable access.
  - name: MCP Registry Servers
  - name: MCP Gateways
  - name: MCP Playground
  - name: Skill Scanner
    description: >-
      Skill Scanner APIs: submit an agent skill (a directory inside a git
      repository) for security scanning, then read the verdict, the risk level
      and the full report. Scanning is asynchronous — a scan takes roughly 30–90
      seconds, so `POST /skill-hub/scan` returns a `scan_id` you poll.


      You see your organization's scans and nobody else's. The identity comes
      from your API key, never from your request — sending `user_email` is a
      `400`.


      For an organization or project API key, scans are filed under the
      **organization**, so every member sees every scan the organization has
      run, whichever project or member submitted it. For an individual account
      it is simply your own scans. Either way List Skill Scans needs no
      parameter to say who you are.
  - name: Compliance
    description: >-
      Compliance APIs: connect a ChatGPT Enterprise workspace, then keep reading
      its compliance logs and scanning every message through one of your saved
      guardrails.


      Every endpoint here — reads as well as writes — requires the **governance
      officer** role on the project your API key belongs to. The organization
      owner is **not** exempt: an owner who has not been granted the role gets
      `403` like anyone else. An individual (non-organization) account cannot
      hold the role at all, so compliance is an organization-only feature today.


      A scan is addressed by name in the `X-Enkrypt-Scan` header, within the
      project its API key belongs to. Message text is never stored: Get
      Compliance Message fetches it live from the provider, and only while the
      provider still holds it.
paths:
  /mcp-hub/scans:
    get:
      tags:
        - MCP Hub
      summary: List Scans
      description: >-
        List scan jobs (source and hosted) ordered by `(created_at DESC, job_id
        DESC)` with **opaque cursor pagination**. Supports filtering by
        visibility, status, scan type, repository name, `source_url`,
        `source_version`, and vulnerability count. Use `latest_only=true` to
        collapse repeated scans of the same `(source_url, source_version)` to
        the newest row per combo.


        ## Pagination


        ```

        GET /mcp-hub/scans?limit=20                       # first page

        GET /mcp-hub/scans?limit=20&cursor=<next_cursor>  # subsequent pages

        ```


        The response includes `next_cursor` (an opaque base64url string). Pass
        it back verbatim as the `cursor` query parameter to fetch the next page.
        When `next_cursor` is `null` you have reached the end of the result set.
        The cursor is treated as **opaque**; do not decode or construct it
        manually.


        By default `total` is **not** returned. Pass `?include_total=true` to
        opt in — it costs a separate COUNT(\*) round-trip per request and is
        intended only for UIs that need a "Showing X of N" counter.


        **Enterprise data-license feature:** requires MCP Hub API access enabled
        for your organization, otherwise returns `403`. Contact
        support@enkryptai.com.
      operationId: mcp_hub_list_scans
      parameters:
        - in: query
          name: limit
          required: false
          description: Page size (max 200).
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
            example: 50
        - in: query
          name: cursor
          required: false
          description: >-
            Opaque pagination cursor returned by the previous response as
            `next_cursor`. Omit on the first page. Treat as opaque — do not
            decode or construct manually.
          schema:
            type: string
            maxLength: 4096
            example: >-
              eyJjcmVhdGVkX2F0IjoiMjAyNi0wNi0yNVQxMTozMjoxMS4xMjM0NTYrMDA6MDAiLCJqb2JfaWQiOiJhYmMtMTIzIn0
        - in: query
          name: include_total
          required: false
          description: >-
            When `true`, the response includes a `total` count of rows matching
            the filters. Costs an extra COUNT(\*) round-trip per page request;
            omit by default for cursor pagination's constant-time-per-page
            property.
          schema:
            type: boolean
            default: false
        - in: query
          name: is_official
          required: false
          description: >-
            Filter to only official scans (`true`) or only non-official
            (`false`). Omit for both.
          schema:
            type: boolean
        - in: query
          name: is_private
          required: false
          description: >-
            Filter to only private scans (`true`) or only public (`false`). Omit
            for both.
          schema:
            type: boolean
        - in: query
          name: job_status
          required: false
          description: Filter by job status
          schema:
            type: string
            enum:
              - initializing
              - downloading
              - discovering_tools
              - scanning_tools
              - completed
              - failed
              - connecting
              - discovering
              - analyzing
        - in: query
          name: repo_name
          required: false
          description: Case-insensitive substring match on repo / server name
          schema:
            type: string
            maxLength: 500
        - in: query
          name: scan_type
          required: false
          description: '`source` or `hosted`'
          schema:
            type: string
            enum:
              - source
              - hosted
        - in: query
          name: job_id
          required: false
          description: Exact job UUID match
          schema:
            type: string
            format: uuid
        - in: query
          name: source_url
          required: false
          description: Exact match on `source_url`.
          schema:
            type: string
            maxLength: 2000
        - in: query
          name: source_version
          required: false
          description: Exact match on `source_version` (npm version or git commit).
          schema:
            type: string
            maxLength: 200
        - in: query
          name: latest_only
          required: false
          description: >-
            When `true`, applies all other filters first, then dedupes results
            by `(source_url, source_version)`, keeping the newest row per group
            by `created_at`. Pagination applies to the deduped list and `total`
            reflects the deduped count. Intended for `scan_type=source`. Returns
            `400` if the filters would require dedupe over more than 5000
            matching rows.
          schema:
            type: boolean
            default: false
        - in: query
          name: total_vulnerabilities
          required: false
          description: Exact match on the scan's vulnerability count.
          schema:
            type: integer
            minimum: 0
        - in: query
          name: min_total_vulnerabilities
          required: false
          description: >-
            Inclusive lower bound on the vulnerability count
            (`total_vulnerabilities >= N`).
          schema:
            type: integer
            minimum: 0
        - in: query
          name: max_total_vulnerabilities
          required: false
          description: >-
            Inclusive upper bound on the vulnerability count
            (`total_vulnerabilities <= N`). A "fewer than 7 vulnerabilities"
            filter is `max_total_vulnerabilities=6`.
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: Paginated list of scans
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPHubScanListResponse'
        '400':
          description: >-
            The filters cannot be satisfied as given — either `latest_only=true`
            would require dedupe over more than 5000 matching rows, or
            `min_total_vulnerabilities` exceeds `max_total_vulnerabilities`.
            Narrow the filters and retry.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
              examples:
                latest_only_cap:
                  summary: latest_only dedupe cap exceeded
                  value:
                    detail: >-
                      latest_only requires fetching more than 5000 rows; please
                      narrow filters (e.g. source_url, scan_type, org_id).
                vulnerability_bounds_inverted:
                  summary: min_total_vulnerabilities above max_total_vulnerabilities
                  value:
                    detail: >-
                      min_total_vulnerabilities cannot exceed
                      max_total_vulnerabilities
        '401':
          $ref: '#/components/responses/MCPHubUnauthorized'
        '403':
          $ref: '#/components/responses/MCPHubForbiddenNoAccess'
        '422':
          $ref: '#/components/responses/MCPHubValidationError'
components:
  schemas:
    MCPHubScanListResponse:
      title: MCPHubScanListResponse
      type: object
      required:
        - items
        - limit
      description: >-
        Cursor-paginated list of scans. Page by passing the previous response's
        `next_cursor` back as the `cursor` query parameter. When `next_cursor`
        is `null` you have reached the end of the result set.
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/MCPHubScanListItem'
        next_cursor:
          type: string
          nullable: true
          description: >-
            Opaque cursor for the next page, or `null` on the last page. Pass
            back verbatim as `?cursor=...` — treat as opaque.
          example: >-
            eyJjcmVhdGVkX2F0IjoiMjAyNi0wNi0yNVQxMTozMjoxMS4xMjM0NTYrMDA6MDAiLCJqb2JfaWQiOiJhYmMtMTIzIn0
        limit:
          type: integer
          description: The page size used for this response.
        total:
          type: integer
          nullable: true
          description: >-
            Total rows matching the filters. Only populated when the request set
            `?include_total=true`; omitted by default because counting arbitrary
            filtered subsets defeats the point of cursor pagination.
    MCPHubScanListItem:
      title: MCPHubScanListItem
      type: object
      required:
        - job_id
        - job_status
        - user_email
        - created_at
      description: Slim representation of a scan row for the list endpoint.
      properties:
        job_id:
          type: string
        scan_type:
          type: string
          nullable: true
          enum:
            - source
            - hosted
            - null
        job_status:
          type: string
        repo_name:
          type: string
          nullable: true
        user_email:
          type: string
        is_official:
          type: boolean
          nullable: true
        is_private:
          type: boolean
          nullable: true
        org_id:
          type: string
          nullable: true
        user_id:
          type: string
          nullable: true
        project_name:
          type: string
          nullable: true
        registry_name:
          type: string
          nullable: true
        source_url:
          type: string
          nullable: true
          description: Source URL of the scanned package or repository (source scans only).
        source_version:
          type: string
          nullable: true
          description: >-
            Source version or git commit of the scanned source (source scans
            only).
        scan_version:
          type: string
          nullable: true
          description: >-
            Scanner version that produced this row. Multiple rows can share
            `(source_url, source_version)` but differ on `scan_version`; use
            `latest_only=true` to collapse to the newest per group.
        created_at:
          type: string
        completed_at:
          type: string
          nullable: true
        total_vulnerabilities:
          type: integer
          nullable: true
        overall_severity:
          type: string
          nullable: true
    MCPHubAuthErrorResponse:
      title: MCPHubAuthErrorResponse
      type: object
      description: Error envelope returned by the MCP Hub auth/permission failures.
      properties:
        detail:
          type: string
    MCPHubForbiddenResponse:
      title: MCPHubForbiddenResponse
      type: object
      description: >-
        Error envelope returned when the caller's organization lacks MCP Hub API
        access (enterprise data-license feature).
      properties:
        code:
          type: integer
          example: 403
        error:
          type: string
          example: Forbidden
        message:
          type: string
          example: >-
            MCP Hub APIs are an enterprise feature not enabled for your
            organization. Contact us at support@enkryptai.com for access.
        request_id:
          type: string
        time:
          type: number
    MCPHubValidationError:
      title: MCPHubValidationError
      type: object
      description: FastAPI-style validation error response.
      properties:
        detail:
          type: array
          items:
            type: object
            required:
              - loc
              - msg
              - type
            properties:
              loc:
                type: array
                items:
                  oneOf:
                    - type: string
                    - type: integer
              msg:
                type: string
              type:
                type: string
  responses:
    MCPHubUnauthorized:
      description: Unauthorized — missing or invalid Authorization header
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MCPHubAuthErrorResponse'
    MCPHubForbiddenNoAccess:
      description: >-
        Forbidden — your organization does not have access to the MCP Hub APIs.
        These retrieval/list endpoints are an enterprise data-license feature;
        contact support@enkryptai.com to enable access.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MCPHubForbiddenResponse'
    MCPHubValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MCPHubValidationError'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apikey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.