List reachable Google Ads accounts
The Google Ads accounts the signed-in person's own Google sign-in can reach, with their customer ids.
GET /google-ads/accounts
Scope read · Access Read only · Operation id google_ads.list_accounts
Try it
productmetrics runs after productmetrics login; curl needs PM_TOKEN (see Authentication).
productmetrics google-ads list-accounts --jsonResponse
API response (200), shortened:
{
"data": {
"accounts": [
{
"customer_id": "9876543210",
"descriptive_name": "Example Store Agency",
"currency_code": "EUR",
"time_zone": "Europe/Amsterdam",
"parent_id": null,
"level": 0,
"is_manager": true,
"mcc_account_id": "9876543210"
}
// … 1 more
]
},
"request_id": "req_01JEBJW8WTW9HP6H6VNCVMPXE4"
}Manager (MCC) accounts are listed with is_manager: true; connect a client account, not the manager.
CLI output: productmetrics google-ads list-accounts --json prints { "ok": true, "data": …, "request_id": "…" } with the same data.
Before you call
Use it to pick the customer_id for google_ads.create_property_connection in user_oauth mode. Fails with 400 when the person has not granted Google access; that happens in a browser: give them the link from google.get_connect_link.
Errors
A failure answers with its HTTP status and { error: { code, message, details? }, request_id }. Branch on code (stable, lower_snake); show message to the person. The CLI prints the same error with "ok": false.
{
"error": {
"code": "insufficient_scope",
"message": "This operation needs the read scope; connect again and allow it.",
"details": {
"required_scope": "read"
}
},
"request_id": "req_01JAK9GGCT2C9J3P13HP2KA5EW"
}| Status | Code | When |
|---|---|---|
| 400 | invalid_request | Fails with 400 when the person has not granted Google access; that happens in a browser: give them the link from google.get_connect_link. |
| 401 | invalid_token | The token is missing, expired or revoked: sign in again (productmetrics login). The WWW-Authenticate header says why. |
| 403 | insufficient_scope | The token lacks the read scope (details.required_scope): sign in again and allow it. |
| 429 | rate_limited | More than 600 requests a minute for this person: wait the Retry-After seconds (60) and retry. |