Skip to main content
POST
File Scan analyzes a file for malware and returns a verdict, file hash, and supporting indicators.

Authentication

Send your API key as Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

Request

string
required
Set this value to file.
file
The file to scan, uploaded as multipart/form-data. Send this field or content_base64 or source_url. When you omit filename, the uploaded file’s name is used.
string
For a JSON body, the base64-encoded file. Send raw base64 only, without a data URL prefix. Provide this field, file, or source_url.
string
A URL from which Encrata can download the file. Provide this field, file, or content_base64.
string
The original file name.
boolean
Set to true to include STIX 2.1 output when available. Defaults to false.
The maximum file size is 100 MiB.

Example request

Upload the file from disk as multipart/form-data. Replace document.pdf with the path to your file.
To send JSON instead, base64-encode the file into content_base64:
For files already in storage, send a short-lived download link in source_url instead of uploading the file:

Example response

File result fields

string
The SHA-256 hash of the scanned file.
string
The file type reported by the file scanner.
object[]
Malware and rule matches. Each item is an object with source, malicious, detail, and optional severity.
object[]
Indicators of compromise, including the file’s SHA-256.
See Malware Scan for the complete response schema and shared fields.

Errors

The API returns 400 for invalid input, 401 for a missing or invalid API key, 402 when your account has insufficient credits, 413 when the file exceeds 100 MiB, and 429 when you exceed a rate limit.

Credits

A successful scan costs 1 credit. Repeating the same scan kind and content is deduplicated for billing.