Turn on a site's malware protection
/v1/sites/{siteId}/malware-protection/actions/enable Turns malware protection on for the site: Imunify360 scans it, cleans what it finds and watches what it has installed for known security holes. The server's included site costs nothing; each other site with malware protection on is $2.99 a month, by the days it's on, billed after the month (from the wallet first, then the saved card). Up to 30 sites a server can have it (409 limit_reached).
Paying. It's treated as spending money whether or not this site would be the included one (the price depends on the server's other sites, which can change between a look and this call): it needs billing:write, an Idempotency-Key, and the account's agreement to card charges (403 charges_not_authorized, given once in the panel's Billing). Nothing is charged now. An extra site needs a saved card even when the wallet has money (402 payment_method_required): the month's bill goes to the card when the wallet can't pay it.
The answer is the site's malware protection with the change in it. Imunify360 must be on for the server (409 security_off; 409 not_ready while it's still installing), and the site live (a staging copy: 409 staging_copy). malware_protection.enabled follows.
The panel's own limit applies too: 20 switches a minute per person, shared with the panel (429 rate_limited).
Scopes
The token needs these scopes. Without them, the request is refused with insufficient_scope (see Scopes).
-
sites:write - Manage sites. Domains, SSL, CDN, cache, firewall, malware protection, resources, backups, staging, Media Offload, SMTP and RabbitPress Cache. Choosing Rabbitflare Backup for a site's backups, and turning on Media Offload or a site's malware protection, also need Turn on paid features: they start monthly charges.
-
billing:write - Turn on paid features. Turn on site features that are billed to this account each month: Rabbitflare Backup for a site's backups, Media Offload, and a site's malware protection. Needs a token for all servers.
Headers
| Field | Type and description |
|---|---|
Idempotency-Key Required | string 1 to 255 characters A key of your own for this request, like a UUID: letters, digits and |
Path parameters
| Field | Type and description |
|---|---|
siteId Required | string The site's id. |
Example request
# Keep this key when you send the same request again (after a timeout, say), so it's only done once.
KEY=$(uuidgen)
curl -X POST "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/enable" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" \
-H "Idempotency-Key: $KEY" import { randomUUID } from "node:crypto";
// Keep this key when you send the same request again (after a timeout, say), so it's only done once.
const idempotencyKey = randomUUID();
const res = await fetch("https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/enable", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
"Idempotency-Key": idempotencyKey,
},
});
if (!res.ok) throw new Error(`Rabbitflare API error ${res.status}: ${await res.text()}`);
const { data } = await res.json();
console.log(data); import { Rabbitflare } from "@rabbitflare/api";
const rf = new Rabbitflare({ token: process.env.RABBITFLARE_TOKEN });
// The SDK sends an Idempotency-Key and keeps it when it sends the request again, so it's only done once.
const data = await rf.sites.malwareProtection.enable({
siteId: "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
});
console.log(data); <?php
// Keep this key when you send the same request again (after a timeout, say), so it's only done once.
$idempotencyKey = bin2hex(random_bytes(16));
$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/enable');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
'Idempotency-Key: ' . $idempotencyKey,
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($body === false || $status >= 400) {
throw new RuntimeException("Rabbitflare API error $status: $body");
}
print_r(json_decode($body, true)['data']); import os
import uuid
import requests
# Keep this key when you send the same request again (after a timeout, say), so it's only done once.
idempotency_key = str(uuid.uuid4())
response = requests.post(
"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/malware-protection/actions/enable",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
"Idempotency-Key": idempotency_key,
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
200 OK Returns the SiteMalwareProtection object in data.
The SiteMalwareProtection object's fields 68 fields
| Field | Type and description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
serverId | string The site's server. | ||||||||||||
available | boolean Whether the site can have malware protection: a live site (not a staging copy) on a server that can run Imunify360. | ||||||||||||
unavailableReason | string or null Why it can't (with | ||||||||||||
serverSecurityStatus | string Imunify360 on the site's server (malware protection needs it Known values: | ||||||||||||
enabled | boolean Whether malware protection is on for the site. | ||||||||||||
included | boolean The site that comes with the server at no charge: the first to have it on. | ||||||||||||
priceCents | integer What the site's malware protection costs a month, in US cents: 0 while the site is the included one (or would be, turned on now, with no other site on), else 299. Billed after each month, by the days it was on. | ||||||||||||
currency | string Always Always | ||||||||||||
sitesEnabledOnServer | integer How many of the server's sites have it on (this one too, when it has). | ||||||||||||
checkedAt | string or null An ISO 8601 time, in UTC When the server last reported its figures. Null while Imunify360 isn't on. | ||||||||||||
refreshing | boolean Newer figures are being fetched from the server: read again in a few seconds. | ||||||||||||
realtime | boolean Whether the server scans each file written at once ( | ||||||||||||
keepCopiesDays | integer Days a copy of each cleaned file is kept, so a clean-up can be undone (the server's setting). | ||||||||||||
alerts | boolean Whether the account's owner is emailed about this site (threats, clean-ups, blacklists, security holes). | ||||||||||||
scans | array of objects Recent scans of the site, newest first. | ||||||||||||
kind | string
Known values: | ||||||||||||
status | string
Known values: | ||||||||||||
startedAt | string or null An ISO 8601 time, in UTC When it started. Null when not known. | ||||||||||||
finishedAt | string or null An ISO 8601 time, in UTC When it finished. Null while it runs. | ||||||||||||
files | integer or null Files it checked. Null when not known. | ||||||||||||
found | integer Threats it found. | ||||||||||||
ignoredPaths | array of objects Files and folders scans skip. | ||||||||||||
id | string The entry's id (digits): | ||||||||||||
path | string The file or folder, inside the site's folder, as it was added. | ||||||||||||
addedAt | string or null An ISO 8601 time, in UTC When it was added. Null when not known. | ||||||||||||
vulnerabilities | array of objects What the site has installed with known security holes. | ||||||||||||
id | string Its id. | ||||||||||||
kind | string A Known values: | ||||||||||||
folder | string Its folder, like contact-form-7; | ||||||||||||
name | string Its name, like Contact Form 7. | ||||||||||||
version | string or null The version installed. Null when it doesn't say. | ||||||||||||
status | string
Known values: | ||||||||||||
files | integer How many of its files carry the holes. | ||||||||||||
holes | array of objects Its known holes. Show its 3 fields
| ||||||||||||
wordpressPlugin | object Imunify360's WordPress plugin (Imunify Security) in this site. | ||||||||||||
serverEnabled | boolean Whether Imunify360's WordPress plugin is on for the server ( | ||||||||||||
status | string or null The plugin in this site: Known values: | ||||||||||||
firewall | boolean or null The plugin's firewall in the site. Null as for | ||||||||||||
aiBotProtection | boolean or null AI bot protection in the site. Null as for | ||||||||||||
preset | string or null How strict AI bot protection is: Known values: | ||||||||||||
incidents | array of objects Attacks on this site in the last 24 hours (at most 500), newest first. Not paged: an incident's id isn't kept from one look to the next. | ||||||||||||
id | string The incident's id. | ||||||||||||
occurredAt | string An ISO 8601 time, in UTC When it happened (the last time, when it happened more than once). | ||||||||||||
ip | string or null The address it came from. Null when not known. | ||||||||||||
country | string or null Where that address is, as a two-letter country code. Null when not known. | ||||||||||||
siteId | string or null The site attacked. Null when it was the server, or the site isn't known. | ||||||||||||
domain | string or null The domain attacked. Null when it was the server. | ||||||||||||
kind | string
Known values: | ||||||||||||
description | string What it was. | ||||||||||||
ruleId | string or null The rule that matched, when it can be turned off for false alarms ( | ||||||||||||
severity | string
Known values: | ||||||||||||
action | string What Imunify360 did: Known values: | ||||||||||||
times | integer How many times it happened. | ||||||||||||
wordpress | object or null With Show its 5 fields
| ||||||||||||
disabledRules | array of objects Rules turned off for this site, or for the whole server ( | ||||||||||||
ruleId | string The rule: a web application firewall rule's number, or a WordPress plugin rule's name (like RULE-CVE-2024-1234-01). | ||||||||||||
name | string What it's for: the note it was turned off with (your own words), or the attack it stops. | ||||||||||||
source | string
Known values: | ||||||||||||
siteIds | array of strings The sites it's off for. Empty: the whole server. | ||||||||||||
domains | array of strings Those sites' domains, as the rule names them. Empty: the whole server. |
Example response
{
"data": {
"serverId": "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d",
"available": true,
"unavailableReason": null,
"serverSecurityStatus": "on",
"enabled": true,
"included": false,
"priceCents": 299,
"currency": "usd",
"sitesEnabledOnServer": 2,
"checkedAt": "2026-11-25T09:14:02.000Z",
"refreshing": false,
"realtime": true,
"keepCopiesDays": 14,
"alerts": true,
"scans": [
{
"kind": "nightly",
"status": "done",
"startedAt": "2026-11-25T03:00:12.000Z",
"finishedAt": "2026-11-25T03:02:40.000Z",
"files": 4334,
"found": 1
}
],
"ignoredPaths": [
{
"id": "3",
"path": "wp-content/plugins/my-backup-tool/restore.php",
"addedAt": "2026-11-24T16:20:00.000Z"
}
],
"vulnerabilities": [
{
"id": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d:plugin:contact-form-7",
"kind": "plugin",
"folder": "contact-form-7",
"name": "Contact Form 7",
"version": "5.3.1",
"status": "vulnerable",
"files": 2,
"holes": [
{
"cve": "CVE-2020-35489",
"type": "Upload",
"description": "Unrestricted file upload vulnerability"
}
]
}
],
"wordpressPlugin": {
"serverEnabled": true,
"status": "on",
"firewall": true,
"aiBotProtection": true,
"preset": "balanced"
},
"incidents": [
{
"id": "1",
"occurredAt": "2026-11-25T09:10:02.000Z",
"ip": "45.146.165.10",
"country": "DE",
"siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"domain": "shop.example.com",
"kind": "waf",
"description": "Information disclosure attempt via WordPress plugins",
"ruleId": "77350218",
"severity": "high",
"action": "challenged",
"times": 12,
"wordpress": null
}
],
"disabledRules": [
{
"ruleId": "77350218",
"name": "Turned off for the shop's page builder",
"source": "waf",
"siteIds": [
"8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
],
"domains": [
"shop.example.com"
]
}
]
}
} Errors
The errors this request can answer besides those every request can (a missing token, a missing scope, the rate limits). Each answer is an Error object (see Errors).
| Status and code | When, and what to do |
|---|---|
400 idempotency_ | This operation needs an Idempotency-Key header: it spends money, or doing it twice isn't the same as doing it once. Send a unique Idempotency-Key (a UUID) with the request. |
402 payment_ | There's no money in the wallet and no saved card to pay with. Add funds to the wallet or save a card in the panel. |
403 charges_ | The account hasn't agreed to card charges yet. In the panel, open Billing and accept the terms once. Then try again. |
403 feature_ | This product isn't open to the account. Contact support if you'd like it opened. |
403 · 409 limit_ | A limit is reached: Delete something first, or contact support to raise the limit. |
403 all_ | The token is limited to some servers, and this operation needs a token for all servers: it changes domains or Cloudflare, or reaches Mail or billing, none of which is tied to one server. Use a token for all servers: make one in the panel with All servers. |
404 not_ | The resource doesn't exist, or isn't this account's. Check the id. Ids of other accounts' resources answer the same way. |
409 security_ | Imunify360 is off for the server (or failed), and this needs it on. Turn it on with POST /servers/{serverId}/security/actions/enable, wait for |
409 not_ | Something this needs isn't ready yet (for example, the server has no IP address yet). Wait a few minutes, then try again. |
409 staging_ | This site is a staging copy, which can't do this. Do it on the live site. A staging copy is managed through its live site's staging operations. |
409 server_ | The server is being restored, and nothing else can change it or its sites until that's done. Wait until the restore finishes (the server's |