Skip to main content
The scans endpoint lets you browse the history of Detail analysis runs for a repository. Each scan record tells you when the analysis ran, what commit it covered, how it was triggered, and how many bugs it found. You can also use a scan’s workflowRequestId to filter bug results to only those surfaced during that specific scan.

GET /public/v1/scans

Returns a paginated list of scans for a repository, ordered newest first.
curl "https://api.detail.dev/public/v1/scans?repo_id=repo_abc123" \
  -H "Authorization: Bearer dtl_live_YOUR_KEY"

Query parameters

repo_id
string
required
The repository ID to fetch scans for. Repository IDs are prefixed with repo_ and are returned by GET /public/v1/repos. Example: repo_abc123.
limit
integer
Number of results to return. Between 1 and 100. Defaults to 50.
offset
integer
Number of results to skip for pagination. Defaults to 0.

Response

scans
Scan[]
Array of scan objects for the repository.
total
integer
Total number of scans for the repository, regardless of limit and offset.

Example response

{
  "scans": [
    {
      "workflowRequestId": "wr_abc123",
      "repoId": "repo_xyz789",
      "repoName": "my-repo",
      "ownerName": "myorg",
      "workflowStatus": "complete",
      "scanType": "default",
      "initiator": "scheduler",
      "commitSha": "abc1234567890abcdef",
      "createdAt": 1736899200000,
      "completedAt": 1736899800000,
      "bugCounts": {
        "total": 5,
        "open": 3,
        "resolved": 1,
        "dismissed": 1
      }
    },
    {
      "workflowRequestId": "wr_def456",
      "repoId": "repo_xyz789",
      "repoName": "my-repo",
      "ownerName": "myorg",
      "workflowStatus": "in_progress",
      "scanType": "recentChanges",
      "initiator": "scanNow",
      "commitSha": "def4567890abcdef12",
      "createdAt": 1737072000000,
      "completedAt": null,
      "bugCounts": null
    }
  ],
  "total": 8
}
To list the bugs surfaced by a specific scan, pass its workflowRequestId as the workflow_request_id parameter when calling GET /public/v1/bugs.
curl "https://api.detail.dev/public/v1/bugs?repo_id=repo_xyz789&status=pending&workflow_request_id=wr_abc123" \
  -H "Authorization: Bearer dtl_live_YOUR_KEY"