Moloco Ads
Use the bundled CLI as the single entry point for Moloco Ads authentication, analytics, asynchronous reports and logs, and campaign entity management. This skill targets Moloco Ads at https://api.moloco.cloud/cm/v1; it does not target Moloco Commerce Media.
Requirements
- Require Python 3.10 or newer.
- Run commands through
scripts/moloco_ads.sh; do not construct ad hoc Moloco requests.
- Read the API key only from
MOLOCO_ADS_API_KEY. Never accept it as a command-line argument or print it.
- Default to API version
v1.10. Use MOLOCO_ADS_API_VERSION only when the user's Moloco organization has standardized on another currently supported version.
- Let the CLI exchange the API key for a 16-hour access token and cache it locally with owner-only permissions. Never expose the cached token.
Safety rules
- Keep the API origin fixed to
https://api.moloco.cloud and paths under /cm/v1/.
- Use only the built-in resource allowlist. Do not add an arbitrary URL or raw-path escape hatch during a request.
- Execute analytics, report generation, log generation, status checks, downloads, and GET resource reads directly because they retrieve data.
- Preview entity create, update, and delete operations by default. Require the user to confirm exact IDs, query parameters, and payload before rerunning with
--execute.
- Before entity update or delete, let the CLI retrieve the current object. Update output includes the before and after objects.
- Do not automatically retry entity mutations, report creation, or log creation. They can consume budget, change delivery, create duplicates, or consume limited daily quota.
- Never forward the Moloco bearer token or API-version header to report/log storage URLs. Do not print returned pre-signed URLs.
- Treat reports, logs, tracking URLs, audiences, customer sets, and identifiers as sensitive. Saved output files use mode
0600.
- Confirm budgets, bids, schedules, countries, targeting, tracking links, creative assignments, and
enabling_state before executing a campaign-related write.
Workflow
Check local readiness:
bash <skill-path>/scripts/moloco_ads.sh check
Select the smallest command matching the request. Use list-actions and describe when routing is unclear.
Collect required IDs and use API field names from the official documentation. Do not translate dashboard labels into guessed enum values.
Execute reads directly. For entity writes, show the preview, obtain confirmation, and rerun with --execute.
Return a concise summary and the saved output path. Do not paste large reports or logs unless requested.
Analytics
Use Analytics for synchronous, filtered data. analytics-detail is capped at 10,000 rows and all supported Analytics date ranges are limited to 184 inclusive days.
bash <skill-path>/scripts/moloco_ads.sh analytics-detail \
--ad-account-id ad_account_123 \
--from 2026-08-01 \
--to 2026-08-07 \
--dimensions DATE,CAMPAIGN_ID,CAMPAIGN_TITLE \
--metrics IMPRESSIONS,CLICKS,SPEND
Commands:
analytics-overview
analytics-detail
analytics-skadnetwork
Use --payload-file for filters, ordering, conversion-event fields, or other documented request fields. Explicit flags override the corresponding fields in the payload file.
Read references/reporting.md before selecting dimensions, metrics, filters, or report behavior.
Asynchronous reports
Use Report API for scheduled or large exports. A single report is limited to 31 inclusive days.
bash <skill-path>/scripts/moloco_ads.sh report-create \
--ad-account-id ad_account_123 \
--from 2026-08-01 \
--to 2026-08-07 \
--dimensions DATE,CAMPAIGN,CREATIVE \
--format csv \
--wait
Without --wait, return the report ID immediately. Continue later with:
bash <skill-path>/scripts/moloco_ads.sh report-status --report-id report_123
bash <skill-path>/scripts/moloco_ads.sh report-download --report-id report_123 --format json --wait
Log data
Moloco disables Log API by default. Use these commands only after the user confirms Moloco has enabled it for the account:
bash <skill-path>/scripts/moloco_ads.sh log-create \
--ad-account-id ad_account_123 \
--date 2026-08-09 \
--type IMP \
--format CSV
Commands:
log-create
log-status
log-download
Read references/reporting.md for supported log types and formats.
Entity reads and writes
Supported resources:
ad-accounts
products
campaigns
ad-groups
creative-groups
creatives
audience-targets
customer-sets
tracking-links
List and read:
bash <skill-path>/scripts/moloco_ads.sh list \
--resource campaigns \
--ad-account-id ad_account_123 \
--product-id product_123
bash <skill-path>/scripts/moloco_ads.sh get \
--resource campaign \
--id campaign_123
Preview and execute a write:
bash <skill-path>/scripts/moloco_ads.sh update \
--resource campaign \
--id campaign_123 \
--payload-file /secure/path/campaign-update.json
bash <skill-path>/scripts/moloco_ads.sh update \
--resource campaign \
--id campaign_123 \
--payload-file /secure/path/campaign-update.json \
--execute
Use --params-file for documented query fields not covered by common flags. Read references/campaign-management.md before preparing a write payload.
Output and failures
- Save successful API responses under
./out/ by default; use --output to select a file.
- Use
--stdout only when the user explicitly requests the complete JSON response.
- Report and log downloads are saved directly in their original format.
- Retry safe reads and Analytics requests on
429 and 5xx with bounded backoff, honoring Retry-After or X-Rate-Limit-Reset when possible.
- On
401, refresh the cached access token once. Retry only safe reads; for a write or export-creation request, stop after refreshing and ask the user to rerun it deliberately.
- On
403, verify the API key's workplace, ad-account role, and requested resource.
- On
429, report the relevant quota and wait for user direction before creating another report or log.
- Treat Moloco error payloads as authoritative, but redact credentials from all error output.
For the endpoint map, versioning, quotas, and source links, read references/api-capabilities.md.
1---2name: moloco-ads3description: Query, analyze, export, and safely manage Moloco Ads through the official Moloco Ads API. Use whenever the user mentions Moloco Ads, Moloco campaign performance, spend, impressions, clicks, installs, revenue, ROAS, Analytics, Report API, Log API, campaigns, ad groups, creatives, products, tracking links, audiences, customer sets, or wants to inspect, create, update, pause, enable, or delete a Moloco Ads resource. Do not use for Moloco Commerce Media (MCM) or Moloco Publisher SDK workflows.4---56# Moloco Ads78Use the bundled CLI as the single entry point for Moloco Ads authentication, analytics, asynchronous reports and logs, and campaign entity management. This skill targets Moloco Ads at `https://api.moloco.cloud/cm/v1`; it does not target Moloco Commerce Media.910## Requirements1112- Require Python 3.10 or newer.13- Run commands through `scripts/moloco_ads.sh`; do not construct ad hoc Moloco requests.14- Read the API key only from `MOLOCO_ADS_API_KEY`. Never accept it as a command-line argument or print it.15- Default to API version `v1.10`. Use `MOLOCO_ADS_API_VERSION` only when the user's Moloco organization has standardized on another currently supported version.16- Let the CLI exchange the API key for a 16-hour access token and cache it locally with owner-only permissions. Never expose the cached token.1718## Safety rules1920- Keep the API origin fixed to `https://api.moloco.cloud` and paths under `/cm/v1/`.21- Use only the built-in resource allowlist. Do not add an arbitrary URL or raw-path escape hatch during a request.22- Execute analytics, report generation, log generation, status checks, downloads, and GET resource reads directly because they retrieve data.23- Preview entity create, update, and delete operations by default. Require the user to confirm exact IDs, query parameters, and payload before rerunning with `--execute`.24- Before entity update or delete, let the CLI retrieve the current object. Update output includes the before and after objects.25- Do not automatically retry entity mutations, report creation, or log creation. They can consume budget, change delivery, create duplicates, or consume limited daily quota.26- Never forward the Moloco bearer token or API-version header to report/log storage URLs. Do not print returned pre-signed URLs.27- Treat reports, logs, tracking URLs, audiences, customer sets, and identifiers as sensitive. Saved output files use mode `0600`.28- Confirm budgets, bids, schedules, countries, targeting, tracking links, creative assignments, and `enabling_state` before executing a campaign-related write.2930## Workflow31321. Check local readiness:3334 ```bash35 bash <skill-path>/scripts/moloco_ads.sh check36 ```37382. Select the smallest command matching the request. Use `list-actions` and `describe` when routing is unclear.393. Collect required IDs and use API field names from the official documentation. Do not translate dashboard labels into guessed enum values.404. Execute reads directly. For entity writes, show the preview, obtain confirmation, and rerun with `--execute`.415. Return a concise summary and the saved output path. Do not paste large reports or logs unless requested.4243## Analytics4445Use Analytics for synchronous, filtered data. `analytics-detail` is capped at 10,000 rows and all supported Analytics date ranges are limited to 184 inclusive days.4647```bash48bash <skill-path>/scripts/moloco_ads.sh analytics-detail \49 --ad-account-id ad_account_123 \50 --from 2026-08-01 \51 --to 2026-08-07 \52 --dimensions DATE,CAMPAIGN_ID,CAMPAIGN_TITLE \53 --metrics IMPRESSIONS,CLICKS,SPEND54```5556Commands:5758- `analytics-overview`59- `analytics-detail`60- `analytics-skadnetwork`6162Use `--payload-file` for filters, ordering, conversion-event fields, or other documented request fields. Explicit flags override the corresponding fields in the payload file.6364Read [references/reporting.md](references/reporting.md) before selecting dimensions, metrics, filters, or report behavior.6566## Asynchronous reports6768Use Report API for scheduled or large exports. A single report is limited to 31 inclusive days.6970```bash71bash <skill-path>/scripts/moloco_ads.sh report-create \72 --ad-account-id ad_account_123 \73 --from 2026-08-01 \74 --to 2026-08-07 \75 --dimensions DATE,CAMPAIGN,CREATIVE \76 --format csv \77 --wait78```7980Without `--wait`, return the report ID immediately. Continue later with:8182```bash83bash <skill-path>/scripts/moloco_ads.sh report-status --report-id report_12384bash <skill-path>/scripts/moloco_ads.sh report-download --report-id report_123 --format json --wait85```8687## Log data8889Moloco disables Log API by default. Use these commands only after the user confirms Moloco has enabled it for the account:9091```bash92bash <skill-path>/scripts/moloco_ads.sh log-create \93 --ad-account-id ad_account_123 \94 --date 2026-08-09 \95 --type IMP \96 --format CSV97```9899Commands:100101- `log-create`102- `log-status`103- `log-download`104105Read [references/reporting.md](references/reporting.md) for supported log types and formats.106107## Entity reads and writes108109Supported resources:110111- `ad-accounts`112- `products`113- `campaigns`114- `ad-groups`115- `creative-groups`116- `creatives`117- `audience-targets`118- `customer-sets`119- `tracking-links`120121List and read:122123```bash124bash <skill-path>/scripts/moloco_ads.sh list \125 --resource campaigns \126 --ad-account-id ad_account_123 \127 --product-id product_123128129bash <skill-path>/scripts/moloco_ads.sh get \130 --resource campaign \131 --id campaign_123132```133134Preview and execute a write:135136```bash137bash <skill-path>/scripts/moloco_ads.sh update \138 --resource campaign \139 --id campaign_123 \140 --payload-file /secure/path/campaign-update.json141142bash <skill-path>/scripts/moloco_ads.sh update \143 --resource campaign \144 --id campaign_123 \145 --payload-file /secure/path/campaign-update.json \146 --execute147```148149Use `--params-file` for documented query fields not covered by common flags. Read [references/campaign-management.md](references/campaign-management.md) before preparing a write payload.150151## Output and failures152153- Save successful API responses under `./out/` by default; use `--output` to select a file.154- Use `--stdout` only when the user explicitly requests the complete JSON response.155- Report and log downloads are saved directly in their original format.156- Retry safe reads and Analytics requests on `429` and `5xx` with bounded backoff, honoring `Retry-After` or `X-Rate-Limit-Reset` when possible.157- On `401`, refresh the cached access token once. Retry only safe reads; for a write or export-creation request, stop after refreshing and ask the user to rerun it deliberately.158- On `403`, verify the API key's workplace, ad-account role, and requested resource.159- On `429`, report the relevant quota and wait for user direction before creating another report or log.160- Treat Moloco error payloads as authoritative, but redact credentials from all error output.161162For the endpoint map, versioning, quotas, and source links, read [references/api-capabilities.md](references/api-capabilities.md).