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#
{ "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"}| Field | Meaning |
|---|---|
| bearer_id | The app's UUID. |
| last_used_at | Last call made with the key. Updated at most every 5 minutes. |
| expires_at | When the key stops working, after a rotation. null means it works until revoked. |
| rotated_from_id | The key this one replaced. |
| token_preview | The first 6 and last 4 characters, to tell keys apart. |
List keys#
/v1/apps/:app_id/api_keysApp key + M2Mcurl 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#
/v1/apps/:app_id/api_keysApp key + M2Mcurl -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" } }'{ "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#
/v1/apps/:app_id/api_keys/:idApp key + M2Mcurl 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#
/v1/apps/:app_id/api_keys/:idApp key + M2MTakes api_keys.nickname, as create does. Returns 200 with { "api_key": ... }, or 404.
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#
/v1/apps/:app_id/api_keys/:id/rotateApp key + M2MCreates 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.
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" }'{ "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" }}| Status | Error | When |
|---|---|---|
| 404 | The app has no key with that id. | |
| 422 | invalid_rotation | old_key_expires_in is not one of the values, or the key has already stopped working. |
Revoke a key#
/v1/apps/:app_id/api_keys/:idApp key + M2MDeletes the key. Calls made with it fail with 401 from then on. Returns 200 with the deleted { "api_key": ... }, or 404.
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"