Rotate an expiring API key
Duplicate an expiring key’s available settings, restore omitted limits and expiry, validate the replacement, then revoke the old secret without downtime.
Last reviewed
Rotation requires an overlap: create and validate the replacement while the existing key still works, then revoke the old credential after every client has moved.

Before you rotate
Open Profile → API keys at /profile/api and expand the expiring key. The UI marks future dates as Expires date and highlights keys expiring within 30 days. Expired keys still count toward the free-plan cap of 3 and the absolute cap of 20.
Keys cannot be edited. Duplicate settings opens a replacement draft, but the expiry starts at Never expires and stored usage limits start blank because the list endpoint does not return them. S3 secret material is not copied.
Steps
- Inventory every client using the old key, including its protocol, workspace, folder reach, IP or active-hours guard, and any usage ceiling recorded outside Dosya.
- Select Duplicate settings, change the name to identify the rotation, then review Restrictions and expiry instead of assuming every field was cloned.
- Re-enter requests per minute, download per day, maximum file size, and concurrent-transfer limits; choose Expires in 30 days, Expires in 90 days, or Never expires deliberately.
- Press Generate key, copy the
dos_…secret from the one-time is ready dialog, and create new S3 credentials separately when the client uses that gateway. - Deploy the replacement to one client at a time and prove an actual allowed request plus its expected reach before removing the former secret.
- Expand the old row, choose Revoke, read the irreversible warning, confirm, and verify the retired credential is refused while the replacement continues.
Timing and recovery
Authentication checks expiry when loading a key, while the auth cache lives for 300 seconds. Treat the displayed deadline as the stop time and rotate early; do not depend on a warm cache extending access. Revocation irreversibly deletes the row and schedules deletion of REST and S3 cache entries. Stop the old client, allow up to five minutes for cached authentication, and verify refusal before treating the retired secret as unusable everywhere.
If a Free account has 3 keys, deleting an unused key or upgrading can create room. The absolute limit is 20 keys on every plan, so reaching 20 requires deleting a confirmed-unused credential; an upgrade cannot raise that ceiling. Do not revoke the active key merely to make room until a safe replacement path exists.
Expected result
The integration operates with the newly generated secret and restored restrictions. The old key is absent from active use and returns an authentication failure after irrevocable revocation.

Related guides
Was this helpful?
Loading helpfulness results…
Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.
Questions and replies
Ask about the steps in this guide. Questions are reviewed before publication.
Keep account details, credentials and private files out of public questions. Use private support for those.
Loading questions…
Sign in to your Dosya account to ask a question.