Closed beta · run Worlds on your machineBrowse worlds →
Docs menu · Google Ads API

Worlds / Marketing and ads

Google Ads API

A local Google Ads account with campaigns, budgets, ad groups, keywords, bidding strategies and ad policy status. Test the agent that pauses, rebudgets and fixes disapproved ads.

Base path
/v17/customers/{customerId}
Auth
OAuth 2.0 bearer token plus developer token, the world key
Endpoints
9
Status
Active today

This reference previews the surface the Google Ads world serves in the closed beta. Paths mirror the public Google Ads API; the exact subset is confirmed when your workflow is scoped.

Connect

The run gives your agent these bindings. Keep your SDK; change only where it sends requests.

bindingmeaning
WORLDS_GOOGLE_ADS_URLThis world's origin followed by /v17/customers/{customerId}
WORLDS_API_KEYThe world key, accepted wherever Google Ads expects a credential
WORLDS_WORLD_IDThe isolated world's identity
js · google-ads-api
import { GoogleAdsApi } from "google-ads-api";

const api = new GoogleAdsApi({
  client_id: "id",
  client_secret: "secret",
  developer_token: process.env.WORLDS_API_KEY,
  base_url: process.env.WORLDS_GOOGLE_ADS_URL,
});
const customer = api.Customer({ customer_id: "1234567890", refresh_token: "token" });
const rows = await customer.query("SELECT campaign.id, campaign.name FROM campaign");

API reference

Campaigns

Ad campaigns with budget and status.

  • POST/v17/customers/{customerId}/googleAds:searchQuery campaigns with GAQL
  • POST/v17/customers/{customerId}/googleAds:searchStreamStream query results
  • POST/v17/customers/{customerId}/campaigns:mutateCreate, update or remove campaigns
Fields · 5
resourceNamestringcustomers/{id}/campaigns/{id}
namestringCampaign name
statusstringENABLED, PAUSED or REMOVED
advertisingChannelTypestringSEARCH, DISPLAY and so on
campaignBudgetstringBudget resource name

Ad groups

Groups of ads and keywords inside a campaign.

  • POST/v17/customers/{customerId}/adGroups:mutateCreate, update or remove ad groups
  • POST/v17/customers/{customerId}/googleAds:searchQuery ad groups with GAQL
Fields · 5
resourceNamestringAd group resource name
namestringAd group name
statusstringENABLED, PAUSED or REMOVED
campaignstringParent campaign
cpcBidMicrosstringDefault bid in micros

Campaign budgets

Daily spend limits shared by campaigns.

  • POST/v17/customers/{customerId}/campaignBudgets:mutateCreate or update budgets
  • POST/v17/customers/{customerId}/googleAds:searchQuery budgets with GAQL
Fields · 4
resourceNamestringBudget resource name
namestringBudget name
amountMicrosstringDaily amount in micros
deliveryMethodstringSTANDARD or ACCELERATED

Reporting

Performance metrics returned by GAQL queries.

  • POST/v17/customers/{customerId}/googleAds:searchRun a report query
  • POST/v17/customers/{customerId}/googleAds:searchStreamStream a report
Fields · 5
metrics.impressionsstringImpressions
metrics.clicksstringClicks
metrics.costMicrosstringSpend in micros
metrics.conversionsnumberConversions
segments.datestringDay

Test workflow

  1. Prepare. Select the Google Ads setup for your workflow and review its starting records, including campaigns, ad groups, campaign budgets.
  2. Connect. Configure your agent with this world's URL and key using the SDK example. Check that it reaches the intended API before running a test.
  3. Define. Describe the task, expected final changes and records that must stay untouched. Keep expected outcomes separate from the agent's instructions.
  4. Run and inspect. Use the dashboard or your workflow's generated CLI setup. Review final records and changes, then rerun from the same starting setup with the relevant failure conditions. Use Deployment and CI to automate the same workflow.

What to verify

  • Brand US budget at $180 a day
  • Generic Shoes campaign Paused
  • PMax Holiday budget still $300
  • No budget changed by more than 20%
  • Shared budgets untouched

Test file

A task file names the jobs, the policy your agent is given and what the grader reads back from the world's final state. The agent never sees the expected outcomes.

yaml · worlds/tasks.yaml
# worlds/tasks.yaml · Google Ads
version: 2
connector: google-ads
seed: google-ads-starter
mode: isolated
policy: >
  Rebalance spend for the weekend. Raise Brand US by up to 20%. Pause Generic
  Shoes, its CPA doubled. Do not move any budget more than 20% without
  approval.
tasks:
  - id: raise-or-lower-a-campaign-budget-inside-the-limit
    prompt: Raise or lower a campaign budget inside the limit
  - id: pause-underperforming-keywords
    prompt: Pause underperforming keywords
  - id: fix-and-resubmit-a-disapproved-ad
    prompt: Fix and resubmit a disapproved ad
expected:
  - Brand US budget at $180 a day
  - Generic Shoes campaign Paused
  - PMax Holiday budget still $300
  - "No budget changed by more than 20%"
  - Shared budgets untouched
scenarios:
  - quota-exhausted
  - partial-failure
  - policy-violation

See Tasks and outcomes for every field, and Deployment and CI to run the file on every pull request.

Failure conditions

Each one fires before the handler, at the same step on every run.

conditionwhat the agent sees
quota-exhaustedRESOURCE_EXHAUSTED on the next mutate
partial-failureOne operation in the batch fails, the rest apply
policy-violationPolicyFindingError on the edited ad text
token-expiredThe OAuth refresh fails and the call returns UNAUTHENTICATED

Starting data

Start each run from the same records and relationships. The overview below describes the Google Ads starter; use the setup supplied for your workflow when preparing your own snapshot.

RecordsStarting setup
campaigns8 Search and Performance Max, Enabled and Paused
campaign budgetsDaily, two shared between campaigns
ad groups24 with 300 keywords
ads60 responsive search ads, 3 disapproved
bidding strategiesMaximize conversions and Target CPA

The record shapes below reuse this world's API field definitions. They show illustrative values and placeholders, not an importable seed. API responses and seed input can differ; include all required records and references in the accepted import format for your workflow.

Campaigns records

Campaigns

Ad campaigns with budget and status.

FieldTypeMeaning / relationship
resourceNamestringcustomers/{id}/campaigns/{id}
namestringCampaign name
statusstringENABLED, PAUSED or REMOVED
advertisingChannelTypestringSEARCH, DISPLAY and so on
campaignBudgetstringBudget resource name
json · illustrative record shape
{
  "resourceName": "<customers/{id}/campaigns/{id}>",
  "name": "<Campaign name>",
  "status": "<ENABLED, PAUSED or REMOVED>",
  "advertisingChannelType": "<SEARCH, DISPLAY and so on>",
  "campaignBudget": "<Budget resource name>"
}

See campaigns operations

Ad groups records

Ad groups

Groups of ads and keywords inside a campaign.

FieldTypeMeaning / relationship
resourceNamestringAd group resource name
namestringAd group name
statusstringENABLED, PAUSED or REMOVED
campaignstringParent campaign
cpcBidMicrosstringDefault bid in micros
json · illustrative record shape
{
  "resourceName": "<Ad group resource name>",
  "name": "<Ad group name>",
  "status": "<ENABLED, PAUSED or REMOVED>",
  "campaign": "<Parent campaign>",
  "cpcBidMicros": "<Default bid in micros>"
}

See ad groups operations

Campaign budgets records

Campaign budgets

Daily spend limits shared by campaigns.

FieldTypeMeaning / relationship
resourceNamestringBudget resource name
namestringBudget name
amountMicrosstringDaily amount in micros
deliveryMethodstringSTANDARD or ACCELERATED
json · illustrative record shape
{
  "resourceName": "<Budget resource name>",
  "name": "<Budget name>",
  "amountMicros": "<Daily amount in micros>",
  "deliveryMethod": "<STANDARD or ACCELERATED>"
}

See campaign budgets operations

Reporting records

Reporting

Performance metrics returned by GAQL queries.

FieldTypeMeaning / relationship
metrics.impressionsstringImpressions
metrics.clicksstringClicks
metrics.costMicrosstringSpend in micros
metrics.conversionsnumberConversions
segments.datestringDay
json · illustrative record shape
{
  "metrics.impressions": "<Impressions>",
  "metrics.clicks": "<Clicks>",
  "metrics.costMicros": "<Spend in micros>",
  "metrics.conversions": 1,
  "segments.date": "<Day>"
}

See reporting operations

See the Google Ads world in the catalog