Method: projects.policies.patch

Updates a policy.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint or the policy do not exist. Returns a google.rpc.Status with google.rpc.Code.ABORTED if the etag supplied in the request does not match the persisted etag of the policy

Note: the supplied policy will perform a full overwrite of all fields.

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Immutable. The resource name of the policy. Must be one of the following forms, where constraint_name is the name of the constraint which this policy configures:

  • projects/{project_number}/policies/{constraint_name}
  • folders/{folder_id}/policies/{constraint_name}
  • organizations/{organization_id}/policies/{constraint_name}

For example, projects/123/policies/compute.disableSerialPortAccess.

Note: projects/{projectId}/policies/{constraint_name} is also an acceptable name for API requests, but responses will return the name using the equivalent project number.

Query parameters


string (FieldMask format)

Field mask used to specify the fields to be overwritten in the policy by the set. The fields specified in the updateMask are relative to the policy, not the full request.

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 Policy.

Response body

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

Authorization scopes

Requires the following OAuth scope:


For more information, see the Authentication Overview.