Get a site's Cloudflare protection
/v1/sites/{siteId}/protection Returns the site's Cloudflare protection: whether it's on, the site's name at Cloudflare (edge), and each of its domains with where it stands and the DNS record that sends it through Cloudflare.
Who changes a domain's DNS depends on where it is (dnsBy): Rabbitflare switches domains bought from Rabbitflare, and domains whose DNS is in a Cloudflare account you connected to Rabbitflare; for any other, set its record at its DNS company once its status is ready. Poll it to follow a change: what Rabbitflare knows about each domain's DNS is brought up to date in the background.
Scopes
The token needs this scope. Without it, the request is refused with insufficient_scope (see Scopes).
-
sites:read - View sites. See sites and their domains, CDN, firewall, malware protection, backups, staging, resources, SMTP and Media Offload. SMTP includes who each site's recent emails went to, their subjects, and the team's sign-in addresses.
Path parameters
| Field | Type and description |
|---|---|
siteId Required | string The site's id. |
Example request
curl "https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection" \
-H "Authorization: Bearer $RABBITFLARE_TOKEN" const res = await fetch("https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection", {
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.sites.protection.get({ siteId: "8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d" });
console.log(data); <?php
$ch = curl_init('https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection');
curl_setopt_array($ch, [
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.get(
"https://api.rabbitflare.com/v1/sites/8a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/protection",
headers={
"Authorization": "Bearer " + os.environ["RABBITFLARE_TOKEN"],
},
timeout=120,
)
response.raise_for_status()
print(response.json()["data"]) Response
200 OK Returns the SiteProtection object in data.
The SiteProtection object's fields 22 fields
| Field | Type and description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
on | boolean Whether Cloudflare protection is switched on for the site. | ||||||||
status | string
Known values: | ||||||||
error | string or null Why turning it on or off failed (with | ||||||||
edge | string or null The site's own name at Cloudflare, like shop-x7k2p.rabbitflare.net: each domain goes through Cloudflare once its DNS points here. Null when the site can't be protected (contact support). | ||||||||
needs | string or null What the site needs before protection can go on (a domain of your own as its primary domain). Null when nothing, and while it's on. | ||||||||
domains | array of objects The site's own domains, while protection is on (its built-in address isn't listed). Empty while it's off. | ||||||||
domainId | string The domain's id, as the site's list of domains gives it. | ||||||||
hostname | string The domain, like www.example.com. | ||||||||
status | string
Known values: | ||||||||
detail | string or null What's happening with it, or why it waits or was refused, in a sentence. Null when it's protected. | ||||||||
record | object or null The DNS record that sends the domain through Cloudflare. At Cloudflare, set it to DNS only (grey cloud), and remove other A, AAAA or CNAME records of the same name (keep MX and TXT records: they're for email). Null for a root domain whose DNS company can't point it at a name. Show its 3 fields
| ||||||||
dnsBy | string Who changes its DNS: Known values: | ||||||||
dnsCompany | object or null The DNS company its nameservers belong to. Null when not known yet or not recognised, and for domains bought from Rabbitflare. Show its 3 fields
| ||||||||
locked | boolean Whether the site's server already refuses visitors who skip Cloudflare on its protected domains (an hour after a domain starts coming through Cloudflare). | ||||||||
stillPointed | array of strings While it's off: domains whose DNS still points at the site's name at Cloudflare. They keep working (that name now leads straight to the server); point them back at the server when you like. | ||||||||
connectFor | array of strings While it's on: domains whose DNS is in a Cloudflare account that isn't connected to Rabbitflare. Connect that account in the panel and Rabbitflare switches them for you; otherwise set their |
Example response
{
"data": {
"on": true,
"status": "active",
"error": null,
"edge": "shop-x7k2p.rabbitflare.net",
"needs": null,
"domains": [
{
"domainId": "c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f",
"hostname": "shop.example.com",
"status": "ready",
"detail": "Its certificate is ready. Change the record now.",
"record": {
"type": "CNAME",
"name": "shop.example.com",
"value": "shop-x7k2p.rabbitflare.net"
},
"dnsBy": "you",
"dnsCompany": {
"id": "godaddy",
"name": "GoDaddy",
"root": "none"
}
}
],
"locked": false,
"stillPointed": [],
"connectFor": []
}
} 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. |
Rate limit
Read requests: 120 a minute per token, 240 per account. More in Rate limits.
Added on .
Deprecated since November 28, 2026; it stops working on November 30, 2027. Cloudflare protection was removed from Rabbitflare on 28 November 2026: this operation answers `403 feature_unavailable` for every site, and goes in v2.