POST
/rules/presets Create preset
Creates a new preset with the provided details.
Request Body
idintegerdestinationstringRequirednotestringpresetstringRequiredallow-cf-weballow-common-dnsblock-sshblock-rdpblock-common-vectorsipsarrayResponse
200
400
dataobjectrule_idintegersuccessbooleanRequest
curl -X POST "https://shield.royalehosting.net/api/v2/rules/presets" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "x-organization-id: YOUR_ORG_ID" \
-H "Content-Type: application/json" \
-d '{}'Request
const response = await fetch("https://shield.royalehosting.net/api/v2/rules/presets", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"x-organization-id": "YOUR_ORG_ID",
"Content-Type": "application/json",
},
body: JSON.stringify({
"id": 0,
"destination": "45.90.13.24/32",
"note": "Example Preset",
"preset": "block-common-vectors",
"ips": []
}),
});
const data = await response.json();Request
import requests
response = requests.post(
"https://shield.royalehosting.net/api/v2/rules/presets",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"x-organization-id": "YOUR_ORG_ID",
}
)
print(response.json())Response
{
"data": {
"rule_id": 12244
},
"success": true
}