ks-…)
in Authorization: Bearer. An API key gets 403 with
session_required, so a leaked key
cannot mint new keys or switch off yours. Listing keys takes either credential.
Create key
POST https://kymaapi.com/v1/auth/keys
Response
id is how the list, toggle and delete refer
to the key.
List keys
GET https://kymaapi.com/v1/auth/keys
Newest key first (created_at descending). Each key carries its lifetime spend.
The full key is never returned here, to any caller: a key is identified by id
(its SHA-256, 64 hex characters) and displayed as prefix and last4.
Response
Disable or enable a key
PATCH https://kymaapi.com/v1/auth/keys/{id}/toggle
{id} is the id from the list.
A disabled key stops authenticating at once.
Response
Delete key
DELETE https://kymaapi.com/v1/auth/keys/{id}
Any key can be deleted, including the one marked is_default. Deleting the
default promotes your newest enabled key in its place; if no enabled key is
left, a new default key is created for you. The response gives the id of the
key that is default afterwards.
Response
An account always has a default key.
new_default_created is true when
the delete left none and one was issued for you.400 with
{"error": {"message": "Key not found", "reason": "not_found"}}.