TAJ APPS
Home / Unmask / API
Privara Unmask · Developer docs

Unmask API v1

Privara Unmask is the Android malware sandbox that recovers the C2. With the API you submit samples, get the recovered C2 with its evidence, pull reports as JSON, STIX 2.1, CSV or PDF, and receive a signed webhook when each job is done. Pay only for results, at the same prices as the web panel: $25 live, $9 dead, $0 when nothing is found.

Version 1Updated 28 November 2026Base URL https://app.tajapps.com/api/unmask/v1
Quick start

Submit a sample and wait for the result

1. Get a key. Sign up (free until your first C2), then create an Unmask API key on the dashboard. The company owner creates keys; each key is shown once, so create one per integration (a script, OpenCTI, TheHive) and revoke it on its own when needed. Unmask keys are separate from the Privara CLI token, which does not work here. Scopes: read, submit, webhooks.

2. Submit, then poll or use a webhook.

curl
export PRIVARA_UNMASK_KEY=pvu_...   # from the dashboard; keep it out of your shell history

# submit one sample; its SHA-256 as the Idempotency-Key makes a retry safe
curl -sS https://app.tajapps.com/api/unmask/v1/samples \
  -H "Authorization: Bearer $PRIVARA_UNMASK_KEY" \
  -H "Idempotency-Key: $(sha256sum sample.apk | cut -d' ' -f1)" \
  -F "files=@sample.apk" \
  -F "label=case-1042"

# poll the job (no faster than every 15 seconds)
curl -sS https://app.tajapps.com/api/unmask/v1/jobs/j_a \
  -H "Authorization: Bearer $PRIVARA_UNMASK_KEY"

# STIX 2.1 bundle once the job is done
curl -sS -o j_a.stix.json https://app.tajapps.com/api/unmask/v1/jobs/j_a/report.stix \
  -H "Authorization: Bearer $PRIVARA_UNMASK_KEY"
Python (requests)
import hashlib
import os
import time

import requests

BASE = "https://app.tajapps.com/api/unmask/v1"
api = requests.Session()
api.headers["Authorization"] = "Bearer " + os.environ["PRIVARA_UNMASK_KEY"]


def submit(path, label=None):
    with open(path, "rb") as f:
        data = f.read()
    r = api.post(
        f"{BASE}/samples",
        headers={"Idempotency-Key": hashlib.sha256(data).hexdigest()},
        files=[("files", (os.path.basename(path), data))],
        data={"label": label} if label else None,
        timeout=300,
    )
    r.raise_for_status()
    return r.json()


def wait(job_id):
    while True:
        r = api.get(f"{BASE}/jobs/{job_id}", timeout=30)
        r.raise_for_status()
        job = r.json()
        if job["status"] in ("done", "failed", "canceled"):
            return job
        time.sleep(max(15, int(r.headers.get("Retry-After", 30))))


batch = submit("sample.apk", label="case-1042")
for item in batch["jobs"]:
    if item["status"] == "refused":
        print(item["filename"], "refused:", item["refused"]["code"])
        continue
    job = wait(item["job_id"])
    print(job["outcome"], "charged $%.2f" % (job["charge_cents"] / 100))
    for c2 in job["c2"]:
        print(" ", c2["defanged"], c2["kind"], "live" if c2["live"] else "not answering")

To send a batch, repeat the files field up to 10 times: files=[("files", open(p, "rb")) for p in paths], with a client UUID as the Idempotency-Key. Ids such as j_a above are placeholders: real ids are opaque strings, so always read them from the JSON.

Report text comes from malware. Strings in a report were produced by, or carved out of, a hostile sample. Treat them as untrusted data: escape them before display, and never feed them to another system, or to an AI model, as instructions.
Reference

Basics

  • Base URL: https://app.tajapps.com/api/unmask/v1. Its own address https://unmask-api.tajapps.com/api/unmask/v1 is live (2026-11-27; ops/unmask-api-host/): only this API is served there, and both addresses work during the changeover.
  • Auth: Authorization: Bearer pvu_<prefix>_<secret> (an Unmask API key; never the CLI token). Keys have scopes: read, submit, webhooks. Missing/invalid key → 401; missing scope → 403.
  • JSON everywhere except the sample upload (multipart) and report files.
  • Errors: {"error": {"code": "<machine_code>", "message": "<human sentence>"}}, never a stack trace.
  • Rate limits: per key and per IP; 429 with Retry-After.
  • Ids: job_id and batch_id are random strings (j_…, b_…), never sequential. After the prefix they use the URL-safe alphabet A-Z a-z 0-9 _ - (so an id can contain more underscores and hyphens, e.g. j_p_vArc3oFeSzaMwZyOQNOamS), up to 64 characters. Clients treat ids as opaque: read them from the JSON, never extract or validate them with a narrower pattern. They are safe in a URL path as they are.
  • Times: integers, Unix seconds UTC. Money: integers in US cents.
  • IOCs in JSON are given twice: value (raw, for machines) and defanged (for humans).
Reference

Endpoints

POST/samples

Multipart, 1 to 10 files under the field files. Header Idempotency-Key (recommended; same key + same files within 24 h → the same answer, nothing charged twice). Optional form fields: label (≤100 chars), notify_email (true|false, default the account's setting), rerun (true|false, default false; 2026-11-27): analyse again a sample whose earlier result would otherwise be returned (same sample within 30 days, charged result), and charge it like a new one. A copy of the sample that is still waiting or running is reused even with rerun, so one sample never runs twice at once. Panel: "Run again even if analysed recently"; CLI privara-unmask submit --rerun; MCP submit_sample rerun. Each file is checked first (APK / XAPK / APKM / .apks only, size cap, not a known clean app). Refused files cost nothing.

201 →

JSON
{"batch_id": "b_x", "jobs": [
  {"job_id": "j_a", "filename": "a.apk", "sha256": "…", "status": "queued", "duplicate_of": null},
  {"filename": "b.txt", "status": "refused", "refused": {"code": "not_apk", "message": "…"}}
],
 "reserved_cents": 2500, "trial": {"active": true, "samples_left": 9}}

Errors: 402 insufficient_balance (nothing queued), 403 fair_use_reached, 413 too_large, 400 no_files / too_many_files.

GET/jobs/{job_id}

JSON
{"job_id": "j_a", "batch_id": "b_x", "filename": "a.apk", "sha256": "…", "package": "com.x",
 "status": "queued|running|done|failed|canceled",
 "outcome": "live|dead|none|void|null",
 "charge_cents": 2500, "created_at": 0, "finished_at": 0,
 "family": {"name": "Octo", "confidence": 0.55},
 "c2": [{"value": "http://1.2.3.4/x.php", "defanged": "hxxp://1.2.3[.]4/x.php",
         "kind": "url", "live": true, "confidence": 0.89, "source": "runtime_traffic"}],
 "rejected_candidates": [{"defanged": "…", "reason": "non_code_asset"}],
 "android": {"tried": ["17", "14"], "ran_on": "14"},
 "report_url": "https://app.tajapps.com/api/unmask/v1/jobs/j_a/report.pdf"}

Also (2026-11-28): progress (null once final; while queued / running: stage = checking | queued | running | android14_retry | recheck | finalizing, queue_position, jobs_ahead, running_minutes and a message to show the user as is, e.g. "Waiting in line for the sandbox phone: 2 samples ahead of yours. This is a normal queue, not an error."). android.tried lists a version only once the sample actually ran on it. Also (2026-11-27): trial (bool: a free trial sample, so its $0 is the trial), canceled_reason ("trial_ended" or null; see "Trial batches" below) and continued_as (the batch it was continued in, or null). outcome is null until status is done. void means a platform fault: never charged. c2[].source is one of runtime_traffic, dead_drop, decrypted_config, sample_code, device_memory (read from the phone's memory while the sample ran; billed only when the AI verifier confirmed it as the sample's C2, and never live unless it answered Privara's own probe; 2026-11-26).

GET/jobs?batch_id=&status=&since=&limit=

Newest first, limit ≤ 100, cursor next in the response.

GET/jobs/{job_id}/report.{json|pdf|stix|csv}

json = the full report; stix = STIX 2.1 bundle (indicators, malware, relationships); csv = defanged IOCs; pdf = the human report. 409 not_finished before done.

POST/jobs/{job_id}/cancel

Only while queued; releases the reservation.

POST/batches/{batch_id}/continue

Runs, at the normal price, the samples of this batch that were not run because the free trial ended with its first C2 (jobs with canceled_reason: "trial_ended"). Optional JSON body {"notify_email": true|false}; header Idempotency-Key (default continue:<batch_id>). The answer is a POST /samples answer for ONE new batch (same holds, checks and errors: 402 insufficient_balance, nothing queued). Afterwards each stopped job has continued_as: "<new batch_id>". 404 for an unknown batch, 409 nothing_to_continue when none is waiting (already continued, or none was stopped).

Duplicates are re-scored (2026-11-28)

A duplicate (duplicate_of set, $0) shows the original job's result scored with TODAY's rules: when the original was billed under an older rules version, its stored evidence is scored again (no new run). So a duplicate can show a different outcome or C2 list than the original job, which keeps the result it was charged for. A C2 is live: true only when the job's outcome is live; an endpoint that answered but was not confirmed has liveness.state unknown, reason answered_unconfirmed.

POST/jobs/{job_id}/dispute

Body {"reason": "<≤1000 chars>"}, within 7 days of finished_at, only for charged jobs. → {"dispute": "open"}. An admin reviews; approved → the charge is credited back.

GET/balance

JSON
{"balance_cents": 50000, "held_cents": 2500, "available_cents": 47500,
 "prices": {"live": 2500, "dead": 900, "none": 0},
 "trial": {"active": false, "samples_left": 0},
 "fair_use": {"limit": 30, "used": 4, "resets_at": 0},
 "topup_url": "https://app.tajapps.com/dashboard/unmask/wallet"}

GET/usage?month=YYYY-MM

Counts and cents by outcome for the month.

Webhooks POST/webhooks GET/webhooks DELETE/webhooks/{id}

Create body {"url": "https://…", "events": ["job.done"]} → returns id and secret (shown once). URL rules: https, port 443, public address only (checked at create and at every send). Delivery: POST JSON {"id": "evt_…", "type": "job.done", "created_at": 0, "data": {"job_id": "j_a", "batch_id": "b_x", "outcome": "live", "charge_cents": 2500}} with headers Privara-Signature: t=<unix>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" with the secret> and Privara-Event-Id. Receivers must check the signature and reject t older than 5 minutes. Retries with backoff for 24 h on non-2xx. No report content in the webhook: fetch it with the key.

Reference

Clarifications

  1. c2[].kind ∈ url | ip | domain | host_port; every C2 also has host and port (integer or null) so clients never parse the value.
  2. Every job has web_url (the dashboard page for that job, opens after sign-in) next to report_url (needs the API key). Integrations link to web_url.
  3. outcome is JSON null until status is done; for failed and canceled it stays null and charge_cents is 0.
  4. Refused codes (submit and job refused.code): not_apk, bad_archive, manifest_unreadable, too_large, zip_bomb, unsafe_entry, known_clean, duplicate_in_batch. File names do not matter (only content); they are echoed back for the client's convenience.
  5. GET /balance also returns limits: {"max_file_mb": 200, "max_files_per_batch": 10}.
  6. Idempotency-Key: 8 to 128 chars of [A-Za-z0-9_.:-]; recommended: the sample's SHA-256 (single file) or a client UUID (batch).
  7. GET /jobs?sha256=<hex> finds this account's jobs for a sample (no charge, no new job).
  8. Polling: while a job is queued/running, GET /jobs/{id} sends Retry-After: 30; typical duration on the sandbox phone 20 to 60 minutes, up to about 90 with an Android 14 retry, plus any wait behind other samples; clients should not poll faster than every 15 s. While a job is queued or running, its progress object says what it is doing (see the job object).
  9. Errors: missing scope → 403 missing_scope; invalid/revoked key → 401 invalid_key; another account's id → 404 not_found. Also: 409 idempotency_key_reused / idempotency_in_progress / not_finished, not_cancelable, not_disputable, already_disputed, dispute_window_closed, 415 unsupported_media_type, 411 length_required, unexpected_field, invalid_parameter, invalid_url, 429 rate_limited.
  10. job.done webhooks also fire for failed and canceled jobs; data carries status, and outcome is null for those. Dispute → 200; webhook create → 201.
  11. Idempotency stores only successful submits, so a retry after a top-up (402 first) works with the same key. A trial with too few samples left answers 402 insufficient_balance.
  12. (2026-11-25, additive) every c2[] entry also carries liveness: {"state": "live|unreachable|unknown", "reason": "<code>", "checked_at": <unix>|null, "explain": "<one plain sentence>"} and, for information only (never affects the charge), intel: {"known": bool, "feeds": ["threatfox"|"urlhaus"|"feodo"], "malware": "", "first_seen": ""} from abuse.ch. Reason codes include http_answer, tcp_accepted, runtime_reply, parked, front (a CDN / cloud front answered: not proof), re_registered, cert_changed, sinkholed, resolves_non_public, no_address, default_page, suspended, provider_404, tcp_timeout, tcp_refused. A silent C2 is checked twice about an hour apart before a dead bill is final, so a job can stay running for up to an hour after its analysis ends.
  13. (2026-11-25, additive) when our AI review judged a C2 that our probe saw answer, its liveness also carries ai: {"verdict": "live_c2|not_c2_service|unreachable|unsure", "reason": "<one plain sentence>"} (absent otherwise; clients must ignore unknown fields). The AI only ever LOWERS a result: two more reason codes, ai_not_c2 (state unreachable: what answered is not the attacker's service, e.g. parked, a default page, a sinkhole, a CDN front, a new owner) and ai_unreachable (state unknown), and then explain carries the AI's sentence. It never makes a silent C2 live, and live_c2 / unsure change nothing.
Reference

Outcomes and money

live $25 · dead $9 · none $0 · void $0 · same sample within 30 days → the earlier result at no charge when that result was charged (live or dead); after a none/void/failed result it runs again · trial until first C2, max 10 samples · fair use 30 no-result per month · each queued sample holds $25.

Trial batches (Ali 2026-11-27). The trial is 10 tries or one C2, whichever comes first. Samples uploaded together during the trial all reserve as trial samples (trial: true on the job, $0 held), and they run one after another. The trial's first C2 result ends it: every trial sample that has not started is canceled, not charged, with canceled_reason: "trial_ended"; one already running finishes free. The batch e-mail, the job page and privara-unmask ask whether to run them at the normal price (POST /batches/{id}/continue). The trial's end reason is then first_c2, even when the upload had already taken the last trial samples.

Reference

The CLI: privara-unmask

A small command-line client for this API, for terminals and CI. It is one Python 3 file with no dependencies, and it is separate from the privara device CLI: it uses only an Unmask API key and talks only to this API.

curl -fsS -o privara-unmask https://unmask-api.tajapps.com/cli/privara-unmask && chmod +x privara-unmask
./privara-unmask set-key                          # paste the key (hidden), or pipe it on stdin
./privara-unmask balance
./privara-unmask submit a.apk b.apk --wait --require-c2 -o reports/
  • Key: from PRIVARA_UNMASK_API_KEY (a CI secret), else the file set-key writes in ~/.config/privara-unmask/ (readable by you only). It is never taken from a command-line argument and never printed. A privara login token does not work here.
  • Address: https://unmask-api.tajapps.com by default; change it with privara-unmask config --base URL or PRIVARA_UNMASK_API_BASE. HTTPS only; redirects are never followed.
  • Actions: set-key, forget-key, config, balance, submit FILE... [--wait] [--require-c2] [-o DIR] [--formats pdf,json] [--label TEXT] [--no-mail] [--rerun] [--idempotency-key K], continue BATCH, status JOB|BATCH [--wait], wait JOB|BATCH, list, report JOB [--format] [-o PATH], cancel JOB, usage [--month YYYY-MM], help, --version; add --json for machine output.
  • submit sends an Idempotency-Key made from the files' SHA-256 and the label, so a retried CI job within 24 hours gets the same batch and is not charged twice. --rerun analyses again a sample done in the last 30 days.
  • A sample that was not run because the free trial ended is shown as such, with the command to run it at the normal price (privara-unmask continue BATCH).
  • Exit codes: 0 ok, 1 error, 2 with --require-c2 when a sample finished without a C2 (or failed or was not run), 3 when --wait timed out.
Guide

Verifying webhooks

Check every delivery. v1 is the hex HMAC-SHA256 of "<t>.<raw body>", keyed with the endpoint’s secret. Compute it over the raw request bytes, before any JSON parsing, compare in constant time, and reject a t more than 5 minutes old.

Python: verifying the signature
import hashlib
import hmac
import time


def verify_privara_signature(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
    """True only for a delivery signed with `secret` within the last `tolerance` seconds."""
    try:
        parts = dict(item.strip().split("=", 1) for item in header.split(","))
        ts, sig = parts["t"], parts["v1"]
        age = time.time() - int(ts)
    except (KeyError, ValueError):
        return False
    if age > tolerance or age < -tolerance:
        return False
    expected = hmac.new(secret.encode(), ts.encode() + b"." + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, sig)
Python: a receiver (Flask)
import os

from flask import Flask, abort, request

app = Flask(__name__)
SECRET = os.environ["PRIVARA_WEBHOOK_SECRET"]
seen = set()  # use your database in production


@app.post("/privara/unmask")
def unmask_webhook():
    if not verify_privara_signature(request.get_data(), request.headers.get("Privara-Signature", ""), SECRET):
        abort(400)
    event_id = request.headers.get("Privara-Event-Id", "")
    if event_id in seen:
        return "", 200
    seen.add(event_id)
    event = request.get_json()
    if event["type"] == "job.done":
        queue_report_fetch(event["data"]["job_id"])  # your code: GET /jobs/{id} with the API key
    return "", 200
Help

Questions

Using Claude or another AI assistant? See the MCP connector guide. Questions about the API, a connector, or a volume price for a vendor or feed: talk to us. Prices and the trial are explained on the Unmask page; the rules are in the Unmask pay-per-result terms.

Free until your first C2

Get a key and send your first sample.

Up to 10 samples free. Then $25 for a live C2, $9 for a dead one, and nothing when nothing is found.