# Method: projects.locations.functions.patch

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

Updates existing function.

### HTTP request

`PATCH https://cloudfunctions.googleapis.com/v1/{function.name}`

### Path parameters

| Parameters ||
|---|---|
| `function.name` | `string` A user-defined name of the function. Function names must be unique globally and match pattern `projects/*/locations/*/functions/*` It takes the form `projects/{project}/locations/{location}/functions/{function}`. |

### Query parameters

| Parameters ||
|---|---|
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Required. The list of fields in `CloudFunction` that have to be updated. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions#CloudFunction`.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/functions/docs/reference/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).