PUT/v2/pats/{id}/regenerate

Regenerate a personal access token

Regenerates a personal access token (PAK), creating a new token value and updating its expiration. Supply expiresAt as an epoch timestamp in milliseconds, or use null for a token that never expires.

1 parameter · 1 body field
idintegerrequired
The numeric ID of the personal access token to regenerate.

Optional expiration configuration for the regenerated personal access token.

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

5 status codes
200Returns the regenerated token value, its PAK ID and description, and available creation, update, expiration, and last-used timestamps.
createdAtintegerrequired
descriptionstringrequired
expiresAtintegeroptional
idintegerrequired
lastUsedAtintegeroptional
tokenstringrequired
updatedAtintegerrequired
400Returned when the request is malformed or `expiresAt` 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 cannot regenerate the PAK.
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 no PAK exists with the given `id`.
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 malformed or expiresAt is not a valid epoch timestamp in milliseconds or null. A 401 indicates that the request is not authenticated, and a 403 indicates that the authenticated user cannot regenerate the token. A 404 is returned when the id path parameter does not identify an existing PAK.