OpenFolia

Make or rotate the backup key

POST
/backup-keys

Makes the backup key (an age X25519 key) and answers its identity once, in meta.identity: without it no backup can be restored, so keep it, away from the backups. With meta.rotate: true, replaces the current key: later backups are encrypted to the new one, earlier ones stay readable with the old one. The server keeps the identity sealed only while verifyByDecrypting is on. Recorded as backup-key.create or backup-key.rotate (fingerprints only). Needs admin.backups (403 forbidden otherwise).

Authorization

bearer
headerAuthorizationBearer <JWT>

A service account's token (ccms_sat_…, issued by POST /service-accounts/{id}/tokens), or, for local use and demo mode, the server's shared CCMS_API_TOKEN.

Header Parameters

X-Ccms-User?string

Demo mode only (CCMS_AUTH_MODE=demo): the user ID to act as. The bearer token is still required; without demo mode the header is refused (400).

Request Body

application/vnd.api+json
  1. body
meta?

Response Body

application/vnd.api+json
  1. response
data*
meta*
Example Request
curl -X POST 'http://localhost:3000/backup-keys' \  -H 'Content-Type: application/vnd.api+json' \  -d '{}'
Example Response
{  "data": {    "type": "BackupKey",    "id": "current",    "attributes": {      "fingerprint": "string",      "recipient": "string",      "createdAt": "2019-08-24T14:15:22Z"    }  },  "meta": {    "identity": "string",    "rotated": true,    "identityKept": true  }}