Create an API key
Mints `hart_<id>_<secret>` for the caller. The response carries the key in `token` once; only the SHA-256 of the secret is stored. Use it as `Authorization: Bearer …` or `Harthelm-Authorization: Bearer …` on the API and as `Harthelm-Authorization: Bearer …` on private dev hosts and restricted custom domains. Browser sessions only (403 with an API key), so a leaked key cannot mint a successor that outlives its deletion.
openapi/harthelm.yaml at v1.5.0__Host-harthelm_session<token>Browser session of the UI (12 h idle, 7 days absolute). State-changing requests also need the header
Harthelm-CSRF: 1 and a matching Origin.
Idempotency-Key?stringClient-chosen key (at most 255 characters); a repeated key returns the first result for 24 h.
1 <= length <= 255application/json- body
name*ApiKeyName1 to 100 characters without leading or trailing spaces; need not be unique.
^\S(.*\S)?$1 <= length <= 100expires_at?stringOptional; must be in the future and at most a year away.
date-timeThe key, with its token.
application/json- response
A personal API key without its secret.
id*stringuuidname*ApiKeyName1 to 100 characters without leading or trailing spaces; need not be unique.
^\S(.*\S)?$1 <= length <= 100source*stringcli: minted by hart login.
"console""cli"prefix*stringThe token up to its secret (hart_<id>_), so a user can tell keys apart in a script.
created_at*stringdate-timeregenerated_at?stringdate-timelast_used_at?stringWhen core last authenticated a request with the key, updated at most once per hour. The routers' offline checks on workspace hosts do not count.
date-timeexpires_at?stringAbsent for a key that does not expire.
date-timetoken*stringhart_<id>_<secret>, shown this once.
curl -X POST 'https://console.example.com/api/v1/me/api-keys' \ -H 'Content-Type: application/json' \ -d '{ "name": "string"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "source": "console", "prefix": "string", "created_at": "2019-08-24T14:15:22Z", "regenerated_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "token": "string"}The audit log
Cluster admins only (`platform.admin`; `hart admin audit`). The audit log, newest first (by time, then id); the filters combine. A malformed `action`, a cursor this API did not return or an `actor` or `team` below 1 is `422`; a malformed time is `400`.
Delete an API key
The key stops working at once, also on workspace hosts (the routers drop it with the next route delta).