> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.detectant.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.detectant.com/_mcp/server.

# List scans

GET https://api.detectant.com/v1/scans

Returns scans owned by the authenticated account in descending creation order.

Reference: https://docs.detectant.com/api-reference/scans/list-scans

## Authentication

- `X-API-Key` header (required) — API key in the `mak.<lookup-id>.<secret>` format.

## Request

### Query parameters

- `limit` (integer, optional, default: 50) — Maximum results to return. Values above 200 are capped at 200; omission uses 50.
- `cursor` (string, optional) — Opaque cursor returned as `next_cursor` by a previous request.
- `verdict` (string, optional) — Case-sensitive PostgreSQL `LIKE` fragment matched against the stored verdict; `%` and `_` act as wildcards.
- `scan_id` (string, optional) — Case-insensitive fragment matched against the scan identifier.
- `source_type` (enum, optional) — Return direct API scans or scans submitted by an S3 integration.
  - Allowed values: `api`, `s3`
- `storage_integration_id` (string, optional) — Return scans submitted by this S3 integration.
- `failure` (enum, optional) — Return scans by failure presence or customer-facing failure code.
  - Allowed values: `any`, `none`, `SCANNER_UNAVAILABLE`, `CONTENT_EXPANSION_LIMIT_EXCEEDED`
- `filename` (string, optional) — Case-sensitive PostgreSQL `LIKE` fragment matched against the stored filename; `%` and `_` act as wildcards.
- `engine_signature` (string, optional) — Case-sensitive PostgreSQL `LIKE` fragment matched against the stored engine signature; `%` and `_` act as wildcards.
- `detection_rule` (string, optional) — Case-sensitive PostgreSQL `LIKE` fragment matched against stored detection rules; `%` and `_` act as wildcards.

## Response

### 200

A page of scans.

- `items` (list of Scan, required) — Scan records. Empty when the account has no scans.
- `next_cursor` (string, required, nullable) — Opaque cursor for the next page, or `null` when no next page exists.

## Errors

### 400 Bad Request Error

The request parameters or upload are invalid.

- `error` (APIError, required)

### 401 Unauthorized Error

The API key is missing or invalid.

- `error` (APIError, required)

### 429 Too Many Requests Error

The plan's current-period scan allowance, global request rate, or concurrent scanner capacity was exceeded. Plan exhaustion uses `USAGE_LIMIT_EXCEEDED` and includes the plan, limit, and reset time in `details`.

- `error` (APIError, required)

### 500 Internal Server Error

An unexpected internal failure occurred.

- `error` (APIError, required)

## Types

### Scan

- `id` (string, required) — Server-generated scan identifier.
- `created_at` (datetime, required)
- `status` (enum, required)
  - Allowed values: `completed`, `failed`
- `verdict` (enum, required)
  - Allowed values: `clean`, `malicious`, `suspicious`, `unknown`
- `filename` (string, required) — Filename supplied by the multipart upload.
- `sha256` (string, required)
- `size_bytes` (long, required)
- `duration_ms` (double, required)
- `timings` (ScanTimings, required)
- `failure` (ScanFailure, required, nullable) — Failure information, or `null` when the scan completed.
- `detections` (list of string, required) — Detection names reported for the file. Empty when no threats were detected.
- `type_analysis` (TypeAnalysis, required)
- `source` (ScanSource, required)

### APIError

- `code` (string, required) — Stable machine-readable error code.
- `message` (string, required) — Human-readable error message.
- `details` (map from string to string, required) — Context such as the ID of a failed stored scan. Empty when no context applies.

### ScanTimings

- `file_type_ms` (double, required)
- `malware_scan_ms` (double, required)

### ScanFailure

- `code` (enum, required)
  - Allowed values: `SCANNER_UNAVAILABLE`, `CONTENT_EXPANSION_LIMIT_EXCEEDED`
- `message` (string, required)

### TypeAnalysis

- `declared` (TypeDeclaration, required)
- `identified` (TypeIdentification, required)
- `status` (enum, required)
  - Allowed values: `match`, `compatible`, `mismatch`, `malformed`, `unscannable`, `unknown`
- `structurally_valid` (boolean, required, nullable)
- `confidence` (enum, required)
  - Allowed values: `high`, `medium`, `low`
- `reason` (TypeAnalysisReason, required, nullable)

### ScanSource

- `type` (enum, required)
  - Allowed values: `api`, `s3`
- `integration_id` (string, required, nullable) — S3 integration identifier, or `null` for direct API scans.
- `integration_name` (string, required, nullable) — S3 integration name, or `null` for direct API scans.

### TypeDeclaration

- `extension` (string, optional) — Raw extension from the uploaded filename, without the leading dot.
- `mime` (string, optional) — Normalized MIME type declared by the multipart part.

### TypeIdentification

- `format` (string, optional) — Canonical format identified from file content.
- `mime` (string, optional) — Canonical MIME type identified from file content.

### TypeAnalysisReason

- `code` (enum, required)
  - Allowed values: `malformed_file`, `encrypted_archive`, `unsupported_archive`, `content_expansion_limit_exceeded`, `file_type_mismatch`
- `claimed` (string, optional)
- `detected` (string, optional)

## Examples

**Response**

```json
{
  "items": [
    {
      "id": "scan_0123456789abcdef0123456789abcdef",
      "created_at": "2024-01-15T09:30:00Z",
      "status": "completed",
      "verdict": "clean",
      "filename": "string",
      "sha256": "string",
      "size_bytes": 1,
      "duration_ms": 1.1,
      "timings": {
        "file_type_ms": 1.1,
        "malware_scan_ms": 1.1
      },
      "failure": {
        "code": "SCANNER_UNAVAILABLE",
        "message": "string"
      },
      "detections": [
        "string"
      ],
      "type_analysis": {
        "declared": {
          "extension": "string",
          "mime": "string"
        },
        "identified": {
          "format": "string",
          "mime": "string"
        },
        "status": "match",
        "structurally_valid": true,
        "confidence": "high",
        "reason": {
          "code": "malformed_file",
          "claimed": "string",
          "detected": "string"
        }
      },
      "source": {
        "type": "api",
        "integration_id": "string",
        "integration_name": "string"
      }
    }
  ],
  "next_cursor": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.detectant.com/v1/scans"

headers = {"X-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.detectant.com/v1/scans';
const options = {method: 'GET', headers: {'X-API-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.detectant.com/v1/scans"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.detectant.com/v1/scans")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.detectant.com/v1/scans")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.detectant.com/v1/scans', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.detectant.com/v1/scans");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.detectant.com/v1/scans")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```