GET /accounts/me/keys, POST /accounts/me/keys/rotate and POST /accounts/me/keys/{apiKeyId}/revoke.
Rotation replaces the API key ID and the secret key. It doesn’t change the passphrase, and there is no endpoint that does.
Key statuses
expired and revoked are final: neither can be restored. The gateway rejects a request signed with either one with 403 Forbidden, like any other invalid credential.
Rotate without downtime
1
Save the rotation before you send it
Generate an
Idempotency-Key, for example a UUID, and save it with the request body, such as {"gracePeriodSeconds":86400,"mode":"graceful","reason":"scheduled rotation"}. Choose a grace period longer than your deploy: from 60 seconds to 7 days, 24 hours by default.2
Rotate
Call
POST /accounts/me/keys/rotate, signed with the key you rotate. If the call times out or returns a 5xx, send it again with the same Idempotency-Key, the same body and the same key: you get the same new key back, for 15 minutes. Never start a second rotation to recover from an unknown outcome.3
Store the new key
Write
apiKeyId and secretKey to your secrets manager before anything else. The secret key isn’t returned again after secretRecoverableUntil, and the list endpoint never returns it.4
Confirm that the new key signs
Call
GET /accounts/me/keys with the new API key ID, the new secret key and your passphrase. The new key is active and the old one is rotating.5
Deploy the new key
Deploy the new key to every service that signs requests.
6
Revoke the old key
Call
POST /accounts/me/keys/{apiKeyId}/revoke with the old API key ID, signed with the new key. Don’t wait for the grace period to end: a revoked key stops working at once.If a credential is exposed
If a secret key may have been exposed, act as if an attacker holds it and your passphrase.1
Stop open orders first
If the exposed key has open limit orders or DCA strategies, whoever holds it can change them, including their prices and amounts. Set each maker wallet’s allowance to the Olympex order contract to
0 for every token the orders sell: that takes effect on-chain at once. Then cancel the orders you don’t want to keep.2
Rotate in compromised mode
Call
POST /accounts/me/keys/rotate with {"mode":"compromised"}, signed with the exposed key. The old key is revoked in the same call, so store the new key from the response before anything else: if you lose the response, you can’t retry the call with the revoked key. In that case, email partners@olympex.io with the API key IDs, never a secret key or the passphrase.3
Revoke any other key that still signs
List your keys with the new key, and revoke every other key that is still
rotating.4
Deploy the new key
Replace the API key ID and the secret key in your secrets manager, and redeploy every service that signs requests.
5
Clean up the leak
Remove the exposed values from wherever they leaked: logs, tickets, chats or repository history.
Build a key-management screen
If your own operators manage keys from a web interface, your backend does the work and the browser never holds a credential.- Your backend signs. The browser calls your backend, and your backend signs and calls Olympex. Never send a secret key or the passphrase to the browser, and never keep them in browser storage, analytics, error reports or client logs.
- Store before you confirm. Write a new secret key to your secrets manager from the backend before the screen reports success. If the screen must show it, show it once, and never render it again from application state.
- Show every status. Render
active,rotating,expiredandrevoked, and showexpiresAtandrevokedAtin UTC. Offer revocation forrotatingandexpiredkeys, not for theactiveone. - One Idempotency-Key per rotation. Create it when the operator confirms the rotation, store it with the body on the backend, and reuse it for every retry of that rotation.
- Hide what isn’t available. If the key endpoints return
404 NOT_FOUND, mark key management as unavailable: it doesn’t mean the account is missing.
401 and 403 mean a credential problem on your server, so show no details to the operator; 409 means a conflicting rotation, so refresh the key list; 429 means the account reached its key management limits (5 rotation and 10 revocation requests per hour, retries included), so disable the action and retry with the same Idempotency-Key up to an hour later; 503 SERVICE_UNAVAILABLE means retry after a few seconds; for any other 5xx, keep meta.requestId for support. Errors and retries covers every code.
What this means for your integration
- Rotate on a schedule with
gracefulmode, and revoke the old key as soon as the new one is deployed. - Save the
Idempotency-Keyand the body before you rotate, and retry only with those same values. - Store a new secret key before you do anything else: after 15 minutes, nothing returns it again.
Related
Rotate an API key
The rotation endpoint, its modes and retries, with code.
Credentials
The API key ID, secret key and passphrase, and how to store them.
Order signatures and allowances
The allowance that limits what any order can spend.
Security model
What Olympex protects, and what you are responsible for.
