Creates or updates a project's policy, and returns a copy of the new policy. A policy is always updated as a whole, to avoid race conditions with concurrent policy enforcement (or management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed.
HTTP request
PUT https://binaryauthorization.googleapis.com/v1beta1/{policy.name=projects/*/policy}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-30 UTC."],[[["\u003cp\u003eThis operation creates or updates a project's policy in its entirety, preventing race conditions with concurrent requests.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request is a \u003ccode\u003ePUT\u003c/code\u003e operation to a specific URL following gRPC Transcoding syntax.\u003c/p\u003e\n"],["\u003cp\u003eThe path parameter \u003ccode\u003epolicy.name\u003c/code\u003e uniquely identifies the policy within a project.\u003c/p\u003e\n"],["\u003cp\u003eBoth the request and response bodies contain an instance of the \u003ccode\u003ePolicy\u003c/code\u003e object.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e OAuth scope.\u003c/p\u003e\n"]]],[],null,["# Method: projects.updatePolicy\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nCreates or updates a project's [policy](/binary-authorization/docs/reference/rest/Shared.Types/Policy), and returns a copy of the new [policy](/binary-authorization/docs/reference/rest/Shared.Types/Policy). A policy is always updated as a whole, to avoid race conditions with concurrent policy enforcement (or management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the request is malformed.\n\n### HTTP request\n\n`PUT https://binaryauthorization.googleapis.com/v1beta1/{policy.name=projects/*/policy}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains an instance of [Policy](/binary-authorization/docs/reference/rest/Shared.Types/Policy).\n\n### Response body\n\nIf successful, the response body contains an instance of [Policy](/binary-authorization/docs/reference/rest/Shared.Types/Policy).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/)."]]