Guides
Account hierarchy
Manager accounts (MCC) and client accounts, login-customer-id, listAccessibleCustomers, customer_client and createCustomerClient.
In Google Ads, a user has direct access to some accounts. A manager account (MCC) gives access to the client accounts below it. The Google Ads API requires you to say which MCC you are signing in through, in the login-customer-id header.
Access rules
On every customers/{id}/… route:
- The id must contain only digits. With hyphens or letters,
400 requestError: INVALID_CUSTOMER_ID. - An unknown account answers
403 authorizationError: USER_PERMISSION_DENIED: Google never confirms that an id exists. - With
login-customer-id, the user must have direct access to it, and the target account must be that account or sit below it. - Without the header, the target account must be one with direct access. A client account without the header answers
USER_PERMISSION_DENIEDwith the official message "…the manager's customer ID must be set in thelogin-customer-idheader…". - Accounts that are
CANCELED,CLOSEDor have an incomplete sign-up answer403 authorizationError: CUSTOMER_NOT_ENABLED.SUSPENDEDaccounts accept reads and refuse mutates withACTION_NOT_PERMITTED_FOR_SUSPENDED_ACCOUNT. - A project at
TESTonly reaches test accounts:CLOUD_PROJECT_NOT_APPROVED_FOR_PRODUCTION(v25 and v26) orACTION_NOT_PERMITTED(v23 and v24).
1. Accounts with direct access
curl --url https://google-ads.mimicr.dev/v26/customers:listAccessibleCustomers \ --header 'Authorization: Bearer <token>'
{ "resourceNames": ["customers/6446154552"] }No login-customer-id. Accounts reached only through the MCC do not show up here. A user without accounts gets {}, because empty lists are omitted.
2. Details of each account
curl --request POST \
--url https://google-ads.mimicr.dev/v26/customers/6446154552/googleAds:search \
--header 'Authorization: Bearer <token>' \
--header 'login-customer-id: 6446154552' \
--header 'Content-Type: application/json' \
--data '{ "query": "SELECT customer.id, customer.descriptive_name, customer.currency_code, customer.time_zone, customer.status, customer.manager FROM customer" }'{
"results": [
{ "customer": { "resourceName": "customers/6446154552", "id": "6446154552", "descriptiveName": "MCC minha-org", "currencyCode": "BRL", "timeZone": "America/Sao_Paulo", "status": "ENABLED", "manager": true } }
],
"fieldMask": "customer.id,customer.descriptiveName,customer.currencyCode,customer.timeZone,customer.status,customer.manager",
"queryResourceConsumption": "1"
}3. Clients of the MCC
curl --request POST \
--url https://google-ads.mimicr.dev/v26/customers/6446154552/googleAds:search \
--header 'Authorization: Bearer <token>' \
--header 'login-customer-id: 6446154552' \
--header 'Content-Type: application/json' \
--data '{ "query": "SELECT customer_client.id, customer_client.descriptive_name, customer_client.status, customer_client.manager FROM customer_client WHERE customer_client.level > 0" }'Each row carries customerClient with the client account's id. From there, call customers/{client id}/… with login-customer-id set to the MCC's id. "Conta pendente" shows up as CANCELED and answers CUSTOMER_NOT_ENABLED if you try to query it.
4. Create a client account
curl --request POST \
--url https://google-ads.mimicr.dev/v26/customers/6446154552:createCustomerClient \
--header 'Authorization: Bearer <token>' \
--header 'login-customer-id: 6446154552' \
--header 'Content-Type: application/json' \
--data '{ "customerClient": { "descriptiveName": "Revenda Centro", "currencyCode": "BRL", "timeZone": "America/Sao_Paulo" } }'{ "resourceName": "customers/4149401652" }The new account starts as ENABLED, below the MCC. currencyCode and timeZone are immutable. With emailAddress, the response also carries invitationLink. validateOnly: true only validates.
| Error | When |
|---|---|
authorizationError: ACTION_NOT_PERMITTED | The account in the path is not a manager account |
currencyCodeError: UNSUPPORTED | Invalid currency |
timeZoneError: INVALID_TIME_ZONE | Invalid time zone |
stringLengthError: TOO_LONG | Name longer than 255 bytes |
customerError: CREATION_DENIED_INELIGIBLE_MCC | Ineligible MCC ([mcc-inelegivel] trigger in the name) |
managerLinkError: TOO_MANY_ACCOUNTS | More than 20 clients in the MCC (limits.clientsPerManager) or [limite-contas] in the name |
customerError: CREATION_DENIED_FOR_POLICY_VIOLATION | [politica] in the name |
Build other trees
On Mimicr's side, customer.create creates accounts (client, sub-MCC or standalone) and user.add creates Google users with direct access to the accounts you specify. customer.set_status and customer.require_signup take an account to the error states above. See Sandbox control.