Detach a firewall preset
Detaches a preset from its owner. Send the preset's slug in confirm_preset, in the request body. The preset's ranges stop being allowed through this owner.
DELETE/ api/ firewall/ preset-subscriptions/ {subscription}
Path parameters
subscriptionintegerRequired
The id of an attached preset, as the lists answer it in presets[].id. Digits only. At least 1.
Body
confirm_presetstringRequired
The preset's slug. Up to 64 characters.
Returns
202 The preset was detached. Follow change_id with GET /firewall/changes/{change}. Poll the operation until it finishes.
Fields of the 202 answer
change_idinteger or nullRequired
The change to follow with GET /firewall/changes/{change}. Null when nothing needs applying.
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | firewall_not_editable | You can see this entry but you cannot change it. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
404 | not_found | Not found. |
422 | confirm_mismatch | Send the confirmation exactly as the field named in field asks for it. |
422 | invalid_arguments | The arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again. |
429 | firewall_throttled | Too many firewall changes. Wait a minute and try again. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X DELETE https://manage.corefinity.com/api/firewall/preset-subscriptions/310 \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"confirm_preset": "github-actions"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->delete('https://manage.corefinity.com/api/firewall/preset-subscriptions/310', [
'confirm_preset' => 'github-actions',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/firewall/preset-subscriptions/310', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
confirm_preset: 'github-actions',
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.delete(
"https://manage.corefinity.com/api/firewall/preset-subscriptions/310",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"confirm_preset": "github-actions",
},
)
data = res.json() if res.content else None{
"change_id": 5314
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "confirm_mismatch",
"errors": {
"confirm_preset": [
"The confirmation does not match."
]
},
"field": "confirm_preset",
"message": "The confirmation does not match.",
"reason": "confirm_mismatch"
}{
"code": "firewall_throttled",
"field": null,
"message": "Too many firewall changes. Wait a minute and try again.",
"reason": "firewall_throttled"
}Try it
Try it is off for this endpointIt deletes data that cannot be brought back. Copy the request and run it yourself when you are sure.
Was this helpful?