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
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.
Format
date-timepublicKey?string
Optionally provide a public key of your own generated RSA private key.
Format
byte[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?