Firewall
Firewall API for RestoreCord: read firewall logs and manage firewall rules, passwords, bypasses and Discord ban imports for your servers with an API key.
Auth: API key with SERVER_FIREWALL for every endpoint on this page.
Logs
List firewall logs
Returns paginated firewall log entries.
GET /api/v3/servers/{serverId}/firewall/logsProp
Type
Rules
List rules
Returns rules, statistics, and password details.
GET /api/v3/servers/{serverId}/firewall/rulesProp
Type
Create rule
Creates a firewall rule.
POST /api/v3/servers/{serverId}/firewall/rulesProp
Type
Toggle rule
Enables or disables a rule.
PATCH /api/v3/servers/{serverId}/firewall/rulesProp
Type
Get rule
Reads one firewall rule.
GET /api/v3/servers/{serverId}/firewall/rules/{ruleId}Prop
Type
Update rule
Updates a firewall rule.
PUT /api/v3/servers/{serverId}/firewall/rules/{ruleId}Prop
Type
Delete rule
Deletes a firewall rule.
DELETE /api/v3/servers/{serverId}/firewall/rules/{ruleId}Prop
Type
Passwords
List passwords
Returns firewall password details.
GET /api/v3/servers/{serverId}/firewall/passwordsProp
Type
Create password
Creates a password used by password firewall rules.
POST /api/v3/servers/{serverId}/firewall/passwordsProp
Type
Toggle password
Enables or disables a firewall password.
PATCH /api/v3/servers/{serverId}/firewall/passwordsProp
Type
Get password
Returns password details for one firewall password.
GET /api/v3/servers/{serverId}/firewall/passwords/{passwordId}Prop
Type
Update password
Updates password metadata.
PUT /api/v3/servers/{serverId}/firewall/passwords/{passwordId}Prop
Type
Delete password
Deletes a firewall password.
DELETE /api/v3/servers/{serverId}/firewall/passwords/{passwordId}Prop
Type
Bypasses
List bypasses
Returns active bypasses or one user's bypass.
GET /api/v3/servers/{serverId}/bypassProp
Type
Create bypass
Creates a temporary firewall bypass for a Discord user.
POST /api/v3/servers/{serverId}/bypassProp
Type
Remove bypass
Removes an active bypass for a user.
DELETE /api/v3/servers/{serverId}/bypassProp
Type
Import Bans
Preview Discord bans
Lists Discord bans not already represented as firewall rules.
GET /api/v3/servers/{serverId}/firewall/import-bansProp
Type
Import Discord bans
Creates BLOCK rules from Discord server bans.
POST /api/v3/servers/{serverId}/firewall/import-bansProp
Type
Rule Types
| Condition field | Operators and accepted value |
|---|---|
ROLE | CONTAINS / NOT_CONTAINS; current-server Discord role ID. |
GUILD | CONTAINS / NOT_CONTAINS; Discord server ID. Requires Business plan or higher. |
USERNAME | All operators; literal text or slash-delimited RE2 pattern. |
DOMAIN | All operators; email domain literal or slash-delimited RE2 pattern. |
USER | IS / IS_NOT; Discord user ID. |
IP | IS / IS_NOT; IPv4 address. |
IP_RANGE | IS / IS_NOT; IPv4 CIDR range (IS means within). |
COUNTRY / CONTINENT | IS / IS_NOT; one or more supported codes. |
ASN | IS / IS_NOT; numeric ASN, with or without AS prefix. |
{
"targetType": "USERNAME",
"operator": "CONTAINS",
"targetValue": "/discord(\\.gg|nitro)/i",
"actions": [{ "type": "BLOCK" }],
"name": "Block scam usernames"
}Constraints
- Regex patterns are limited to 200 characters, use RE2 syntax, and accept only
i,m, andsflags. REQUIRE_PASSWORDactions require an active firewall password.BLOCKcannot be combined withGIVE_ROLE; other decisions accept up to five distinct role effects.- Creating, updating, or turning on a rule requires a Premium or higher server owner. Turning a rule off, listing, and deleting work on any plan. Otherwise the request returns
403 INSUFFICIENT_PERMISSIONS. - Creating, updating, or turning on a password requires an Enterprise server owner. Turning a password off, listing, and deleting work on any plan.
- Ban imports require Premium, Business, or Enterprise and a bot with Discord
BAN_MEMBERSpermission. - Password labels must be unique per server.
- Bypass durations are limited to
15m,1h,6h,24h, or7d.
Firewall changes directly affect who can verify. Test restrictive rules with a known staff account before rolling them out broadly.