hosting

POST /v1/sites/{siteId}/security/clean

Scan and clean a site's malware now.

All hosting endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

Authentication

Send an API key as a bearer token. The key must carry the sites.restart permission; a key without it is refused with 403, not 404.

This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.

curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/security/clean \
  -H "Authorization: Bearer zdk_live_…"

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console

Details

Clean now — the same durable scan as startSiteSecurityScan, which then cleans what the scanner can, moves what it cannot out of the document root into the hosting account's zinn-quarantine folder (kept, never deleted, restorable) and always records a row in listSiteSecurityHistory. Works for every site type (static, PHP, WordPress, Node): each step is per file. Files a site cannot open without (wp-config.php, index.php, index.html, .htaccess, …) are never moved aside; if one is infected the clean is failed and a person decides. Requires sites.restart — it changes files on the site. 202 with the site's state; one per site at a time (a second request joins the running one). 422 when the site cannot be scanned or is not running; 503 when the durable-execution service is unreachable.

Parameters

NameTypeRequiredWhat it is
siteId (path)UuidYesSite ID (UUIDv7).

Response

NameTypeRequiredWhat it is
statusMalwareStatusYesA site's scan verdict. There is deliberately no unscanned member: a site nothing has looked at yet is clean with last_scan_at: null, which is one nullable timestamp…
last_clean_atobjectNoWhen the platform last cleaned or quarantined malware on this site automatically or on Clean now. null = never needed to.
clean_failed_atobjectNoSince when a clean has been failing (a finding the platform could neither clean nor move aside, such as an infected wp-config.php). null = not failing. Only this lets the…
last_scan_atobjectYesWhen a scan last completed. null = never scanned. A scan that failed does not stamp this, so a stale success can never be mistaken for a fresh one.
detectionsMalwareDetection[]Yes—
recent_resolutionsResolvedMalwareDetection[]YesFindings that were present and are not any more, most recently cleared first — the record of the protection having worked, which an all-clear alone cannot show. resolved_at…
can_rescanbooleanYesWhether rescanSite will accept a request for this site: false while a scan is already running, false for a site that is not running at all (there is no document root to scan),…
last_scan_error_codestring<, scan_conflict, scanner_unreachable, scanner_missing, scan_failed>YesWhy a scan that ran could not finish; empty when none has failed. Non-empty means an attempt was made against this site and broke — an unreachable host, a vendor error, a scan…
unavailable_reasonstringYesWhy no scan was attempted; empty when one was. A stable machine identifier for the client to localise, never a sentence and never a vendor name. vendor_unsupported — the…
runtimeSiteRuntimeSecurityYesWhat our runtime sensor saw happen on this site, and whether anything was watching it at all. The malware fields above are a verdict on files at rest; this is the other half —…

Errors this endpoint can return

401 · 403 · 404 · 422 · 429 · 503