Skip to main content
Creating, disabling and deleting keys takes a dashboard session token (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
string
Key name (e.g. “production”). Defaults to "default" when omitted.
Response
This is the only response that carries the full key. Copy it when you create it: no endpoint returns it again. 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.
boolean
required
true enables the key. Any other value, or a missing field, disables it.
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.
A key that is not yours, or does not exist, answers 400 with {"error": {"message": "Key not found", "reason": "not_found"}}.