Files
403 with
code: "plan-required". Every plan, Free included, can have a file analysed from its
URL instead: see Analyse a file from its URL.
Upload a file, poll its analysis until it completes, and read the verdict, the
file tree and the indicators Urlyze found in it. Authenticate with your API key in the
X-Api-Key header, as for URL scans.
Upload a file
POST /FileCheck takes multipart/form-data. Only file is
required.
| Field | Meaning |
|---|---|
file | The file to analyse. At most 60 MB; larger files answer
413. |
password | One password to open a protected archive (zip, 7z, rar). Never guessed. At most 256 characters. |
audience | Who may read the result: Owner (you and
your workspace admins; the default), Workspace, Unlisted (anyone
with the id) or Public. |
visibility | The older field: Private (default),
Unlisted or Public. If you send both, they must agree. |
tags | Your own labels; repeat the field for several. Up to 20, 60 characters each. |
bReAnalyze | true analyses again even if your
workspace analysed the same file in the last 24 hours. |
curl -X POST https://api.urlyze.io/FileCheck \
-H "X-Api-Key: $URLYZE_API_KEY" \
-F "file=@invoice.zip" \
-F "password=example-password"
A new analysis answers 202 with an analyzeId. If your workspace
uploaded the same file, with the same visibility, in the last 24 hours, the answer is
200 with the stored result and fromCache: true, and no quota is used.
One exception: a stored result that says the archive needs a password, or that the password was
wrong, is not reused when the new upload carries a password.
Poll the result
GET /FileCheck/{analyzeId} until scanState is completed
or failed. A file you may not read answers 404, so a private upload's
existence is never revealed.
curl https://api.urlyze.io/FileCheck/{analyzeId} -H "X-Api-Key: $URLYZE_API_KEY"
result.verdict is Clean, Suspicious,
Malicious or Unknown (Unknown until the analysis completes).
result.fileState says what happened to the file in one word, for example
ok, needs-password, wrong-password or
unsupported. result.view is the display-ready analysis: the deciding
rule in words, the file tree, the findings and the indicators.
Is this file already known?
GET /FileCheck/by-hash/{sha256} answers 200 for every valid hash:
known: false, or known: true with the newest analysis of those bytes
you may read (scope is mine or community). It never
uploads anything. Open GET /FileCheck/{analyzeId} for the full analysis.
List your files
GET /FileCheck lists the files you may read, newest first: scope
(mine, self, community), verdict,
q (file name, or the start of a SHA-256), pageIndex and
pageSize (up to 200).
Change who may read a file
PATCH /FileCheck/{analyzeId}/audience with
{"audience": "Workspace"}. The user who uploaded the file, or a workspace Admin or
Owner, may change it.
Analyse a file from its URL (every plan)
When a URL points at a file, send it to POST /UrlCheck with
scanContext set to download. Urlyze downloads the file and analyses it.
This works on every plan, Free included: the Free plan includes 5 file analyses a day.
curl -X POST https://api.urlyze.io/UrlCheck \
-H "X-Api-Key: $URLYZE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/files/report.zip", "scanContext": "download"}'
Poll GET /UrlCheck/{analyzeId} as for any scan. It needs an API key or a
signed-in caller (401 without one). Any other scanContext value answers
400.
Keys and quotas
Uploading and changing the audience need a key with the ScanWrite scope; listing,
the hash lookup and reading a non-Public file need ScanRead. Every upload, and every
scan with scanContext: "download", counts against your daily file-analysis quota and
your monthly scan quota; a cached answer uses neither. Over either one the request answers
429; the daily refusal also carries dailyLimit,
usedToday, resetsAtUtc and a Retry-After header. The
daily window resets at midnight UTC. Your current limits and today's use are in
GET /api/usage (fileAnalysisDailyQuota,
fileAnalysisUsedToday).
Every field of the requests and answers is described in the API Reference.