Caution: You are viewing documentation for the API's REST interface. Most of our official client libraries use gRPC. See the REST Introduction for details.

Method: customers.batchJobs.addOperations

Add operations to the batch job.

List of thrown errors: AuthenticationError AuthorizationError BatchJobError HeaderError InternalError QuotaError RequestError ResourceCountLimitExceededError

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Required. The resource name of the batch job.

Request body

The request body contains data with the following structure:

JSON representation
  "sequenceToken": string,
  "mutateOperations": [
      object (MutateOperation)


A token used to enforce sequencing.

The first batchJobs.addOperations request for a batch job should not set sequenceToken. Subsequent requests must set sequenceToken to the value of nextSequenceToken received in the previous batchJobs.addOperations response.


object (MutateOperation)

Required. The list of mutates being added.

Operations can use negative integers as temp ids to signify dependencies between entities created in this batch job. For example, a customer with id = 1234 can create a campaign and an ad group in that same campaign by creating a campaign in the first operation with the resource name explicitly set to "customers/1234/campaigns/-1", and creating an ad group in the second operation with the campaign field also set to "customers/1234/campaigns/-1".

Response body

If successful, the response body contains data with the following structure:

Response message for BatchJobService.AddBatchJobOperations.

JSON representation
  "totalOperations": string,
  "nextSequenceToken": string

string (int64 format)

The total number of operations added so far for this batch job.



The sequence token to be used when calling batchJobs.addOperations again if more operations need to be added. The next batchJobs.addOperations request must set the sequenceToken field to the value of this field.

Authorization Scopes

Requires the following OAuth scope:


For more information, see the OAuth 2.0 Overview.