Quick start
Make a key under Profile, API keys in the application, and keep it in an environment variable. Then start a run, wait for it to finish and fetch its report.
export SW_KEY=sw_...
# Start a run of a file for two minutes. The fields come before the file.
curl -H "Authorization: Bearer $SW_KEY" \
-F os=win10 -F duration=120 -F file=@invoice.exe \
https://app.sample.watch/api/runs
# Ask for the run by its id until its state is finished, failed or stopped.
curl -H "Authorization: Bearer $SW_KEY" \
https://app.sample.watch/api/runs/20261121T093015Z-3fa9c2d1
# Read what it came to.
curl -H "Authorization: Bearer $SW_KEY" \
https://app.sample.watch/api/runs/20261121T093015Z-3fa9c2d1/report.json
The same in Python with requests:
import os, time, requests
API = "https://app.sample.watch/api"
auth = {"Authorization": f"Bearer {os.environ['SW_KEY']}"}
with open("invoice.exe", "rb") as f:
# Parts are sent in this order; Sample Watch stops reading at "file".
parts = [("os", (None, "win10")), ("duration", (None, "120")),
("file", ("invoice.exe", f))]
r = requests.post(f"{API}/runs", headers=auth, files=parts)
r.raise_for_status()
run_id = r.json()["run"]["id"]
while True:
run = requests.get(f"{API}/runs/{run_id}", headers=auth).json()["run"]
if run["state"] in ("finished", "failed", "stopped"):
break
time.sleep(10)
report = requests.get(f"{API}/runs/{run_id}/report.json", headers=auth).json()
print(report["run"].get("verdict") or "nothing found", report["run"]["score"])
Authentication
Send the key in the Authorization header of every request. A key acts for the account
that made it, as that account is now: it sees the runs the account sees, and a run it starts belongs
to the account and its team.
Authorization: Bearer sw_AbCdEf...
- Making keys
- Profile, API keys in the application. Name each key for what uses it and choose how long it works: 30 days, 90 days, a year or with no end. An account may have 20 keys.
- Shown once
- The key appears only when it is made. Sample Watch keeps a hash of it and its first characters, so you can tell your keys apart in the list.
- What it reaches
-
Everything under
/api/runs, and reading/api/systems,/api/search,/api/stats/…,/api/rulesand/api/attack. Account settings, keys and administration need you signed in, so a key cannot make another key. - 401
-
The key is wrong, has run out or was removed, or the account was disabled. The answer carries
WWW-Authenticate: Bearer. - 403
- The key is good, but the request is outside what a key reaches.
- Removing
- A removed key stops working at once. Each key's list entry says when it was last used.
Check a key with GET /api/auth/me, which names the account it acts for:
curl -H "Authorization: Bearer $SW_KEY" https://app.sample.watch/api/auth/me
Requests and errors
Answers are JSON unless an endpoint says otherwise. An error is an HTTP status with a sentence that says what is wrong:
{"error": "a run goes on for 10 seconds to 10 minutes"}
- 400
- A field or parameter is missing or out of range.
- 401, 403
- See authentication.
- 404
- No such run. A run of another team is answered the same way, so nobody learns of other teams' runs.
- 409
- The run is not in a state for this, for example more time for a run that is over.
- 413, 415
- The file is over 128 MiB, or a run was not asked for with a form.
- 429
-
A team on the Free tier has started all the runs it may in 24 hours.
Retry-Aftersays how many seconds until the next may start. - 502, 503
- Sample Watch could not reach its storage or a machine, or too many runs wait. Try again.
-
Do not send an
Originheader from a script. When one is sent with a POST or a WebSocket, it must behttps://app.sample.watch. -
Times are RFC 3339. Large numbers travel as strings:
flow_idand everyprocess_create_time. Pass them back unchanged. -
A process is named by its
key,PID:CREATION_TIME, as in4120:133771234567890123. -
Lists that page take
offsetandlimitand answer withtotal. Event records page by position instead.
Start a run
GET/api/systems
The operating systems to run a sample on. Send a code as os.
{"systems": [{"code": "win10", "name": "Windows 10", "architecture": "64-bit"}]}
POST/api/runs
A form (multipart/form-data) with a file or a web address. Put every field before the
file part: Sample Watch checks the fields first and stops reading at the file.
- os
- Required. A system
code, such aswin10. - duration
- Required. Seconds the sample runs once it is opened, 10 to 600, or to 120 on the Free tier. The time counts from the moment the guest opens the file or address.
- file
-
The sample, up to 128 MiB, saved under its file name of up to 120 characters. Or send
urlinstead. - url
- An absolute
httporhttpsaddress of up to 4,096 characters. - uac
-
confirmgives administrator rights without a prompt;prompt(the default) shows the prompt on the desktop for a person to answer. - inspect_tls
-
onreads the guest's HTTPS traffic;offdoes not. Left out, a file's run does not, and an address's run does when every machine of the system can read HTTPS. - folder
-
Files only. Where the guest saves the file before opening it:
desktop(the default),home,downloads,appdata,temp,windowsorroot. - browser
-
Addresses only.
edge(the default),chrome,firefoxorie. - exit
-
Addresses only, on Trial and Premium. The name of a VPN exit the machines offer, such as
nl1: the guest's traffic leaves through it, so the page sees a VPN address instead of ours. Some phishing pages show what they are only to visitors who do not come from a hosting provider. Left out, the run leaves through the default exit,nl1(Amsterdam), while every machine of the system offers it, and through our own server otherwise; on the Free tier it always leaves through our own server. Empty (-F exit=), it leaves through our own server. The New analysis form lists the exits on offer, the default chosen. A file's run with an exit, or an exit not every machine of the system offers, is400; the Free tier gets403for an exit it names.
curl -H "Authorization: Bearer $SW_KEY" \
-F os=win10 -F duration=180 -F uac=confirm -F folder=downloads \
-F file=@invoice.exe https://app.sample.watch/api/runs
curl -H "Authorization: Bearer $SW_KEY" \
-F os=win10 -F duration=120 -F browser=chrome -F inspect_tls=on \
--form-string url=https://example.com/login https://app.sample.watch/api/runs
The answer is 201 with the run, which has its id from now on. A free machine starts it
at once; otherwise it waits in line and starts by itself.
{
"run": {
"id": "20261121T093015Z-3fa9c2d1",
"state": "waiting",
"started_at": "2026-11-21T09:30:15.123456Z",
"file": {"name": "invoice.exe", "size": 482304, "sha256": "9f2c…", "held": true},
"os": "win10", "duration": 180, "uac": "confirm", "folder": "downloads",
"position": 1, "waiting": 1, "eta_seconds": 95,
"event_count": 0, "lost_count": 0, "score": 0, "tenant_id": 4
},
"now": "2026-11-21T09:30:15.130201Z"
}
Follow a run
GET/api/runs/{id}
The run with its processes, findings, the files opened in it (samples), configurations
read from them (configs) and, for an email or PDF, what it holds (lure).
- waiting
-
No machine yet.
positionis its place in line,eta_secondsa rough wait. - starting
- A machine was given (
server,guest) and Windows comes up. - opening
- The file or address is on its way into the guest.
- running
-
Opened at
opened_at; the machine stops atstops_at.can_extendis how many seconds may still be added. - finished
- The time was up or somebody stopped it. Its results are stored.
- failed
problemsays why.- stopped
- Stopped before the file or address was opened.
verdict is malicious (score 70 or more), suspicious (20 or
more) or info when something was found below that; it is absent when nothing was.
score runs from 0 to 100. Findings carry a level, a title,
ATT&CK techniques and the positions of the records that matched in
evidence.
A run of an address that left through a VPN exit has its name in exit and, once the
browser has started, exit_ip, the address the exit showed the internet just before.
GET/api/runs
Your runs, newest first.
- show
-
all(the default),open(not over),flagged(malicious or suspicious) orfailed. - q
- Keeps runs whose file name, SHA-256, address or id holds the text. At most 200 characters.
- offset, limit
- Paging:
limitis 50 by default, at most 200.
The answer has runs, total for what show and
q keep, and counts for each view.
POST/api/runs/{id}/extend
More time for a running run, {"seconds": 60}. A run goes on for at most 10 minutes from
when it was opened, 2 minutes on the Free tier; what is asked beyond that is not given.
POST/api/runs/{id}/stop
Ends a run now: it leaves the line, or its machine is stopped and it turns finished.
POST/api/runs/{id}/again
A new run of the same file or address with the same choices, its exit included. A file can be run
again for 30 days after its last run, while file.held is true.
Results
GET/api/runs/{id}/report.json
What a run came to, in one document for other programs: the run, its samples, processes, findings,
ATT&CK techniques, network lists and indicators to block or look for elsewhere
(SHA-256s, domains, IP addresses, URLs and files written). format is
yellow-report/1; it changes only when a field changes meaning or goes away.
report.html is the same as a page that prints well.
curl -H "Authorization: Bearer $SW_KEY" \
https://app.sample.watch/api/runs/$RUN/report.json | jq '.indicators[] | select(.kind == "domain")'
GET/api/runs/{id}/events
The run's records from the guest in the order they arrived, while it runs and after. Page with
after= the last pos you read.
- kind
process,file,registryornetwork.- after, before
- Records after a position, oldest first, or the newest before one.
- limit
- 500 by default, at most 2,000.
- pos
- Exactly these positions, such as a finding's
evidence:pos=3,17,40. - process
- One process's records by its
key, with the starts of what it started. - changes_only
1leaves out registry values read and files opened.- q
- Records whose action, target or detail holds the text, or whose process name does.
GET/api/runs/{id}/network
What the capture saw: connections, dns, http and
threats (network alerts with a level), each tied to a process where it
could be. kind asks for one list; offset and limit (100, at
most 2,000) page it; q finds text in it.
GET/api/runs/{id}/http/{flow_id}/{tx_id}
One HTTP request whole, with every header of the request and its answer, and its
bodies.
GET/api/runs/{id}/bodies/{sha256}
A body's bytes as an attachment: the first kept bytes, at most 1 MiB, decompressed.
Treat it as hostile.
GET/api/runs/{id}/pictures
Screenshots of the desktop, at most one a second while it changes. Each has at_ms on
the run's clock; fetch one as a JPEG from /pictures/{at_ms}.
GET/api/runs/{id}/timeline
How many events of each kind happened in each slice of the run (slices, 120 by default,
at most 600).
Live streams
Two WebSockets follow a run while it goes on, with the same Authorization header. Both
close when the run is over.
WS/api/runs/{id}/live
JSON messages, one per text frame. The first has "reset": true and holds everything so
far; later ones hold new events, new or changed processes and
findings, and the run's counts, score and
verdict. Read promptly: a client that falls behind is closed with code 1013.
websocat -H "Authorization: Bearer $SW_KEY" \
wss://app.sample.watch/api/runs/$RUN/live
WS/api/runs/{id}/desktop
The guest's screen as a VNC (RFB) stream in binary frames, both ways: keys and pointer moves you send reach the guest.
Search and rules
GET/api/search?q=…
Your runs that a query describes, newest first. Terms are field:value, joined with
AND, OR, NOT and brackets; a value ending in
* matches what starts with it.
curl -G -H "Authorization: Bearer $SW_KEY" https://app.sample.watch/api/search \
--data-urlencode 'q=technique:T1059* AND domain:"example.com" AND score:>=70'
- Findings
-
rule,rule_id,source,level,technique,tactic,label - Network
-
domain,ip,url,ja3,threat,threat_sid,threat_class - Host
image,cmd,reg,mutex- Run
score,verdict,os,sha256
GET/api/rules
The rules that judge new runs, and /api/rules/{id} for one with its ATT&CK
techniques and its source. /api/attack is the ATT&CK release findings are named
by, and /api/stats/techniques counts the techniques found in your runs.
Limits
- File
- 128 MiB, uploaded within 5 minutes.
- Run time
- 10 seconds to 10 minutes, extensions included. On the Free tier, up to 2 minutes.
- Runs a day
- On the Free tier, 20 for the whole team in any 24 hours; runs that failed do not count. No limit on Premium.
- VPN exit
-
On Trial and Premium, an address's run leaves through a VPN exit, Amsterdam unless another is
chosen; ask for
exit=to leave through our own server. Not on the Free tier. - Machines
- Runs share the machines and wait in line, first come, first served.
- Files kept
- 30 days after their last run. Records, pictures and bodies are kept as long as the run.
- Keys
- 20 for each account.