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

# List Code Scans (Devin API)

> List Devin code scans across an enterprise and poll scan status, with time, repository, and organization filters via the v3 API

## Permissions

Requires a [service user](/api-reference/v3/service-users/members-service-users) or [personal access token](/api-reference/personal-access-tokens) with the `ViewAccountCodeScans` permission at the enterprise level.

## Behavior

Returns code scans across the enterprise, newest first. Use it to poll the `status` of a scan started with [Start Code Scan](/api-reference/v3/code-scans/enterprise-code-scans-start): `waiting` → `pending` → `running` → `completed` (or `failed` / `cancelled`). `awaiting_user_input` applies only to interactive scans started from the web app; API-started scans do not enter it.

### Filters

* `time_after` / `time_before`: Unix timestamps in seconds (UTC) bounding the scan creation time.
* `repo_name`: only scans that scanned this repository. Matches multi-repo scans that include it.
* `org_ids`: only scans in these organizations.

Results are paginated with an opaque cursor (`after` / `first`). For a single organization, use [List Code Scans (Organization)](/api-reference/v3/code-scans/organizations-code-scans-list).


## OpenAPI

````yaml v3-openapi.yaml GET /v3/enterprise/code-scans/scans
openapi: 3.1.0
info:
  description: Devin v3 API with Service User authentication and RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/enterprise/code-scans/scans:
    get:
      tags:
        - code-scans
      summary: List Code Scans
      description: |-
        List code scans for the enterprise account.

        Scans are returned newest first. Optionally filter by ``org_ids``,
        ``repo_name``, and creation time (``time_after`` / ``time_before``);
        results are paginated with an opaque cursor (``after`` / ``first``).
      operationId: handle_list_code_scans_v3_enterprise_code_scans_scans_get
      parameters:
        - in: query
          name: time_before
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time Before
        - in: query
          name: time_after
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Time After
        - in: query
          name: after
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: After
        - in: query
          name: first
          required: false
          schema:
            default: 100
            maximum: 200
            minimum: 1
            title: First
            type: integer
        - description: >-
            Filter to scans that scanned this repository. Matches multi-repo
            scans even when the repository is not the scan's primary repo, so
            returned items may report a different repo_name.
          in: query
          name: repo_name
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter to scans that scanned this repository. Matches multi-repo
              scans even when the repository is not the scan's primary repo, so
              returned items may report a different repo_name.
            title: Repo Name
        - description: Filter to scans in these organizations.
          in: query
          name: org_ids
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter to scans in these organizations.
            title: Org Ids
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_CodeScanResponse_'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unprocessable Content
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Too Many Requests
components:
  schemas:
    PaginatedResponse_CodeScanResponse_:
      properties:
        end_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: Cursor to fetch the next page, or None if this is the last page.
          title: End Cursor
        has_next_page:
          default: false
          description: Whether there are more items available after this page.
          title: Has Next Page
          type: boolean
        items:
          items:
            $ref: '#/components/schemas/CodeScanResponse'
          title: Items
          type: array
        total:
          anyOf:
            - type: integer
            - type: 'null'
          description: Optional total count (can be omitted for performance).
          title: Total
      required:
        - items
      title: PaginatedResponse[CodeScanResponse]
      type: object
    ProblemDetail:
      description: >-
        RFC 9457 application/problem+json error body for the v3 API.


        detail is retained from the legacy {"detail": ...} body for back-compat;
        the

        other members are additive. errors carries field-level validation
        failures

        (422 only).
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: A human-readable explanation specific to this occurrence.
          title: Detail
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: Field-level validation errors (422 responses only).
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: A URI reference (the request path) for this occurrence.
          title: Instance
        status:
          description: The HTTP status code.
          title: Status
          type: integer
        title:
          description: A short, human-readable summary of the problem type.
          title: Title
          type: string
        type:
          default: about:blank
          description: A URI reference identifying the problem type.
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
    CodeScanResponse:
      description: A single code scan.
      properties:
        created_at:
          description: When the scan was created (unix seconds).
          title: Created At
          type: integer
        host:
          anyOf:
            - type: string
            - type: 'null'
          description: Git host of the repository, if known.
          title: Host
        org_id:
          description: Organization the scan belongs to.
          title: Org Id
          type: string
        profile:
          anyOf:
            - $ref: '#/components/schemas/CodeScanProfileResponse'
            - type: 'null'
          description: Profile the scan ran under, if any.
        repo_name:
          description: >-
            Primary repository of the scan. Multi-repo scans cover additional
            repositories not listed here.
          title: Repo Name
          type: string
        scan_id:
          description: Unique identifier for the scan.
          title: Scan Id
          type: string
        scan_type:
          description: Type of scan, stamped at creation.
          enum:
            - security
            - performance
            - db-queries
            - test-coverage
            - dead-code
            - code-quality
            - telemetry
            - accessibility
            - general
            - migration-docs
          title: Scan Type
          type: string
        status:
          description: >-
            Scan status: waiting, pending, running, awaiting_user_input,
            completed, failed, or cancelled.
          enum:
            - waiting
            - pending
            - running
            - awaiting_user_input
            - completed
            - failed
            - cancelled
          title: Status
          type: string
      required:
        - scan_id
        - org_id
        - repo_name
        - host
        - status
        - profile
        - scan_type
        - created_at
      title: CodeScanResponse
      type: object
    CodeScanProfileResponse:
      description: Summary of the profile a scan ran under.
      properties:
        name:
          description: Name of the profile.
          title: Name
          type: string
        profile_id:
          description: Unique identifier for the profile.
          title: Profile Id
          type: string
      required:
        - profile_id
        - name
      title: CodeScanProfileResponse
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Service User credential (prefix: cog_)'
      scheme: bearer
      type: http

````