REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Google Cloud services (such as Projects) might reject them.
Response body
If successful, the response body contains an instance of 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-07-21 UTC."],[[["\u003cp\u003eThe endpoint \u003ccode\u003ePOST https://dataform.googleapis.com/v1beta1/{resource=projects/*/locations/*/repositories/*}:setIamPolicy\u003c/code\u003e is used to set the access control policy on a specified resource, replacing any existing policy.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eresource\u003c/code\u003e path parameter is a required string that specifies the target resource using a specific format, detailed in the Resource names documentation.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain a \u003ccode\u003epolicy\u003c/code\u003e field, which is an object that represents the complete policy to be applied to the resource, with size limitations.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful execution, the response body will contain a \u003ccode\u003ePolicy\u003c/code\u003e instance, representing the applied policy.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires one of two OAuth scopes: \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/bigquery\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.repositories.setIamPolicy\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nSets the access control policy on the specified resource. Replaces any existing policy.\n\nCan return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.\n\n### HTTP request\n\n`POST https://dataform.googleapis.com/v1beta1/{resource=projects/*/locations/*/repositories/*}:setIamPolicy`\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 data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Policy](/dataform/reference/rest/Shared.Types/Policy).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/bigquery`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]