Firewall

Manage RestoreCord firewall logs, rules, passwords, bypasses, and Discord ban imports.

Copy page

All firewall endpoints require SERVER_FIREWALL when authenticated with an API key.

Logs

GET/api/v3/servers/{serverId}/firewall/logs

List firewall logs

Returns paginated firewall log entries.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
pageOptional
Location
query
Type
integer
Default
1
Page number.
limitOptional
Location
query
Type
integer
Default
10
Page size, capped at 100.
userIdOptional
Location
query
Type
string
Optional Discord user ID filter.
actionOptional
Location
query
Type
string
Optional firewall action filter.
DELETE/api/v3/servers/{serverId}/firewall/logs

Clear firewall logs

Deletes firewall log history for a server.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.

Rules

GET/api/v3/servers/{serverId}/firewall/rules

List rules

Returns rules, statistics, and available firewall passwords.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
POST/api/v3/servers/{serverId}/firewall/rules

Create rule

Creates a firewall rule.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
targetTypeRequired
Location
body
Type
string
Condition field such as `ROLE`, `GUILD`, `USERNAME`, `DOMAIN`, `USER`, `IP`, `IP_RANGE`, `COUNTRY`, `CONTINENT`, or `ASN`.
operatorOptional
Location
body
Type
string
`IS`, `IS_NOT`, `CONTAINS`, or `NOT_CONTAINS` as supported by the selected field. Defaults to `IS`.
targetValueRequired
Location
body
Type
string
Target value matching the selected type.
actionsRequired
Location
body
Type
array
Exactly one decision (`ALLOW`, `BLOCK`, `REQUIRE_PASSWORD`, or `BYPASS_ALL`) and up to five distinct `GIVE_ROLE` effects.
ruleTypeOptional
Location
body
Type
string
Legacy decision field, accepted when `actions` is omitted.
passwordIdOptional
Location
body
Type
string
Legacy password field for `REQUIRE_PASSWORD`.
assignedRoleIdOptional
Location
body
Type
string
Legacy single-role effect field.
PATCH/api/v3/servers/{serverId}/firewall/rules

Toggle rule

Enables or disables a rule.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
idRequired
Location
body
Type
number
Firewall rule ID.
isActiveRequired
Location
body
Type
boolean
New active state.
GET/api/v3/servers/{serverId}/firewall/rules/{ruleId}

Get rule

Reads one firewall rule.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
ruleIdRequired
Location
path
Type
string
Firewall rule ID.
PUT/api/v3/servers/{serverId}/firewall/rules/{ruleId}

Update rule

Updates a firewall rule.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
ruleIdRequired
Location
path
Type
string
Firewall rule ID.
DELETE/api/v3/servers/{serverId}/firewall/rules/{ruleId}

Delete rule

Deletes a firewall rule.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
ruleIdRequired
Location
path
Type
string
Firewall rule ID.

Passwords

GET/api/v3/servers/{serverId}/firewall/passwords

List passwords

Returns firewall password metadata and owner-visible password values.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
POST/api/v3/servers/{serverId}/firewall/passwords

Create password

Creates a password used by password firewall rules.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
passwordRequired
Location
body
Type
string
Password value.
passwordLabelRequired
Location
body
Type
string
Unique label, up to 100 characters.
maxUsesOptional
Location
body
Type
number
Optional maximum uses.
expiresAtOptional
Location
body
Type
string
Optional ISO date-time expiration.
PATCH/api/v3/servers/{serverId}/firewall/passwords

Toggle password

Enables or disables a firewall password.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
idRequired
Location
body
Type
number
Password ID.
isActiveRequired
Location
body
Type
boolean
New active state.
GET/api/v3/servers/{serverId}/firewall/passwords/{passwordId}

Get password

Reads one firewall password.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
passwordIdRequired
Location
path
Type
string
Password ID.
PUT/api/v3/servers/{serverId}/firewall/passwords/{passwordId}

Update password

Updates password metadata.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
passwordIdRequired
Location
path
Type
string
Password ID.
DELETE/api/v3/servers/{serverId}/firewall/passwords/{passwordId}

Delete password

Deletes a firewall password.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
passwordIdRequired
Location
path
Type
string
Password ID.

Bypasses

GET/api/v3/servers/{serverId}/bypass

List bypasses

Returns active bypasses or one user's bypass.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
userIdOptional
Location
query
Type
string
Optional Discord user ID.
POST/api/v3/servers/{serverId}/bypass

Create bypass

Creates a temporary firewall bypass for a Discord user.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
userIdRequired
Location
body
Type
string
Discord user ID.
durationOptional
Location
body
Type
string
Default
24h
One of `15m`, `1h`, `6h`, `24h`, `7d`.
DELETE/api/v3/servers/{serverId}/bypass

Remove bypass

Removes an active bypass for a user.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
userIdRequired
Location
query
Type
string
Discord user ID.

Import Bans

GET/api/v3/servers/{serverId}/firewall/import-bans

Preview Discord bans

Lists Discord bans not already represented as firewall rules.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.
POST/api/v3/servers/{serverId}/firewall/import-bans

Import Discord bans

Creates BLOCK rules from Discord server bans.

serverIdRequired
Location
path
Type
string
Internal RestoreCord server ID.

Rule Types

Condition field
ROLE
Operators and accepted value
CONTAINS / NOT_CONTAINS; current-server Discord role ID.
Condition field
GUILD
Operators and accepted value
CONTAINS / NOT_CONTAINS; Discord server ID. Requires Business plan or higher.
Condition field
USERNAME
Operators and accepted value
All operators; literal text or slash-delimited RE2 pattern.
Condition field
DOMAIN
Operators and accepted value
All operators; email domain literal or slash-delimited RE2 pattern.
Condition field
USER
Operators and accepted value
IS / IS_NOT; Discord user ID or a supported legacy detection value.
Condition field
IP
Operators and accepted value
IS / IS_NOT; IPv4 address or a supported legacy detection value.
Condition field
IP_RANGE
Operators and accepted value
IS / IS_NOT; IPv4 CIDR range (IS means within).
Condition field
COUNTRY / CONTINENT
Operators and accepted value
IS / IS_NOT; one or more supported codes.
Condition field
ASN
Operators and accepted value
IS / IS_NOT; numeric ASN, with or without AS prefix.
Example request JSON
{
  "targetType": "USERNAME",
  "operator": "CONTAINS",
  "targetValue": "/^staff[-_].+/i",
  "actions": [
    { "type": "ALLOW" },
    { "type": "GIVE_ROLE", "roleId": "123456789012345678" }
  ],
  "name": "Staff access"
}

Constraints

  • TIME target rules are rejected because time-based rules are not implemented.
  • Regex patterns are limited to 200 characters, use RE2 syntax, and accept only i, m, and s flags.
  • REQUIRE_PASSWORD actions require an active firewall password.
  • BLOCK cannot be combined with GIVE_ROLE; other decisions accept up to five distinct role effects.
  • Responses include both canonical actions and legacy ruleType, passwordId, and assignedRoleId fields.
  • Ban imports require Premium, Business, or Enterprise and a bot with Discord BAN_MEMBERS permission.
  • Password labels must be unique per server.
  • Bypass durations are limited to 15m, 1h, 6h, 24h, or 7d.

Firewall changes directly affect who can verify. Test restrictive rules with a known staff account before rolling them out broadly.