---
title: "List Code Scan Files"
method: GET
path: "/v1/projects/{project_id}/code-scan/files"
tags: ["code-scan"]
---

# List Code Scan Files

`GET /v1/projects/{project_id}/code-scan/files`

## Request

- Base URL: `https://api.sonenta.dev`
- URL: `https://api.sonenta.dev/v1/projects/{project_id}/code-scan/files`
- Auth: none declared

Per-FILE status roll-up for the file-tree view (Viewer+).

One row per file: `counts{new, treated, gone, new_this_scan}` + `total`,
sorted by path ascending. Read-only aggregation. Page with `limit`/`offset`;
`total` is the distinct file count so the client knows the tree size.
`excluded` applies the persistent exclusion list to both the rows and `total`.

## Path parameters

- `project_id` string, required

## Query parameters

- `excluded` string: Exclusion-rule filter (default `exclude`): `exclude` drops findings matched by a rule (a fully-masked file leaves the tree) · `only` shows ONLY matched findings · `include` ignores rules. DEFAULT CHANGES OUTPUT; no rules ⇒ unchanged.
- `limit` integer
- `offset` integer

## Response `200`

Successful Response

- CodeScanFilesPage
  - `items` CodeScanFileRow[], required
    - `file` string, required: Repo-relative path.
    - `counts` CodeScanFileCounts, required
      - `new` integer, required: Outstanding (à traiter).
      - `treated` integer, required: Turned into a key.
      - `gone` integer, required: No longer in the source.
      - `new_this_scan` integer, required: Subset of `new` that FIRST appeared in the most recent scan.
    - `by_category` CodeScanByCategory, required: Category x status. `keyless` = raw literal with no key · `key_default` = a key's defaultValue · `unknown` = everything the scanner did not label as one of those (incl. findings from before the field existed). `keyless.new` is the UI headline: hardcoded strings with no key, still to treat.
      - `keyless` CodeScanStatusCounts, required
        - `new` integer, required
        - `treated` integer, required
        - `gone` integer, required
      - `key_default` CodeScanStatusCounts, required
        - `new` integer, required
        - `treated` integer, required
        - `gone` integer, required
      - `unknown` CodeScanStatusCounts, required
        - `new` integer, required
        - `treated` integer, required
        - `gone` integer, required
    - `total` integer, required: new + treated + gone in this file.
  - `total` integer, required: Distinct file count (for paging the tree).
  - `limit` integer, required
  - `offset` integer, required
  - `latest_scan_id` string, nullable: The run `new_this_scan` is measured against; null if none.
  - `formula` object, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sonenta/apis/sonenta-api.md) · [All operations](https://skmtc.dev/sonenta/apis/sonenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sonenta/apis/sonenta-api/revisions/f853ea49fb05?raw)
