# Method: projects.locations.models.setIamPolicy

- [HTTP request](https://docs.cloud.google.com/translate/automl/docs/reference/rest/v1beta1/projects.locations.models/setIamPolicy#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/translate/automl/docs/reference/rest/v1beta1/projects.locations.models/setIamPolicy#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/translate/automl/docs/reference/rest/v1beta1/projects.locations.models/setIamPolicy#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/translate/automl/docs/reference/rest/v1beta1/projects.locations.models/setIamPolicy#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/translate/automl/docs/reference/rest/v1beta1/projects.locations.models/setIamPolicy#body.response_body)
- [Authorization Scopes](https://docs.cloud.google.com/translate/automl/docs/reference/rest/v1beta1/projects.locations.models/setIamPolicy#body.aspect)

Sets the access control policy on the specified resource. Replaces any existing policy.

### HTTP request

`POST https://automl.googleapis.com/v1beta1/{resource}:setIamPolicy`

### Path parameters

| Parameters ||
|---|---|
| `resource` | `string` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. Authorization requires the following [Google IAM](https://cloud.google.com/iam) permission on the specified `resource`: - `automl.models.setIamPolicy` <br /> |

### Request body

The request body contains data with the following structure:

| JSON representation ||
|---|---|
| ``` { "policy": { object(`https://docs.cloud.google.com/translate/automl/docs/reference/rest/v1beta1/Policy`) } } ``` |

| Fields ||
|---|---|
| `policy` | ``object(`https://docs.cloud.google.com/translate/automl/docs/reference/rest/v1beta1/Policy`)`` 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 Cloud Platform services (such as Projects) might reject them. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/translate/automl/docs/reference/rest/v1beta1/Policy`.

### Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).