Skip to content

API Keys

Generate a new API key for the authenticated account.

POST /v1/keys

Authentication: Required.

FieldTypeRequiredDescription
namestringNoKey name (defaults to "default")
Terminal window
skytale keys create --name production
Terminal window
curl -X POST https://api.skytale.sh/v1/keys \
-H "Authorization: Bearer sk_live_a1b2c3d4..." \
-H "Content-Type: application/json" \
-d '{"name": "production"}'
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"key_prefix": "sk_live_a1b2",
"name": "production",
"key": "sk_live_a1b2c3d4e5f6g7h8i9j0..."
}

List all active (non-revoked) API keys for the authenticated account.

GET /v1/keys

Authentication: Required.

Terminal window
skytale keys list
Terminal window
curl https://api.skytale.sh/v1/keys \
-H "Authorization: Bearer sk_live_a1b2c3d4..."
{
"keys": [
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"key_prefix": "sk_live_a1b2",
"name": "production",
"last_used_at": "2026-02-26T12:00:00Z",
"created_at": "2026-02-20T10:30:00Z"
},
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"key_prefix": "sk_live_x9y8",
"name": "default",
"last_used_at": null,
"created_at": "2026-02-20T10:00:00Z"
}
]
}

Keys are ordered by created_at descending (newest first). The last_used_at field is null if the key has never been used.


Revoke an API key. The key immediately stops working. This is a soft delete — the key record is retained with a revoked_at timestamp.

DELETE /v1/keys/{id}

Authentication: Required. You can only revoke keys belonging to your account.

Terminal window
skytale keys revoke 7c9e6679-7425-40de-944b-e07fc1f90ae7
Terminal window
curl -X DELETE https://api.skytale.sh/v1/keys/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
-H "Authorization: Bearer sk_live_a1b2c3d4..."

No content.

StatusErrorCause
404Not foundKey does not exist, belongs to another account, or is already revoked