PUT/v2/api-keys/{apiKeyId}/regenerate

Regenerate an API key

Regenerates an API key by creating a new key value and updating its expiration time. Provide expiresAt to set the new expiration; a null value means the key does not expire.

1 parameter · 1 body field
apiKeyIdintegerrequired
The integer identifier of the API key to regenerate.

Optional expiration settings for the regenerated API key.

expiresAtintegeroptional
Expiration date in epoch format (milliseconds). When null key never expires.

5 status codes
200Returns the regenerated API key details, including its new key value, identifier, project information, scopes, and expiration time.
descriptionstringrequired
expiresAtintegeroptional
idintegerrequired
keystringrequired
Resulting user's api key
lastUsedAtintegeroptional
projectIdintegerrequired
projectNamestringrequired
scopesarray<string>required
userFullNamestringoptional
usernamestringoptional
400Returned when the request is invalid.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is not authenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when the authenticated user is not permitted to regenerate the API key.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the API key cannot be found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when the request is invalid. A 401 is returned when authentication is missing or invalid, a 403 when the authenticated user lacks permission, and a 404 when the API key cannot be found. The apiKeyId path parameter must identify the key to regenerate.