hosting
POST /v1/sites/{siteId}/security/clean
Scan and clean a site's malware now.
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
| Name | Type | Required | What it is |
|---|---|---|---|
siteId (path) | Uuid | Yes | Site ID (UUIDv7). |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
status | MalwareStatus | Yes | A 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_at | object | No | When the platform last cleaned or quarantined malware on this site automatically or on Clean now. null = never needed to. |
clean_failed_at | object | No | Since 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_at | object | Yes | When 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. |
detections | MalwareDetection[] | Yes | — |
recent_resolutions | ResolvedMalwareDetection[] | Yes | Findings 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_rescan | boolean | Yes | Whether 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_code | string<, scan_conflict, scanner_unreachable, scanner_missing, scan_failed> | Yes | Why 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_reason | string | Yes | Why 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… |
runtime | SiteRuntimeSecurity | Yes | What 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