Update an API key
Update an API key’s name, or replace its permissions by attaching a new policy in place: the key’s credential never changes, so consumers keep the same secret. The replacement policy may carry source_ip conditions, so you can add, change, or remove IP allowlisting on an existing key without rotating its credential. A present policy fully replaces the key’s policy and takes effect for new requests within the authorization cache; requests from outside a condition’s networks get 403 and are recorded in the audit log with the client address. Requires api_keys:write to rename; api_keys:set_policy to replace permissions.
Authorizations
Body
Update an API key. At least one field is required. A present policy fully replaces the key's permissions; an absent one leaves them unchanged. policy: null is not accepted: removing a key's restriction means deleting the key.
Permissions that fully replace the key's policy. Attaching a policy to a key without one makes the key scoped: every action and resource the policy does not list is denied. The key's credential, name, project, and expiry are unchanged, so consumers never need the key redistributed. A source_ip condition adds or changes IP allowlisting without rotating the credential. Requires api_keys:set_policy on the key.
Response
API key updated