Rotate verification passwords with the RestoreCord API
A code that never changes slowly becomes public. Script the swap instead: create next month's password, deliver it, switch the old one off and read the numbers, all from a scheduled job.
Short answer
Create an API key with the SERVER_FIREWALL permission, POST a new password to /api/v3/servers/{serverId}/firewall/passwords, deliver it to members, then PATCH the old password with isActive set to false. Values can't be edited in place, so rotation always means a new code.
Paid communities, course groups and subscriber servers often hand out a fresh code every month or every drop. Doing that by hand works until someone forgets, and a password that has been in circulation for a year is no longer much of a password. RestoreCord exposes the same verification passwords you manage in the dashboard through its v3 API, and Enterprise includes free API access, so a small script can take over the routine.
Give the job its own key
Create an API key in the dashboard and grant it SERVER_FIREWALL and nothing else. That permission covers firewall rules, passwords, bypasses, logs and ban imports, which is everything rotation needs. Pick the shortest lifetime that suits the schedule and add an IP allowlist if the script runs on a fixed server. Keys travel in the Authorization header as Bearer <keyId>.<secret>.
Keep the key and the generated codes in server-side secrets only. Never paste either into a Discord channel, a browser bundle or a public repository; if one leaks, revoke the key and retire the code.
The endpoints you will use
| Method and path | What it does |
|---|---|
GET /firewall/passwords | Lists every password with its limits, active state and usage stats |
POST /firewall/passwords | Creates a password from a label, value and optional cap, expiry and role |
PATCH /firewall/passwords | Switches one password on or off by its ID |
PUT /firewall/passwords/{passwordId} | Edits the label, cap, expiry, role or active state |
DELETE /firewall/passwords/{passwordId} | Removes a password for good |
Every path sits under /api/v3/servers/{serverId}, where the server ID is RestoreCord's internal ID for the server rather than the Discord guild ID.
Step one: create the next code
Generate a long random value in your script, then create the password. Date the label so the dashboard and the logs tell the story on their own.
curl -X POST "https://restorecord.com/api/v3/servers/$SERVER_ID/firewall/passwords" \
-H "Authorization: Bearer $RC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"passwordLabel": "Buyers November",
"password": "<long random code from your script>",
"maxUses": 50,
"expiresAt": "2026-11-30T23:59:00Z",
"assignedRoleId": "112233445566778899"
}'maxUses, expiresAt and assignedRoleId are optional. A cap a little above your expected sign-ups and an expiry just after the next rotation give the code a natural end even if the script stops running.
Step two: deliver it where only members look
Send the new value through the channel you already trust: the order confirmation, the subscriber email or a private announcement. Give members a short overlap window where both codes work, so nobody who read last month's message hits a wall halfway through verifying.
Step three: retire the previous code
Once the overlap ends, switch the old password off. Members who verified with it keep their access; only new verifications are refused.
curl -X PATCH "https://restorecord.com/api/v3/servers/$SERVER_ID/firewall/passwords" \
-H "Authorization: Bearer $RC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "id": 41, "isActive": false }'The update endpoint can't change a password's value, which works in your favour: a new code with a new label keeps each one's usage history clean. If a require password rule pointed at the old code, update the rule too, because a rule needs an active password. See conditional password rules for how those are built.
Step four: read the usage
List the passwords and compare their counts. The new code should be climbing and the old one should stop moving once it is inactive.
{
"success": true,
"passwords": [
{
"id": 42,
"passwordLabel": "Buyers November",
"maxUses": 50,
"expiresAt": "2026-11-30T23:59:00.000Z",
"assignedRoleId": "112233445566778899",
"isActive": true,
"usageStats": { "passwordId": 42, "totalUses": 7 }
}
]
}When the request comes from the owner's account, each entry also carries the password value. For a sub-user with Manage Firewall, the values are left out while labels, limits and usage stay visible, which mirrors the dashboard.
One person locked out? Use a bypass
If a single member lost the code mid-rotation, you don't need to issue a new one. The firewall API can grant a temporary bypass for one Discord user ID, lasting 15m, 1h, 6h, 24h or 7d.
A rotation calendar that works
- Day 1: create the new code with a cap and an expiry a few days past the next rotation.
- Day 1: deliver it to current members and update any rule that should require it.
- Day 3: disable the previous code once the overlap window ends.
- Day 30: delete codes older than two rotations so the list stays short.
Doing it by hand for now? The dashboard setup guide covers the same fields, and the member explainer is worth linking in every rotation notice. Back to RestoreCord Passwords.
Automate a monthly code swap
Create a scoped API key
In the dashboard, make a key with only the SERVER_FIREWALL permission, a short lifetime and an IP allowlist if your job runs on fixed servers.
Create the new code
POST a fresh password with a dated label, a use cap and an expiry to the server's firewall passwords endpoint.
Hand it out, then retire the old one
Deliver the new code to your members, then PATCH the previous password to inactive so only the new one opens verification.
Read the usage
List the passwords and check each one's usage stats to confirm the new code is being used and the old one has gone quiet.
Password API questions
Fresh codes, zero reminders
Let a scheduled job create, deliver and retire your RestoreCord verification passwords while your team gets on with running the community.