API reference

The API key object

An app key or workspace key, as the API key endpoints return it.

An API key is a server credential sent in Authorization: Bearer. App keys start with scapp_ and belong to one app. Workspace keys start with scworks_ and belong to a workspace. See Authentication.

Returned by the app key endpoints under /v1/apps/:app_id/api_keys and the workspace key endpoints under /v1/workspaces/:workspace_id/api_keys. See App keys.

FieldTypeDescription
idintegerId of the key.
nicknamestringName given to the key.
bearer_idstringUUID of the app or workspace the key belongs to.
token_previewstringFirst 6 and last 4 characters of the key, with the middle masked.
token_digeststringThe full key. Only in the create and rotate responses.
last_used_atstringLast use, updated at most every 5 minutes. null when never used.
expires_atstringWhen the key stops working, or null for no end.
rotated_from_idintegerId of the key this one replaced in a rotation, or null.
created_atstringISO 8601 time.
Create responsejson
{  "api_key": {    "id": 4821,    "nickname": "Production server",    "bearer_id": "0193f8aa-5555-7666-8777-888888888888",    "token_digest": "scapp_xxxxxxxxxxxxxxxxxxxxx",    "token_preview": "scapp_••••••xxxx",    "last_used_at": null,    "expires_at": null,    "rotated_from_id": null,    "created_at": "2026-11-18T10:00:00.000Z"  }}

The full key is in token_digest once, in the create or rotate response. Lists and reads return token_preview only. A lost key cannot be read again: rotate it or create a new one.

Rotation#

A rotate call creates a new key with the same bearer and nickname and returns it in api_key, with the old key in old_api_key. The old key keeps working until it is deleted, or until the end set by old_key_expires_in: now, 1h, 24h, 7d or 30d. A key past its expires_at is refused with 401.