Rotate an API key
Generates a new secret for the API key in the id property. The key keeps its ID, name, and owner. Rotation clears the key’s revoked state and resets its expiresAt property.
You can rotate:
user-key— Your own keys. Not allowed if your team admin disabled API key creation.scim-key— Your team’s SCIM keys, if you can manage SCIM keys.service-account-key— Keys of service accounts in your team, if you can manage service accounts. A Super Admin service account’s keys require a Super Admin.service-account-scim-key— SCIM keys of service accounts in your team. Requires the service account requirements above and the permission to manage SCIM keys.
The existing secret keeps working for 6 hours after rotation, so you can roll out the new key. To make the existing secret stop working immediately, set revokeExisting to true. You must set it to true to rotate a revoked key.
On success, this returns an HTTP 201 Created response that includes the new full key value. This is the only time the API returns it, so store it securely.
Authentication
Request
If true, the existing secret stops working immediately instead of after 6 hours. You must set this to true to rotate a revoked key.
Response
The API key’s version. Both SCIM key types use scim.
A user. By default, only the id property is returned. If you set populateUsers to true, the name, username, email, and profilePic properties are also returned. These properties are null if the user cannot be found.
The user who created the key. For user-key and scim-key keys, this is the same as owner. For the service account key types, this is the admin who created the key. This value is null if the system did not record who created it.
Why the key was revoked. This value is null unless revoked is true.
The date and time at which the key was last used. This value is null if the key has never been used.
The date and time after which the key expires. This value is null if the key does not expire.