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

Updates a log bucket.

If the bucket has a `lifecycleState` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned.

After a bucket has been created, the bucket's location cannot be changed.

### HTTP request

Choose an endpoint:
global africa-south1 asia-east1 asia-east2 asia-northeast1 asia-northeast2 asia-northeast3 asia-south1 asia-south2 asia-southeast1 asia-southeast2 asia-southeast3 australia-southeast1 australia-southeast2 europe-central2 europe-north1 europe-north2 europe-north3 europe-southwest1 europe-west1 europe-west10 europe-west12 europe-west2 europe-west3 europe-west4 europe-west6 europe-west8 europe-west9 me-central1 me-central2 me-west1 northamerica-northeast1 northamerica-northeast2 northamerica-south1 southamerica-east1 southamerica-west1 us-central1 us-east1 us-east4 us-east5 us-south1 us-west1 us-west2 us-west3 us-west4 ca ch eu in sa us   
`PATCH https://logging.googleapis.com/v2/{name=billingAccounts/*/locations/*/buckets/*}`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The full resource name of the bucket to update. "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" For example: `"projects/my-project/locations/global/buckets/my-bucket"` Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `name`: - `logging.buckets.update` |

### Query parameters

| Parameters ||
|---|---|
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Required. Field mask that specifies the fields in `bucket` that need an update. A bucket field will be overwritten if, and only if, it is in the update mask. `name` and output only fields cannot be updated. For a detailed `FieldMask` definition, see: <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask> For example: `updateMask=retentionDays` 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/logging/docs/reference/v2/rest/v2/billingAccounts.locations.buckets#LogBucket`.

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/logging/docs/reference/v2/rest/v2/billingAccounts.locations.buckets#LogBucket`.

### Authorization scopes

Requires one of the following OAuth scopes:

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

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