- [HTTP request](https://docs.cloud.google.com/organization-policy/reference/rest/v2/organizations.customConstraints/patch#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/organization-policy/reference/rest/v2/organizations.customConstraints/patch#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/organization-policy/reference/rest/v2/organizations.customConstraints/patch#body.request_body)
- [Response body](https://docs.cloud.google.com/organization-policy/reference/rest/v2/organizations.customConstraints/patch#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/organization-policy/reference/rest/v2/organizations.customConstraints/patch#body.aspect)
- [Try it!](https://docs.cloud.google.com/organization-policy/reference/rest/v2/organizations.customConstraints/patch#try-it)

Updates a custom constraint.

Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the constraint does not exist.

Note: the supplied policy will perform a full overwrite of all fields.

### HTTP request

`PATCH https://orgpolicy.googleapis.com/v2/{customConstraint.name=organizations/*/customConstraints/*}`

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

### Path parameters

| Parameters ||
|---|---|
| `customConstraint.name` | `string` Immutable. Name of the constraint. This is unique within the organization. The name must be of the form: - `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms` The max length is 71 characters and the minimum length is 1. Note that the prefix `organizations/{organization_id}/customConstraints/custom.` is not counted. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/organization-policy/reference/rest/v2/organizations.customConstraints#CustomConstraint`.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/organization-policy/reference/rest/v2/organizations.customConstraints#CustomConstraint`.

### Authorization scopes

Requires one of the following OAuth scopes:

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

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