users
keys

Create a user API key

Changed on

Create a new bencher_user_* API key for a user. The plaintext key is only returned once in the response. Only the authenticated user themselves and server admins have access to this endpoint. This endpoint requires a user session: neither a user API key nor a deprecated user API token can create a key, so neither can mint a user API key that outlives its own revocation.

post/v0/users/{user}/keys

Request

  • The document declares no server URL.
  • Auth
    none declared

Path parameters

userstring required

The slug or UUID for a user.

Request body

namestring required
ttlinteger nullable

The time-to-live (TTL) for the key in seconds. If not provided, the key will not expire for over 128 years.

Response

successful creation

creationstring date-time required
expirationstring date-time required
keystring required
namestring required
userstring uuid required
uuidstring uuid required

Changes