- [HTTP request](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.request_body.SCHEMA_REPRESENTATION)
    - [JSON representation](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.request_body.SCHEMA_REPRESENTATION.budget.SCHEMA_REPRESENTATION)
    - [JSON representation](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.request_body.SCHEMA_REPRESENTATION.budget.SCHEMA_REPRESENTATION_1)
    - [JSON representation](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.request_body.SCHEMA_REPRESENTATION.budget.SCHEMA_REPRESENTATION_2)
    - [JSON representation](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.request_body.SCHEMA_REPRESENTATION.budget.SCHEMA_REPRESENTATION_3)
- [Response body](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#body.aspect)
- [Try it!](https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets/patch#try-it)

Updates a budget and returns the updated budget.

WARNING: There are some fields exposed on the Google Cloud Console that aren't available on this API. Budget fields that are not exposed in this API will not be changed by this method.

### HTTP request

`PATCH https://billingbudgets.googleapis.com/v1beta1/{budget.name=billingAccounts/*/budgets/*}`

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

### Path parameters

| Parameters ||
|---|---|
| `budget.name` | `string` Output only. Resource name of the budget. The resource name implies the scope of a budget. Values are of the form `billingAccounts/{billingAccountId}/budgets/{budgetId}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "budget": { "name": string, "displayName": string, "budgetFilter": { "projects": [ string ], "resourceAncestors": [ string ], "creditTypes": [ string ], "creditTypesTreatment": enum (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#CreditTypesTreatment`), "services": [ string ], "subaccounts": [ string ], "labels": { string: array, ... }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "calendarPeriod": enum (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#CalendarPeriod`), "customPeriod": { object (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#CustomPeriod`) } // End of mutually exclusive fields. }, "amount": { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "specifiedAmount": { object (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/Shared.Types/Money`) }, "lastPeriodAmount": { object (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#LastPeriodAmount`) } // End of mutually exclusive fields. }, "thresholdRules": [ { "thresholdPercent": number, "spendBasis": enum (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#Basis`) } ], "allUpdatesRule": { "pubsubTopic": string, "schemaVersion": string, "monitoringNotificationChannels": [ string ], "disableDefaultIamRecipients": boolean, "enableProjectLevelRecipients": boolean }, "etag": string, "ownershipScope": enum (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#OwnershipScope`) }, "updateMask": string } ``` |

| Fields ||
|---|---|
| `budget.displayName` | `string` User data for display name in UI. Validation: \<= 60 chars. |
| `budget.budgetFilter` | ``object (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#Filter`)`` Optional. Filters that define which resources are used to compute the actual spend against the budget amount, such as projects, services, and the budget's time period, as well as other filters. |
| `budget.amount` | ``object (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#BudgetAmount`)`` Required. Budgeted amount. |
| `budget.thresholdRules[]` | ``object (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#ThresholdRule`)`` Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Optional for `pubsubTopic` notifications. Required if using email notifications. |
| `budget.allUpdatesRule` | ``object (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#AllUpdatesRule`)`` Optional. Rules to apply to notifications sent based on budget spend and thresholds. |
| `budget.etag` | `string` Optional. Etag to validate that the object is unchanged for a read-modify-write operation. An empty etag will cause an update to overwrite other changes. |
| `budget.ownershipScope` | ``enum (`https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#OwnershipScope`)`` |
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` Optional. Indicates which fields in the provided budget to update. Read-only fields (such as `name`) cannot be changed. If this is not provided, then only fields with non-default values from the request are updated. See <https://developers.google.com/protocol-buffers/docs/proto3#default> for more details about default values. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/billing/docs/reference/budget/rest/v1beta1/billingAccounts.budgets#Budget`.

### Authorization scopes

Requires one of the following OAuth scopes:

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