Skip to main content

Mint a new API key

POST/keys

Mints a new API key for the manager you are signed in as. The response carries the key itself in api_key. It is shown once: store it now. It cannot be retrieved later, and it is never shown by GET /keys.

You may hold at most 10 active keys; revoke one before minting an 11th. You may also make at most 20 self-service mints in any 24 hours, revoked ones included (429 key_mint_limit); keys Treasures issues for you do not count. If you hit it, wait, or ask Treasures to issue one.

Minting requires a recent sign-in: if you last signed in to the dashboard more than 15 minutes ago, the request is refused 403 reauth_required; sign out and in again, then retry. Only signing in counts. Linking a new login method (an email, a social account or a wallet) to a signed-in session does not, and neither does a login method first linked in the last 15 minutes, so sign in with one you have held longer.

Treasures confirms the sign-in with its identity provider on every mint; if that check cannot complete, the mint is refused 503 sign_in_check_unavailable and nothing is created; retry shortly.

If the response is lost (a timeout, or a retried request), the key exists but its value cannot be recovered, and it counts toward your 10. List your keys and revoke the one you never received. There is no idempotent replay, because replaying would require storing the key's value.

Only a dashboard session may call this; an API key is refused 403 session_required, so a key can never mint its own replacement. No query parameters are accepted.

Request​

Responses​

Minted. api_key is shown once; store it now. It cannot be retrieved later. Sent with Cache-Control: private, no-store.