Turn on a server's security
/v1/servers/{serverId}/security/actions/enable Turns Imunify360 on for the server. It's free: Imunify360 comes with servers Rabbitflare creates (Intel or AMD processors, 2 GB of memory or more), and the server's oldest site gets malware protection included (unless a site has it already). It uses about 300 MB of the server's memory, and its web application firewall rules take the place of Rabbitflare's own for the server's sites.
What happens next. The answer is 202 with status: "installing". A few minutes later it's on (server.security_enabled), or failed (server.security_failed; turn it on again to retry). Sent again while it's still installing, it answers 202 again; 200 once it's on.
Refusals. 409 not_supported when the server can't run it (available: false says why), 409 busy while it's being turned off. After a failure, sites that had malware protection keep it, so turning it back on would restart each extra site's charge ($2.99 a month): while more than one site has it, the API refuses that (409 invalid_state): do it in the panel, or turn it off for the server.
The panel's own limit applies too: 10 switches a minute per person, shared with the panel (429 rate_limited).
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
servers:write - Manage servers. Power, reboot, snapshots and restores, log settings, restarting PHP, server security (Imunify360), and connecting your own servers.
Headers
| Field | Type and description |
|---|---|
Idempotency-Key | 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 |
|---|---|
serverId Required | string The server's id. |
Example request
curl -X POST "https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/enable" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/enable", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RABBITFLARE_TOKEN}`,
},
});
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 });
const data = await rf.servers.security.enable({ serverId: "3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d" });
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/enable');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RABBITFLARE_TOKEN'),
],
]);
$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 requests
response = requests.post(
"https://api.rabbitflare.com/v1/servers/3f6c1a2b-8d4e-4b7a-9c2d-1e5f7a8b9c0d/security/actions/enable",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
202 Accepted Returns the ServerSecurity object in data. It can also answer 200 OK.
The ServerSecurity object's fields 96 fields
| Field | Type and description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status | string Imunify360 on the server: Known values: | ||||||||||||
available | boolean Whether the server can run Imunify360: servers Rabbitflare creates and you pay for, with Intel or AMD processors and 2 GB of memory or more. Always true once it's on (or on its way in or out), so it can be turned off. | ||||||||||||
unavailableReason | string or null Why it can't run here (with | ||||||||||||
lastError | string or null What went wrong (with | ||||||||||||
extraSitePriceCents | integer What each site with malware protection on costs a month, past the server's included one, in US cents (299): billed after each month, by the days it was on. | ||||||||||||
currency | string Always Always | ||||||||||||
sites | array of objects The server's live sites (staging copies aren't among them), oldest first. Every site is guarded by the server's firewall whatever its own switch says. | ||||||||||||
siteId | string The site's id. | ||||||||||||
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. | ||||||||||||
enabledAt | string or null An ISO 8601 time, in UTC When it was turned on. Null while it's off. | ||||||||||||
openThreats | integer Threats found and not cleaned or ignored. | ||||||||||||
checkedAt | string or null An ISO 8601 time, in UTC When the server last reported its figures (newer ones are fetched in the background once they're over 30 seconds old). Null while Imunify360 isn't on. | ||||||||||||
refreshing | boolean Newer figures are being fetched from the server: read again in a few seconds. | ||||||||||||
stats | object The server's figures. Zero while Imunify360 isn't on. | ||||||||||||
attacksStopped24h | integer Attacks blocked or challenged in the last 24 hours. | ||||||||||||
openThreats | integer Threats found and not cleaned or ignored, on every site. | ||||||||||||
cleaned30d | integer Threats cleaned in the last 30 days. | ||||||||||||
blockedAddresses | integer Addresses and countries blocked now. | ||||||||||||
lastScanAt | string or null An ISO 8601 time, in UTC When the last scan started. Null when none has run. | ||||||||||||
vulnerable | integer Plugins, themes and WordPress installs with open security holes, on every site. | ||||||||||||
settings | object or null Imunify360's settings. Null until it's on. | ||||||||||||
realtime | boolean Real-time scanning: each file written to a site is checked at once. | ||||||||||||
scanInterval | string How often every site with malware protection on is scanned: Known values: | ||||||||||||
scanHour | integer The hour scheduled scans start, 0 to 23, in UTC. | ||||||||||||
scanDay | integer The day scheduled scans run: 0 (Sunday) to 6 for weekly scans, 1 to 28 for monthly ones. | ||||||||||||
intensity | string How much of the server's processor and disk scans may use: Known values: | ||||||||||||
dbScan | boolean Scheduled scans check the sites' databases too. | ||||||||||||
crontabs | boolean Scans check the server's scheduled tasks too. | ||||||||||||
rapidScan | boolean Scheduled scans skip files unchanged since the last one. | ||||||||||||
adminTools | boolean Database and file managers uploaded to sites count as threats. | ||||||||||||
cleanMode | string What happens when malware is found: Known values: | ||||||||||||
keepCopiesDays | integer Days a copy of each cleaned file is kept, so a clean-up can be undone (1 to 90). | ||||||||||||
dos | boolean Blocks an address that holds too many connections open at once (a denial-of-service attack). | ||||||||||||
dosLimit | integer How many connections an address may hold open at once (100 to 10000). | ||||||||||||
enhancedDos | boolean Also blocks an address that sends too many requests in a short time. | ||||||||||||
enhancedDosLimit | integer How many requests an address may send in | ||||||||||||
enhancedDosSeconds | integer The time | ||||||||||||
sshBruteForce | boolean Blocks addresses that keep guessing SSH passwords. | ||||||||||||
intrusionDetection | boolean Intrusion detection: blocks addresses the server's logs show attacking it. | ||||||||||||
portsMode | string
Known values: | ||||||||||||
ruleset | string The web application firewall's rules: Known values: | ||||||||||||
wpBruteForce | boolean Blocks addresses that keep guessing WordPress passwords. | ||||||||||||
cmsRules | boolean Rules for the software a site runs (WordPress and its plugins). | ||||||||||||
captcha | boolean A suspicious visitor is asked to prove it's a person (a CAPTCHA) before being blocked. | ||||||||||||
antibot | boolean Bot checks: a browser is checked before it reaches the sites, so bad bots are stopped. | ||||||||||||
cdnSupport | boolean Reads a visitor's real address behind a CDN or proxy (Cloudflare and others), so the right address is blocked. | ||||||||||||
reputation | boolean Checks the sites' domains against blacklists once a day. | ||||||||||||
alerts | object Which emails the account's owner gets about the server's sites (each site can also turn its own off). Show its 4 fields
| ||||||||||||
ports | array of objects The ports | ||||||||||||
port | integer The port. | ||||||||||||
protocol | string
Known values: | ||||||||||||
comment | string or null The note it was added with: your own words. Null when none was. | ||||||||||||
allowedAddresses | array of strings Addresses that still get through while the port is blocked. | ||||||||||||
disabledRules | array of objects Rules turned off ( | ||||||||||||
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. | ||||||||||||
scans | array of objects Recent scans of the server's sites, newest first. | ||||||||||||
siteId | string or null The site scanned. Null when it couldn't be told which. | ||||||||||||
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. | ||||||||||||
kernelPatching | object KernelCare: the server's kernel gets security patches without a restart. Free with Imunify360. | ||||||||||||
status | string KernelCare on the server: Known values: | ||||||||||||
patchedTo | string or null The kernel version it has patched the server up to. Null when not known. | ||||||||||||
reputation | object Blacklist checks of the sites' domains ( | ||||||||||||
checkedAt | string or null An ISO 8601 time, in UTC When the domains were last checked. Null when they never were. | ||||||||||||
domains | array of objects Each domain of the server's sites, as last checked. Show its 4 fields
| ||||||||||||
wordpressPlugin | object Imunify360's WordPress plugin (Imunify Security). | ||||||||||||
enabled | boolean Whether the plugin is on for the server: it goes onto every site with malware protection on. | ||||||||||||
sites | array of objects The sites with malware protection on, while the plugin is on. Show its 5 fields
| ||||||||||||
crawlers | array of objects Search engines the bot checks always let through. | ||||||||||||
id | string The search engine's id on the server (digits): | ||||||||||||
name | string Its name: Imunify360's own, or the one it was added with. | ||||||||||||
url | string or null Where it says how to recognise its crawlers, as it was added. Null when none was given. | ||||||||||||
domains | array of strings Where its crawlers' addresses' names end. | ||||||||||||
builtIn | boolean One of Imunify360's own (Google, Bing, Yandex, Baidu): always let through, it can't be removed. |
Example response
{
"data": {
"status": "installing",
"available": true,
"unavailableReason": null,
"lastError": null,
"extraSitePriceCents": 299,
"currency": "usd",
"sites": [
{
"siteId": "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"enabled": true,
"included": true,
"enabledAt": "2026-11-25T09:20:00.000Z",
"openThreats": 0
},
{
"siteId": "7c2e9a41-3b5d-4f68-a1c9-5d2e8f0b4a67",
"enabled": false,
"included": false,
"enabledAt": null,
"openThreats": 0
}
],
"checkedAt": null,
"refreshing": false,
"stats": {
"attacksStopped24h": 0,
"openThreats": 0,
"cleaned30d": 0,
"blockedAddresses": 0,
"lastScanAt": null,
"vulnerable": 0
},
"settings": null,
"ports": [],
"disabledRules": [],
"scans": [],
"kernelPatching": {
"status": "unknown",
"patchedTo": null
},
"reputation": {
"checkedAt": null,
"domains": []
},
"wordpressPlugin": {
"enabled": false,
"sites": []
},
"crawlers": []
}
} 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 |
|---|---|
403 feature_ | This product isn't open to the account. Contact support if you'd like it opened. |
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 not_ | The server's cloud doesn't offer this (for example, whole-server snapshots on Amazon EC2 and Google Cloud), or the server's kind or size doesn't allow it (Imunify360 on a server of your own, or under 2 GB of memory). Use what the cloud offers instead: for snapshots, site backups. Imunify360 needs a server Rabbitflare creates, with Intel or AMD processors and 2 GB or more ( |
409 busy | Another change is still in progress on this server or site, or something else under way stops this one for now (a site backup running on the server, the server's backups being moved): Wait until it finishes, then try again. A change to the server or site itself is done when its |
409 invalid_ | The resource's status doesn't allow this now (for example, powering on a server that is running). Check the resource's |
409 server_ | The server isn't in a state that allows this (for example, it's off or still being set up). Start the server, or wait until it's active, then try again. |
409 server_ | The server's current change hasn't finished yet. Wait until the server's change finishes, then try again. |
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 |