Docs
Sign in

Replace an API key.

Session only.

POST/api/v1/api-keys/{id}/rotate

Keysession only

Makes a new key with the old one's name, scopes and limits, and revokes the old one, at once or after graceMinutes. The answer carries the new token once. Who may: as for revokeApiKey; a service key (as the old key or the new one) is the owner's alone. Works on a key revoked for rotation (rotationRequired). Use the koidog_session cookie at https://app.koi.dog/api/v1 with Origin: https://app.koi.dog.

Path parameters.

idstringrequired

The API key's id.

Headers.

Idempotency-Keystring

Retry the same request with the same key. Retry rules.

Body.

kindenum

The new key's kind. Default: service for a service key, person for any other (an unproven key becomes the rotating person's).

expiresAtstring

When the new key ends. Default: the old key's end when that is still ahead, else none. Matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$.

graceMinutes0–1440

Minutes the old key keeps working (0 to 1440), to switch its users over; 0 (the default) revokes it at once. Default 0.

Response.

201 Created · JSON object

422 validation_failed
Each schema error appears in details.