PUT/v2/api-keys/{apiKeyId}

Update an API key

Replaces the editable settings for an API key, including its description and granted scopes. Supply scopes with the complete set of scopes you want the key to have.

1 parameter · 2 body fields
apiKeyIdintegerrequired
The integer identifier of the API key to update.

API key settings to replace. scopes is required.

descriptionstringoptional
A description for the API key.
scopesarray<string>required
The complete set of permission scopes to grant to the API key. Scope values must be unique.

5 status codes
200Returns the updated API key details, including its identifier, project information, description, scopes, and usage and expiration timestamps when available.
descriptionstringrequired
Description
expiresAtintegeroptional
Timestamp of API key expiraion
idintegerrequired
ID of the API key
lastUsedAtintegeroptional
Timestamp of API key last usage
projectIdintegerrequired
Api key's project ID
projectNamestringrequired
Api key's project name
scopesarray<string>required
Api key's permission scopes
userFullNamestringoptional
Full name of user owner
usernamestringoptional
Username of user owner
400Returned when `scopes` is missing or a request value fails validation.
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 update 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 scopes is missing or a request value fails validation. 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 update.