admin
lsa-admin

Run Google Ads Gaql

Run an arbitrary GAQL query against one of an org's Google Ads customers and return the rows as dicts.

Authenticates with the org's own per-org OAuth credential by default; pass a login_customer_id mapped to a shared manager credential to run under that MCC instead (which reaches only accounts linked under it). customer_id defaults to the org's single active LSA account when omitted. Read-only — GAQL only selects, so nothing is written to Google or our DB; note the per-org credential reaches the customer's full Google Ads account (Search / PMax / Display), not just Local Services. A revoked/expired credential or a malformed query surfaces as a 400.

Pass api_version to run this one query on a different Google Ads API version than the service default — the only way to select a field that exists solely in a newer version. Selecting a field the chosen version doesn't define is a 400 from Google.

post/admin/lsa/gaql

Request

  • Base URL
    https://api-docs.upsmith.com (the document declares no server; this is the origin it was published from)
  • Auth
    • API key in header x-api-key
    • or HTTP bearer

Headers

organization-idstring nullable
timezonestring
x-user-idstring nullable
x-actor-emailstring nullable
x-request-sourcestring nullable
x-operation-idstring nullable
x-commit-messagestring nullable
x-confirmation-idstring nullable
x-chat-idstring nullable

Request body

organization_idstring required

organization.id (UUID) whose Google Ads credential authenticates the query.

querystring required

The GAQL SELECT to run, e.g. 'SELECT campaign.id, campaign.name FROM campaign'.

customer_idstring nullable

Google customer id to query (dashes optional). Omit to use the org's single active LSA account.

login_customer_idstring nullable

MCC id (dashes optional). When set + mapped to a shared manager credential, uses it; else per-org OAuth.

max_rowsinteger

Row cap; the result sets truncated=true if more were available.

api_versionstring nullable

Google Ads API version for this query alone, e.g. 'v25'. Omit to use the service default.

Response

Successful Response

organization_idstring required
customer_idstring required

Google customer id (no dashes) the GAQL ran against.

login_customer_idstring nullable

MCC set as the login-customer-id header, when the query ran under a manager.

credential_source'manager' | 'per_org' required

Which credential authenticated: the MCC's shared manager credential or the org's own per-org OAuth.

api_versionstring required

Google Ads API version the query actually ran on -- which fields exist depends on it.

querystring required

The GAQL query that was executed, verbatim.

row_countinteger required

Number of rows returned (after the max_rows cap).

truncatedboolean required

True if the result was cut off at max_rows and more rows were available.

rowsobject[]

Each GoogleAdsRow as a dict; proto field names preserved.

Changes

No recorded changes to this operation across all 1 revision of this API.