/organization/projects/{project_id}/api_keys/{api_key_id}Update project API key
Updates the scopes and/or expiration of an existing API key in the project, including a service-account-owned key. Requires permission to write project API keys.
Provide at least one of scopes or expires_in_seconds. Omitted fields stay
unchanged; neither field accepts null. Both changes are saved together.
scopes replaces the key's scope restrictions using the same scope identifiers
as the dashboard. An empty array means All permissions, subject to the owner's
effective access; it does not mean no access. Use ["api.all.read"] for read-only
access or specific scopes such as ["api.files.read"] for restricted access.
This does not change user or service-account roles or grant admin permissions.
Scope changes follow the same authentication-cache propagation as dashboard edits.
Provide expires_in_seconds to set the expiration relative to this request.
The value must satisfy the organization's and project's expiry policies.
Expired keys cannot be updated. Retrying resets the expiration relative to
the new request. The response contains only the redacted key, not its secret.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
A 400 is returned: The project is archived, the key is expired, or the requested scopes or expiration are invalid. A 403 is returned: The caller does not have permission to update this API key. A 404 is returned: The project or API key was not found. A 429 is returned: Too many management requests. Reduce the request rate and try again later.