Method: projects.locations.keys.patch

Patches the modifiable fields of an API key. The key string of the API key isn't included in the response.

NOTE: Key is a global resource; hence the only supported value for location is global.

HTTP request

PATCH https://apikeys.googleapis.com/v2/{key.name=projects/*/locations/*/keys/*}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
key.name

string

Output only. The resource name of the key. The name has the form: projects/<PROJECT_NUMBER>/locations/global/keys/<KEY_ID>. For example: projects/123456867718/locations/global/keys/b7ff1f9f-8275-410a-94dd-3855ee9b5dd2

NOTE: Key is a global resource; hence the only supported value for location is global.

Query parameters

Parameters
updateMask

string (FieldMask format)

The field mask specifies which fields to be updated as part of this request. All other fields are ignored. Mutable fields are: displayName, restrictions, and annotations. If an update mask is not provided, the service treats it as an implied mask equivalent to all allowed fields that are set on the wire. If the field mask has a special value "*", the service treats it equivalent to replace all allowed mutable fields.

This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

Request body

The request body contains an instance of Key.

Response body

If successful, the response body contains an instance of Operation.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the name resource:

  • apikeys.keys.update

For more information, see the IAM documentation.