> [!NOTE]
> **Note:** See the [Mutates](https://developers.google.com/google-ads/api/rest/examples#mutates) section of the accompanying examples for more complete examples.

> [!NOTE]
> **Note:** If you are new to the Google Ads API, we recommend reading the [Getting
> Started](https://developers.google.com/google-ads/api/docs/get-started/make-first-call) guide first, which covers how to set up your account and make your first API call. Make sure to follow the *curl* tab.

Most resources are modified (created, updated, or removed) using a `Mutate`
method. The `Mutate` method is invoked as an HTTP `POST` to a resource-specific
URL that matches the resource-name pattern, without the trailing resource ID.
The IDs of the resources to be mutated are instead sent in the JSON request
body. This lets you send a single API call that contains multiple operations on
different resources.

For example, a campaign's resource name uses the following format:

```html
customers/CUSTOMER_ID/campaigns/CAMPAIGN_ID
```

To derive the URL used for mutating campaigns, omit the trailing resource ID and
append `:mutate`:

```html
https://googleads.googleapis.com/v26/customers/CUSTOMER_ID/campaigns:mutate
```

A `Mutate` message contains a top-level JSON object with an `operations` array
that can contain many `operation` objects. Each operation, in turn, can be one
of: `create`, `update`, or `remove`. These are the only possible mutate
operations.

```
POST /v26/customers/CUSTOMER_ID/campaigns:mutate HTTP/1.1
Host: googleads.googleapis.com
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN

{
  "operations": [
    ...
  ]
}
```

Most services support thousands of operations in a single API call. The [System
Limits](https://developers.google.com/google-ads/api/docs/best-practices/system-limits) guide documents the
limitations on request sizes.

Operations within a single API request are executed as one set of actions by
default, meaning they either all succeed together or the whole batch fails if
any single operation fails. Some services support a
[`partialFailure`](https://developers.google.com/google-ads/api/docs/best-practices/partial-failures) attribute
to change this behavior. See [Mutating Resources](https://developers.google.com/google-ads/api/docs/mutating/overview)
for more detailed information on mutate operation semantics.

## Create

Create operations produce new entities and must include a full JSON
representation of the resource you intend to create.

> [!IMPORTANT]
> **Key Point:** Create operations don't specify a `resourceName` or ID. When the API call succeeds, the response includes the `resourceName` generated for the newly created object.

```
POST /v26/customers/CUSTOMER_ID/campaigns:mutate HTTP/1.1
Host: googleads.googleapis.com
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN

{
  "operations": [
    {
    "create": {
        "name": "An example campaign",
        "status": "PAUSED",
        "campaignBudget": "customers/CUSTOMER_ID/campaignBudgets/CAMPAIGN_BUDGET_ID",
        "advertisingChannelType": "SEARCH",
        "networkSettings": {
          "targetGoogleSearch": true,
          "targetSearchNetwork": true,
          "targetContentNetwork": true,
          "targetPartnerSearchNetwork": false
        },
        "target_spend": {}
      }
    }
  ]
}
```

## Update

Update operations perform sparse updates to an existing resource. You only need
to specify the fields you want to modify.

To specify the fields that you want to update, set the `updateMask` attribute to
a comma-separated list of field names. This is particularly useful if you
already have a fully formed JSON representation of an object (for instance, as
returned by a previous API call), but only want to change certain fields.
Instead of pruning the JSON object, you can just list the field names to be
modified in the `updateMask` and send the entire JSON object.

> [!IMPORTANT]
> **Key Point:** The `update_mask` is a [standard
> field](https://cloud.google.com/apis/design/standard_fields) used across Google APIs to facilitate performing partial updates on a given resource. See [`FieldMask` reference documentation](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto) for full details.

The following example changes the `name` and `status` of an existing campaign
having the given `resourceName`.

```
POST /v26/customers/CUSTOMER_ID/campaigns:mutate HTTP/1.1
Host: googleads.googleapis.com
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN

{
  "operations": [
    {
      "updateMask": "name,status",
      "update": {
        "resourceName": "customers/CUSTOMER_ID/campaigns/CAMPAIGN_ID",
        "name": "My renamed campaign",
        "status": "PAUSED",
      }
    }
  ]
}
```

## Remove

Remove operations effectively delete an object, setting its Google Ads status to
`REMOVED`. Only the `resourceName` to be removed is required.

```
POST /v26/customers/CUSTOMER_ID/campaigns:mutate HTTP/1.1
Host: googleads.googleapis.com
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN

{
  "operations": [
    {
      "remove": "customers/CUSTOMER_ID/campaigns/CAMPAIGN_ID"
    }
  ]
}
```