Rotating API keys periodically reduces the risk of compromised credentials and is a security best practice. Rotate a key when your security policy requires periodic rotation, or when a key may have been exposed. The API Console lets you rotate a key in place: the new key replaces the old one without having to recreate it from scratch.
How it works
When you rotate a key, the API Console immediately generates a new key value and lets you choose when to revoke the old one. You can revoke the old key immediately or schedule it for a later date. The latter gives you an overlap period to update your integration without downtime. Note that a scheduled revocation doesn't delay the rotation. The rotation itself happens immediately.
Until the scheduled revocation, the old key entry stays active. It also shows which key it was rotated to.
While the old key is pending revocation, it cannot be re-rotated, renamed, or replicated to Sandbox, but you can still duplicate it within the same environment or revoke it right away.
Before you begin
Before you start, make sure you have:
- Access to the API Console.
- An API key you created in the API Console that you want to replace.
- The Manage API permission on your Revolut account.
Rotate an API key
1. Open the key details
In the API Console, navigate to API keys and click the API key you want to rotate. The key details panel opens.
2. Start the rotation
- Click the menu in the key details panel.
- Select Rotate. A pop-up appears with rotation options.
3. Configure the rotation
In the pop-up:
-
Choose when to revoke the old key:
- Now: the old key stops working as soon as the new key is created.
- In 24 hours / In 3 days / In 7 days / In 14 days: the old key stops working when the window you picked passes.
- On date: the old key stops working on the date you pick. A date input field appears where you can type the revocation date (DD/MM/YYYY) or select it from the calendar.
-
Click Continue.
-
Optionally, set an expiry date for the new key. The key is valid until the end of that day (23:59) in your device's timezone.
-
Click Rotate key to generate the new key.
SCA confirmationYou may be asked to complete a Strong Customer Authentication (SCA) challenge, also known as step-up authentication challenge, to confirm the rotation. This may include a push notification, e-mail confirmation, and/or a selfie.
4. Update your integration
The new key value is shown in a Copy API key pop-up.
- If the key has a signing key attached, the new key value can be viewed later in the API Console.
- Otherwise, the new key value is shown only once, in this pop-up. Copy and store it securely — you won't be able to see it again.
After you confirm, the key details panel opens with the details of the new key that replaced the rotated key. Update your integration to use the new value:
- If you store the API key in an environment variable or secrets manager, update the value there.
- If your key has signing enabled, the same public signing key carries over to the new key – no changes needed on the signing side. Your existing private key continues to work for signature generation.
- Deploy the updated configuration to all environments that use the key.
If you chose to revoke the old key at a later date, use the overlap period to update your integration safely. Make a test request with the new key, monitor your integration for a reasonable period (e.g., 24 hours), and confirm that all requests are succeeding before the old key is revoked.
If you're rotating because the key may have been compromised, revoke the old key immediately instead of using an overlap period.
Best practices
| Practice | How | Why |
|---|---|---|
| Rotate keys regularly (e.g., every 90 days) | Use the API Console to generate a replacement key and retire the old one on a fixed schedule. | Limits the window of exposure if a key is compromised. |
| Use the overlap option | Keep the old key active during rotation until you've verified the new key works in your integration. | Prevents downtime: the old key keeps working until the new one is verified. |
| Set expiry dates | Configure the key to automatically expire on a specific date, aligned with your organisation's security policy. | Ensures regular credential lifecycle management: see Manage API key settings. |
| Use IP allowlisting | Configure the key to only accept requests from your production servers' IP addresses. | Restricts where keys can be used: see Manage API key settings. |
| Audit key usage | Review the API Console periodically to archive or delete inactive keys across both Sandbox and Production environments. | Prevents stale or unused keys from accumulating. |
What's next
- Manage API key settings: Update key permissions, configure IP allowlisting, and manage signing keys.
- Set up Postman: Automate request signing with a pre-request script.
- Create an API key: Create a new API key from scratch.