Harthelm Docs
REST APIAPI keys

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).

Generated from openapi/harthelm.yaml at v1.5.0
POST
/me/api-keys/{apikey}/regenerate

Authorization

cookie__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.

Path Parameters

apikey*string

An API key's id.

Formatuuid

Response Body

The key, with its new token.

application/json
  1. response

A personal API key without its secret.

id*string
Formatuuid
name*ApiKeyName

1 to 100 characters without leading or trailing spaces; need not be unique.

Match^\S(.*\S)?$
Length1 <= length <= 100
source*string

cli: minted by hart login.

Value in"console""cli"
prefix*string

The token up to its secret (hart_<id>_), so a user can tell keys apart in a script.

created_at*string
Formatdate-time
regenerated_at?string
Formatdate-time
last_used_at?string

When core last authenticated a request with the key, updated at most once per hour. The routers' offline checks on workspace hosts do not count.

Formatdate-time
expires_at?string

Absent for a key that does not expire.

Formatdate-time
token*string

hart_<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"}