Invite a Google Ads account
Sends a manager-link invite from Product Metrics' manager account to one Google Ads account, for a central_read_only connection.
POST /companies/{companyId}/google-ads/invites
Scope setup · Access Changes data · Operation id google_ads.send_invite
Try it
productmetrics runs after productmetrics login; curl needs PM_TOKEN (see Authentication). Set $COMPANY_ID first.
productmetrics google-ads send-invite \
--company-id $COMPANY_ID \
--customer-id 1234567890 \
--jsonResponse
API response (200):
{
"data": {
"customerId": "1234567890",
"status": "pending"
},
"request_id": "req_01JNAQGEE2R06RAM9FS3P0JS1Z"
}pending until the account owner accepts the invite in Google Ads.
CLI output: productmetrics google-ads send-invite --json prints { "ok": true, "data": …, "request_id": "…" } with the same data, plus "next_action": { "type": "browser", "url": "…" } when a person must open a link (exit code 4).
Before you call
It grants access to that one account only. The person must then accept the invite in the Google Ads web interface (Admin > Access and security > Managers); this API cannot accept it. After they accept, call google_ads.create_property_connection with connection_mode central_read_only. A 409 means the invite is still pending, already accepted, or claimed by another workspace. Needs company admin.
Browser step: the result can hold a URL the person must open in a browser. An agent cannot finish that step itself: give the person the URL (the CLI prints it and exits 4).
Path parameters
| Name | Type | Description |
|---|---|---|
companyId | string (uuid) | Your workspace id, from productmetrics whoami or properties.list (company_id). |
Body
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | Yes | The Google Ads customer id, 10 digits without dashes. |
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 setup scope; connect again and allow it.",
"details": {
"required_scope": "setup"
}
},
"request_id": "req_01JD07MVW3NFE0CPFTN9DW2EHD"
}| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A path, query or body value does not match this page. details.issues lists each location, path and message. |
| 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 setup scope (details.required_scope): sign in again and allow it. |
| 404 | not_found | An id in the path does not exist, or the signed-in person cannot open it. |
| 409 | conflict | A 409 means the invite is still pending, already accepted, or claimed by another workspace. |
| 429 | rate_limited | More than 600 requests a minute for this person: wait the Retry-After seconds (60) and retry. |