# Enable/Disable 8G Firewall
Enable or disable the 8G Firewall on a specific application. This applies application-level firewall rules on the server web stack (Nginx, Apache, or OpenLiteSpeed).
Requires the 8G Firewall permission at the application level.
The current 8G Firewall status can be checked in the 8g_firewall field of the Application Show API response.
# HTTP Request:
POST https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/firewall/8g/toggle
# Parameter:
| Parameters | Required | Type | Description |
|---|---|---|---|
| enabled | Yes | Boolean | true to enable 8G Firewall, false to disable |
# Curl Request Example:
curl --request POST \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/firewall/8g/toggle" \
--header 'content-type: application/json' \
--header 'accept: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{
"enabled": true
}'
# Response:
# 8G Firewall Enabled Successfully
- 200 (Ok)
{
"message": "8G firewall enabled successfully.",
"firewall": {
"8g": {
"enabled": true
}
}
}
# 8G Firewall Disabled Successfully
- 200 (Ok)
{
"message": "8G firewall disabled successfully.",
"firewall": {
"8g": {
"enabled": false
}
}
}
# Organization Not Found
- 404 (Not Found)
{
"message": "Organization not found!"
}
# Server Not Found
- 404 (Not Found)
{
"message": "Server not found!"
}
# Application Not Found
- 404 (Not Found)
{
"message": "Application not found!"
}
# Invalid Firewall Type
- 400 (Bad Request)
Returned when the firewall type in the URL is not 8g.
{
"message": "Invalid firewall type."
}
# 8G Firewall Already Enabled
- 500 (Internal Server Error)
{
"message": "8G Firewall is already enabled."
}
# 8G Firewall Already Disabled
- 500 (Internal Server Error)
{
"message": "8G Firewall is already disabled."
}
# Permission Denied
- 403 (Forbidden)
{
"message": "You cannot perform this action. Because, You do not have permission for this action."
}
# Server Error
- 500 (Internal Server Error)
{
"message": "Something went wrong."
}