# Method: projects.locations.connections.patch

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

Updates a single connection.

### HTTP request

`PATCH https://cloudbuild.googleapis.com/v2/{connection.name=projects/*/locations/*/connections/*}`

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

### Path parameters

| Parameters ||
|---|---|
| `connection.name` | `string` Immutable. The resource name of the connection, in the format `projects/{project}/locations/{location}/connections/{connectionId}`. |

### Query parameters

| Parameters ||
|---|---|
| `updateMask` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask` format)`` The list of fields to be updated. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |
| `allowMissing` | `boolean` If set to true, and the connection is not found a new connection will be created. In this situation `updateMask` is ignored. The creation will succeed only if the input connection has all the necessary information (e.g a githubConfig with both user_oauth_token and installationId properties). |
| `etag` | `string` The current etag of the connection. If an etag is provided and does not match the current etag of the connection, update will be blocked and an ABORTED error will be returned. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/build/docs/api/reference/rest/v2/projects.locations.connections#Connection`.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/build/docs/api/reference/rest/Shared.Types/Operation`.

### 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/).

### IAM Permissions

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

- `cloudbuild.connections.update`

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