ZITADEL Docs
APIsCore ResourcesV2User

AddKey

Add a Key

Add a keys that can be used to securely authenticate at the Zitadel APIs using JWT profile authentication using short-lived tokens. Make sure you store the returned key safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have keys.

Required permission:

  • user.write
POST
/v2/users/{user_id}/keys

Path Parameters

user_id*string

The users resource ID.

Request Body

application/json

expirationDate?string

The date the key will expire and no logins will be possible anymore.

Formatdate-time
publicKey?string

Optionally provide a public key of your own generated RSA private key.

Formatbyte
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://loading/v2/users/string/keys" \  -H "Content-Type: application/json" \  -d '{}'
{
  "creationDate": "1s",
  "keyId": "string",
  "keyContent": "string"
}
{
  "code": "not_found",
  "message": "string",
  "detail": {
    "type": "string",
    "value": "string",
    "debug": {}
  }
}

Was this page helpful?