Guides
Partial mutates and validation
Atomicity, partialFailure, validateOnly and responseContentType in Google Ads API mutates.
By default, a mutate is atomic: operations run in order in a single transaction, and if any of them is invalid nothing is applied. Three body options change this: partialFailure, validateOnly and responseContentType. They apply to googleAds:mutate and to the per-service mutates.
partialFailure
With "partialFailure": true, valid operations are applied and invalid ones are skipped. The response is 200; each failed operation becomes {} in its position and the errors go to partialFailureError:
curl --request POST \
--url https://google-ads.mimicr.dev/v26/customers/2220330728/adGroupCriteria:mutate \
--header 'Authorization: Bearer <token>' \
--header 'login-customer-id: 6446154552' \
--header 'Content-Type: application/json' \
--data '{
"operations": [
{ "create": { "adGroup": "customers/2220330728/adGroups/54542600292", "keyword": { "text": "botijão de gás", "matchType": "EXACT" } } },
{ "create": { "adGroup": "customers/2220330728/adGroups/54542600292", "keyword": { "text": "gás de cozinha com entrega rápida no centro de goiânia hoje à noite", "matchType": "BROAD" } } }
],
"partialFailure": true
}'{
"results": [
{ "resourceName": "customers/2220330728/adGroupCriteria/54542600292~54542600330" },
{}
],
"partialFailureError": {
"code": 3,
"message": "Keyword text has too many words., at operations[1].create.keyword.text",
"details": [{
"@type": "type.googleapis.com/google.ads.googleads.v26.errors.GoogleAdsFailure",
"errors": [{ "errorCode": { "criterionError": "KEYWORD_HAS_TOO_MANY_WORDS" }, "message": "Keyword text has too many words.", "location": { "fieldPathElements": [{ "fieldName": "operations", "index": 1 }, { "fieldName": "create" }, { "fieldName": "keyword" }, { "fieldName": "text" }] } }]
}]
}
}partialFailureError.messageis "<message>, at<path>" with one error, or "Multiple errors in ‘details’. First error: …" with several.- Operations that depend on a temporary id that failed fail with
TEMP_ID_RESOURCE_HAD_ERRORS. - Errors outside the operations (authentication, account, quota) make the whole request fail as usual.
Without partialFailure, the same request would respond 400 and create no keywords.
validateOnly
With "validateOnly": true, every check runs, including temporary id resolution, and nothing is applied. Success is 200 {}; errors come back as usual. In googleAds:search, validateOnly validates the query. The field also exists in createCustomerClient and events:ingest.
responseContentType
| Value | Result |
|---|---|
RESOURCE_NAME_ONLY (default) | { "resourceName": "…" } |
MUTABLE_RESOURCE | resourceName plus the full resource, for example campaignResult: {resourceName, campaign: {…}} |
Removes return only the resourceName.
Limits
- Up to 10,000 operations per request (
requestError: TOO_MANY_MUTATE_OPERATIONS). Empty list:notEmptyError: EMPTY_LIST. - Resource names must belong to the account in the path; otherwise
requestError: RESOURCE_NAME_MALFORMED. - Each mutate operation counts as one operation against the daily quota.
No idempotency
Google has no idempotency key. If a mutate fails with a timeout, query before retrying: retrying a create can create another resource or hit DUPLICATE_CAMPAIGN_NAME.