Regenerate an API key
Replaces the key's secret: the old token is invalid at once, the new one is in `token` once. Id, name and expiry stay. Browser sessions only (403 with an API key).
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.
apikey*stringAn API key's id.
uuidThe key, with its new 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/497f6eca-6276-4993-bfeb-53cbbbba6f08/regenerate'{ "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"}