> 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.

# Get a scan

GET https://api.detectant.com/v1/scans/{scan_id}

Returns one scan owned by the authenticated account.

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

## Authentication

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

## Request

### Path parameters

- `scan_id` (string, required) — Scan identifier returned by `createScan` or `listScans`.

## Response

### 200

The requested 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)

## Errors

### 401 Unauthorized Error

The API key is missing or invalid.

- `error` (APIError, required)

### 404 Not Found Error

No scan with this identifier exists for the authenticated account.

- `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

### 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.

### 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.

### 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
{
  "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"
  }
}
```

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

```javascript
const url = 'https://api.detectant.com/v1/scans/scan_0123456789abcdef0123456789abcdef';
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/scan_0123456789abcdef0123456789abcdef"

	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/scan_0123456789abcdef0123456789abcdef")

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/scan_0123456789abcdef0123456789abcdef")
  .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/scan_0123456789abcdef0123456789abcdef', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.detectant.com/v1/scans/scan_0123456789abcdef0123456789abcdef");
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/scan_0123456789abcdef0123456789abcdef")! 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()
```