List Campaigns
list_campaignsRetrieve campaign totals and channel mappings for a specific model, including unmapped campaigns. Use to audit which campaigns count toward each channel.
Instructions
List the campaigns in the campaign facts, each with its totals and the model channel it counts towards for this model.
The channel is DECLARED in the model's campaign map (set_campaign_mapping), never inferred:
a campaign no map row covers is status: "unmapped" with channel: null, is listed with its
spend, and is not counted towards any channel. suggested_channel is a hint from the
platform's own label and the campaign's name (null when nothing is clear); it does nothing
until it is written into the map.
Returns {campaigns: [{platform, account_id, campaign_id, campaign_name, adsets, spend,
impressions, clicks, platform_conversions, platform_value, platform_channel_type, first_seen,
last_seen, channel, suggested_channel, status: "mapped" | "unmapped"}], window: {start, end},
currency, as_of, next_cursor (only when limit was given)}. Sorted by platform, account and
campaign id. Totals cover the window (default: every stored day).
Args: model_hash: The model whose map decides each campaign's channel (the hash of a fitted MMM). platform: Keep one platform: meta, google_ads, tiktok or other. unmapped_only: Only campaigns without a channel for this model. start, end: Optional ISO dates (YYYY-MM-DD), inclusive, for the totals. limit: Page size (1-200). Without it every campaign is returned. cursor: The previous page's next_cursor.
Errors carry a code: model_not_found (404). An empty list means no pipeline is registered as the campaign facts source yet, or it has not run; registration happens in the app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ||
| limit | No | ||
| start | No | ||
| cursor | No | ||
| platform | No | ||
| model_hash | Yes | ||
| unmapped_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||