Key Revocation & Rotation
Revocation takes effect in under 5 minutes
If your API key leaks (committed to Git, exposed in logs, stolen in a breach), you can revoke it instantly from the dashboard.
Timeline:
Why not instant? We cache API keys in Redis (5min TTL) for performance. Without caching, every request would hit the database (20-50ms), making the API slower.
Tradeoff: 99.9% of requests are cached (fast), but revocation takes up to 5 minutes to propagate fully.
How to revoke a key
- Go to /dashboard/api-keys
- Find the key you want to revoke
- Click the 🗑️ icon or "Revoke" button
- Confirm (no undo!)
- Key is immediately marked as revoked in database
DELETE /api/v1/keys/:keyId
Headers:
X-API-Key: YOUR_MASTER_KEY
X-API-Secret: YOUR_MASTER_SECRET
X-Signature: ...
X-Timestamp: ...
Response:
{
"success": true,
"message": "API key revoked",
"keyId": "key_abc123",
"revokedAt": "2024-01-08T10:30:00Z",
"cacheExpiry": "~5 minutes"
}What happens after revocation
- New requests with this key start failing (cache miss → DB lookup → revoked)
- Dashboard shows key as "Revoked" with red indicator
- All requests with this key fail (100% blocked)
- Error:
401: API key revoked
- Key cannot be un-revoked (create a new one)
- Key stays in database for audit trail
- Old request logs still reference this key ID
Key rotation (recommended every 90 days)
Why rotate? Even if your key hasn't leaked, rotating regularly limits damage if it does leak later.
Rotation process (zero downtime):
Copy new key and secret (shown only once!)
OBITOX_API_KEY=ox_new...OBITOX_API_SECRET=sk_new...Restart/redeploy your application
Confirm no errors
Catches any services still using old key
Check logs for requests with old key
Old key stops working within 5 minutes
If anything breaks, you know what service still needs updating
Automatic rotation reminders
We'll email you:
- 7 days before 90-day mark: "Consider rotating your API keys soon"
- At 90 days: "Your API keys are 90 days old (security best practice: rotate)"
- At 180 days: "Your API keys are 6 months old (strongly recommend rotating)"
We don't force rotation (your keys will keep working), but we'll nag you because it's good security hygiene.
Emergency revocation (compromised key)
Scenario: You discover your API key was committed to a public GitHub repo 2 weeks ago.
Dashboard → API Keys → Revoke
Takes effect in 5 minutes
Update environment variables
Deploy to production ASAP
Look for suspicious IPs, unusual usage patterns
Email support@obitox.com if you see abuse
git filter-branch or BFG Repo-CleanerForce push to rewrite history
Even though key is revoked, clean up the leak
What we do on our side
When you revoke a key:
- Mark key as revoked in database (immediate)
- Delete from Redis cache (500ms)
- Set TTL to 0 on Workers cache (forces refresh)
- Log revocation event (audit trail)
- Email you confirmation ("Key ox_196a... revoked")
We do NOT:
- Delete the key from database (kept for audit trail)
- Notify you of every failed request (would be spam)
- Automatically create a new key (you control this)
Best practices (actually follow these)
Takes 10 minutes, prevents months of potential exposure if leaked.
ox_test_...Staging:
ox_staging_...Production:
ox_live_...If dev key leaks, prod is safe.
const API_KEY = "ox_196aed8..."; // NEVER DO THIS✅
const API_KEY = process.env.OBITOX_API_KEY;.env file committed to Git.Check
.gitignore includes .env*For now: Create separate keys for different services, revoke individually if needed.
Unexpected spikes? Revoke and investigate.
FAQ
Why: Simpler logic, prevents accidents (can't un-revoke compromised key by mistake).
Pro: 20 active keys
Enterprise: Unlimited
Revoked keys don't count toward limit.
1. Revoke the old key
2. Create a new key
3. Save the secret this time (use a password manager)
Name is for your reference only (not used in API calls).
Dashboard shows "(Revoked)" badge next to key name in logs.