API reference

App keys

List, create, rename, rotate and revoke an app's API keys.

An app key (scapp_...) is the server credential for one app, sent as Authorization: Bearer. Scute stores a hash of each key. The full key is returned once, when it is created or rotated.

These routes take an app key in Authorization and an M2M token of the app in X-Authorization. Creating, renaming, rotating and revoking keys with an M2M token needs its write scope. See Authentication.

The key object#

App keyjson
{  "id": 4821,  "nickname": "Production server",  "bearer_id": "0193f8aa-5555-7666-8777-888888888888",  "created_at": "2026-10-01T12:00:00.000Z",  "last_used_at": "2026-11-19T09:55:00.000Z",  "expires_at": null,  "rotated_from_id": null,  "token_preview": "scapp_••••••a91F"}
FieldMeaning
bearer_idThe app's UUID.
last_used_atLast call made with the key. Updated at most every 5 minutes.
expires_atWhen the key stops working, after a rotation. null means it works until revoked.
rotated_from_idThe key this one replaced.
token_previewThe first 6 and last 4 characters, to tell keys apart.

List keys#

GET/v1/apps/:app_id/api_keysApp key + M2M
cURLbash
curl https://api.scute.io/v1/apps/$SCUTE_APP_ID/api_keys \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"

Returns 200 with { "api_keys": [ ... ] }.

Create a key#

POST/v1/apps/:app_id/api_keysApp key + M2M
api_keys.nicknamestring
A name for the key. The body needs the api_keys object even when the name is empty.
cURLbash
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/api_keys \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "api_keys": { "nickname": "Production server" } }'
Response 200json
{  "api_key": {    "id": 4822,    "nickname": "Production server",    "bearer_id": "0193f8aa-5555-7666-8777-888888888888",    "created_at": "2026-11-19T10:00:00.000Z",    "last_used_at": null,    "expires_at": null,    "rotated_from_id": null,    "token_digest": "scapp_xxxxxxxxxxxxxxxxxxxxx"  }}

token_digest is the full key. Store it now: it is not returned again.

Get a key#

GET/v1/apps/:app_id/api_keys/:idApp key + M2M
cURLbash
curl https://api.scute.io/v1/apps/$SCUTE_APP_ID/api_keys/4822 \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"

Returns 200 with { "api_key": ... }, or 404 when the app has no key with that id.

Rename a key#

PATCH/v1/apps/:app_id/api_keys/:idApp key + M2M

Takes api_keys.nickname, as create does. Returns 200 with { "api_key": ... }, or 404.

cURLbash
curl -X PATCH https://api.scute.io/v1/apps/$SCUTE_APP_ID/api_keys/4822 \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "api_keys": { "nickname": "Billing worker" } }'

Rotate a key#

POST/v1/apps/:app_id/api_keys/:id/rotateApp key + M2M

Creates a new key with the same name and returns it once. The old key keeps working until it is revoked, or until old_key_expires_in from now, so you can move your servers over first.

old_key_expires_instring
When the old key stops working: now, 1h, 24h, 7d or 30d. Left out, the old key works until revoked.
cURLbash
curl -X POST https://api.scute.io/v1/apps/$SCUTE_APP_ID/api_keys/4822/rotate \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN" \  -H "Content-Type: application/json" \  -d '{ "old_key_expires_in": "24h" }'
Response 200json
{  "api_key": { "id": 4823, "nickname": "Production server", "rotated_from_id": 4822, "token_digest": "scapp_yyyyyyyyyyyyyyyyyyyyy" },  "old_api_key": { "id": 4822, "nickname": "Production server", "expires_at": "2026-11-20T10:00:00.000Z" }}
StatusErrorWhen
404The app has no key with that id.
422invalid_rotationold_key_expires_in is not one of the values, or the key has already stopped working.

Revoke a key#

DELETE/v1/apps/:app_id/api_keys/:idApp key + M2M

Deletes the key. Calls made with it fail with 401 from then on. Returns 200 with the deleted { "api_key": ... }, or 404.

cURLbash
curl -X DELETE https://api.scute.io/v1/apps/$SCUTE_APP_ID/api_keys/4822 \  -H "Authorization: Bearer $SCUTE_APP_SECRET" \  -H "X-Authorization: Bearer $SCUTE_M2M_TOKEN"