Regularly updating your API keys is a security best practice. This section covers when and how to rotate keys safely.
When to Update API Keys #
Security best practice:
- Rotate keys quarterly as a preventive measure.
After any security concern:
- Suspected key leak or compromise
- Unusual API activity detected
- Computer or device potentially compromised
Permission changes:
- When modifying API permissions on the broker side.
Account changes:
- After password resets or security updates on your exchange account.
Update Process #
Follow these steps to rotate your API keys without interrupting your trading:
Step 1: Generate New Keys on Broker Platform
- Log into your exchange account.
- Navigate to API Management.
- Create a new API key with the same permissions as the old key.
- Keep the old key active during transition to avoid downtime.
Step 2: Update in Flows.Trading
- Navigate to Settings → Brokers.
- Select the broker you want to update.
- Replace old credentials with new ones (paste new API Key and Secret).
- Click Update or Save.
Step 3: Test Connection
- Verify the connection is successful.
- Check account balance displays correctly.
- Place a small test order to confirm functionality.
Step 4: Deactivate Old Keys
- Once new keys are confirmed working, log back into your exchange.
- Navigate to API Management.
- Delete or disable the old API key.
- Verify the connection in Flows.Trading remains stable.
Rotation Best Practices #
Off-Hours Updates:
- Perform key rotations during low trading activity (e.g., weekends, late nights).
- Avoid rotating keys during volatile market conditions or when you have open positions.
Test Thoroughly:
- Always verify all functionality before market hours.
- Check order placement, modification, and cancellation.
Document Changes:
- Keep a record of key rotation dates for future reference.
- Note which keys are active and when they were last updated.
Monitor Performance:
- Watch for any connection issues post-update.
- Check API logs on your exchange for successful connections.
■ Try it now: If you’ve had your API key connected for a while, practice rotating it following the steps above. This ensures you’re familiar with the process before it becomes urgent.