Method: customers.customAudiences.mutate

Creates or updates custom audiences. Operation statuses are returned.

List of thrown errors: AuthenticationError AuthorizationError CustomAudienceError CustomInterestError FieldError FieldMaskError HeaderError InternalError MutateError OperationAccessDeniedError PolicyViolationError QuotaError RequestError

HTTP request

POST https://googleads.googleapis.com/v17/customers/{customerId}/customAudiences:mutate

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
customerId

string

Required. The ID of the customer whose custom audiences are being modified.

Request body

The request body contains data with the following structure:

JSON representation
{
  "operations": [
    {
      object (CustomAudienceOperation)
    }
  ],
  "validateOnly": boolean
}
Fields
operations[]

object (CustomAudienceOperation)

Required. The list of operations to perform on individual custom audiences.

validateOnly

boolean

If true, the request is validated but not executed. Only errors are returned, not results.

Response body

Response message for custom audience mutate.

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

JSON representation
{
  "results": [
    {
      object (MutateCustomAudienceResult)
    }
  ]
}
Fields
results[]

object (MutateCustomAudienceResult)

All results for the mutate.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/adwords

For more information, see the OAuth 2.0 Overview.

CustomAudienceOperation

A single operation (create, update) on a custom audience.

JSON representation
{
  "updateMask": string,

  // Union field operation can be only one of the following:
  "create": {
    object (CustomAudience)
  },
  "update": {
    object (CustomAudience)
  },
  "remove": string
  // End of list of possible types for union field operation.
}
Fields
updateMask

string (FieldMask format)

FieldMask that determines which resource fields are modified in an update.

This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

Union field operation. The mutate operation. operation can be only one of the following:
create

object (CustomAudience)

Create operation: No resource name is expected for the new custom audience.

update

object (CustomAudience)

Update operation: The custom audience is expected to have a valid resource name.

remove

string

Remove operation: A resource name for the removed custom audience is expected, in this format:

customers/{customerId}/customAudiences/{custom_audience_id}

MutateCustomAudienceResult

The result for the custom audience mutate.

JSON representation
{
  "resourceName": string
}
Fields
resourceName

string

Returned for successful operations.