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-09-04 UTC."],[[["\u003cp\u003eThis document details the \u003ccode\u003esetIamPolicy\u003c/code\u003e method for setting access control policies on resources within the legacy Apigee Registry API, which is now unsupported.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request for this method is a \u003ccode\u003ePOST\u003c/code\u003e request to a specific URL using gRPC Transcoding syntax, where the resource parameter is required.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must contain a JSON representation with a policy object that details the complete policy to be applied to the specified resource.\u003c/p\u003e\n"],["\u003cp\u003eA successful response will return a policy object, and the method may return \u003ccode\u003eNOT_FOUND\u003c/code\u003e, \u003ccode\u003eINVALID_ARGUMENT\u003c/code\u003e, or \u003ccode\u003ePERMISSION_DENIED\u003c/code\u003e errors.\u003c/p\u003e\n"],["\u003cp\u003eThe authorization scope for this method requires \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.apis.deployments.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\n| **Note:** You are viewing the legacy Apigee Registry API documentation which is no longer supported. For the latest API hub functionality, it's recommended to use the [Apigee API hub APIs](/apigee/docs/reference/apis/apihub/rest).\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://apigeeregistry.googleapis.com/v1/{resource=projects/*/locations/*/apis/*/deployments/*}: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](/apigee/docs/reference/apis/apigeeregistry/rest/v1/Policy).\n\n### Authorization Scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`"]]