Sensorclouds
API Access

Rotating an API Key

Replace a key's secret without downtime using a grace window

ADMIN

Rotation replaces a key's secret while keeping its name, scopes, and history. During a grace window, both the old and new secrets work, so you can update your systems with no downtime.

When to rotate

  • A secret may have been exposed (pasted in chat, committed to a repository, a laptop lost)
  • Someone who knew the secret has left
  • On a regular schedule, as good hygiene

Before you begin

  • You need the Admin role.
  • Know every system that uses the key, so you can update them during the grace window.
  • Revoked and expired keys can't be rotated. Create a new key instead.

Steps

On the API Keys page, click Rotate on the key's row. The Rotate API Key dialog opens.

Choose a Grace window, which is how long the old secret keeps working:

Grace windowUse when
Immediate cutoverThe secret was exposed. The old secret stops working at once
1 hourOne system to update, and you're ready now
24 hoursUsually right. Time to update a few systems
7 daysMany systems, or ones owned by other teams

Confirm. You'll see "Key rotated", and the new secret is shown once. Copy it now.

Update every system that uses the key.

When the grace window ends, the old secret stops working automatically.

While the grace window is open, the key's Status shows Rotating. Hover over it to see when the old secret stops working ("Old secret valid until …").

Rotating again during an active grace window ends the previous secret's grace immediately. You'll be warned first.

If a secret was exposed, choose Immediate cutover, or revoke the key and create a new one.

Troubleshooting

Message or symptomCauseFix
Cannot rotate a revoked keyThe key was revokedCreate a new key
Cannot rotate an expired keyThe key has expiredCreate a new key
A system starts getting 401 after a few hours or daysIt still uses the old secret, and the grace window has endedUpdate it with the new secret
Rotate failedThe rotation didn't completeTry again. The old secret keeps working until a rotation succeeds

Next Steps

On this page