API Reference

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/logs

Prop

Type

Rules

List rules

Returns rules, statistics, and password details.

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

Prop

Type

Create rule

Creates a firewall rule.

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

Prop

Type

Toggle rule

Enables or disables a rule.

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

Prop

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/passwords

Prop

Type

Create password

Creates a password used by password firewall rules.

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

Prop

Type

Toggle password

Enables or disables a firewall password.

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

Prop

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}/bypass

Prop

Type

Create bypass

Creates a temporary firewall bypass for a Discord user.

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

Prop

Type

Remove bypass

Removes an active bypass for a user.

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

Prop

Type

Import Bans

Preview Discord bans

Lists Discord bans not already represented as firewall rules.

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

Prop

Type

Import Discord bans

Creates BLOCK rules from Discord server bans.

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

Prop

Type

Rule Types

Condition fieldOperators and accepted value
ROLECONTAINS / NOT_CONTAINS; current-server Discord role ID.
GUILDCONTAINS / NOT_CONTAINS; Discord server ID. Requires Business plan or higher.
USERNAMEAll operators; literal text or slash-delimited RE2 pattern.
DOMAINAll operators; email domain literal or slash-delimited RE2 pattern.
USERIS / IS_NOT; Discord user ID.
IPIS / IS_NOT; IPv4 address.
IP_RANGEIS / IS_NOT; IPv4 CIDR range (IS means within).
COUNTRY / CONTINENTIS / IS_NOT; one or more supported codes.
ASNIS / 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, 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.
  • 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_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.

On this page