# Method: projects.locations.osPolicyAssignments.patch

- [HTTP request](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/patch#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/patch#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/patch#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/patch#body.request_body)
- [Response body](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/patch#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/patch#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/patch#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments/patch#try-it)

Update an existing OS policy assignment.

This method creates a new revision of the OS policy assignment.

This method returns a long running operation (LRO) that contains the rollout details. The rollout can be cancelled by cancelling the LRO.

For more information, see [Method: projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel).

### HTTP request

`PATCH https://osconfig.googleapis.com/v1/{osPolicyAssignment.name=projects/*/locations/*/osPolicyAssignments/*}`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `osPolicyAssignment.name` | `string` Resource name. Format: `projects/{project_number}/locations/{location}/osPolicyAssignments/{osPolicyAssignmentId}` This field is ignored when you create an OS policy assignment. |

### Query parameters

| Parameters ||
|---|---|
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Optional. Field mask that controls which fields of the assignment should be updated. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |
| `allowMissing` | `boolean` Optional. If set to true, and the OS policy assignment is not found, a new OS policy assignment will be created. In this situation, `updateMask` is ignored. |
| `requestId` | `string` Optional. A unique identifier for this request. Restricted to 36 ASCII characters. A random UUID is recommended. This request is only idempotent if a `requestId` is provided. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/compute/docs/osconfig/rest/Shared.Types/OSPolicyAssignment`.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/compute/docs/osconfig/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires the following OAuth scope:

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

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

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `osconfig.osPolicyAssignments.update`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).