curl --request GET \
--url https://api.aisa.one/apis/v1/ads/tree \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/tree"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/ads/tree', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/ads/tree",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/ads/tree"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/ads/tree")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/tree")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"backfillPending": true,
"campaigns": [
{
"adCount": 123,
"adSetCount": 123,
"adSets": [
{}
],
"advertisingChannelType": "<string>",
"bidAmount": 123,
"bidStrategy": "LOWEST_COST_WITHOUT_CAP",
"budget": {
"amount": 123,
"type": "daily"
},
"budgetLevel": "campaign",
"campaignBudget": {
"amount": 123,
"type": "daily"
},
"campaignIssuesInfo": [
{}
],
"campaignName": "<string>",
"connectionId": "<string>",
"createdTime": "2023-11-07T05:31:56Z",
"currency": "<string>",
"daily": [
{}
],
"isBudgetScheduleEnabled": false,
"isSmartPlus": true,
"metrics": {
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerAction": {},
"costPerConversion": 123,
"costPerThruplay": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"engagement": 123,
"engagementBreakdown": {},
"funnel": {},
"impressions": 123,
"inlineLinkClickCtr": 123,
"inlineLinkClicks": 123,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"outboundClicks": 123,
"outboundClicksCtr": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123,
"uniqueClicks": 123,
"uniqueCtr": 123,
"video2SecWatchedActions": 123,
"video30SecWatchedActions": 123,
"video6SecFocusedViews": 123,
"video6SecWatchedActions": 123,
"videoAvgTimeWatchedActions": 123,
"videoP100WatchedActions": 123,
"videoP25WatchedActions": 123,
"videoP50WatchedActions": 123,
"videoP75WatchedActions": 123,
"videoP95WatchedActions": 123,
"videoPlayActions": 123,
"videoThruplayWatchedActions": 123
},
"optimizationGoal": "<string>",
"platform": "facebook",
"platformAdAccountId": "<string>",
"platformAdAccountName": "<string>",
"platformCampaignId": "<string>",
"platformCampaignStatus": "<string>",
"platformObjective": "<string>",
"previousMetrics": {
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerAction": {},
"costPerConversion": 123,
"costPerThruplay": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"engagement": 123,
"engagementBreakdown": {},
"funnel": {},
"impressions": 123,
"inlineLinkClickCtr": 123,
"inlineLinkClicks": 123,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"outboundClicks": 123,
"outboundClicksCtr": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123,
"uniqueClicks": 123,
"uniqueCtr": 123,
"video2SecWatchedActions": 123,
"video30SecWatchedActions": 123,
"video6SecFocusedViews": 123,
"video6SecWatchedActions": 123,
"videoAvgTimeWatchedActions": 123,
"videoP100WatchedActions": 123,
"videoP25WatchedActions": 123,
"videoP50WatchedActions": 123,
"videoP75WatchedActions": 123,
"videoP95WatchedActions": 123,
"videoPlayActions": 123,
"videoThruplayWatchedActions": 123
},
"promotedObject": {
"custom_event_type": "<string>",
"page_id": "<string>",
"pixel_id": "<string>"
},
"results": {},
"reviewStatus": "in_review",
"roasAverageFloor": 123,
"status": "active"
}
],
"pagination": {
"limit": 123,
"page": 123,
"pages": 123,
"total": 123
},
"previousRange": {
"fromDate": "2023-12-25",
"toDate": "2023-12-25"
},
"syncedAt": "2023-11-07T05:31:56Z"
}{
"backfillPending": true,
"campaigns": [
{
"adCount": 123,
"adSetCount": 123,
"adSets": [
{}
],
"advertisingChannelType": "<string>",
"bidAmount": 123,
"bidStrategy": "LOWEST_COST_WITHOUT_CAP",
"budget": {
"amount": 123,
"type": "daily"
},
"budgetLevel": "campaign",
"campaignBudget": {
"amount": 123,
"type": "daily"
},
"campaignIssuesInfo": [
{}
],
"campaignName": "<string>",
"connectionId": "<string>",
"createdTime": "2023-11-07T05:31:56Z",
"currency": "<string>",
"daily": [
{}
],
"isBudgetScheduleEnabled": false,
"isSmartPlus": true,
"metrics": {
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerAction": {},
"costPerConversion": 123,
"costPerThruplay": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"engagement": 123,
"engagementBreakdown": {},
"funnel": {},
"impressions": 123,
"inlineLinkClickCtr": 123,
"inlineLinkClicks": 123,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"outboundClicks": 123,
"outboundClicksCtr": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123,
"uniqueClicks": 123,
"uniqueCtr": 123,
"video2SecWatchedActions": 123,
"video30SecWatchedActions": 123,
"video6SecFocusedViews": 123,
"video6SecWatchedActions": 123,
"videoAvgTimeWatchedActions": 123,
"videoP100WatchedActions": 123,
"videoP25WatchedActions": 123,
"videoP50WatchedActions": 123,
"videoP75WatchedActions": 123,
"videoP95WatchedActions": 123,
"videoPlayActions": 123,
"videoThruplayWatchedActions": 123
},
"optimizationGoal": "<string>",
"platform": "facebook",
"platformAdAccountId": "<string>",
"platformAdAccountName": "<string>",
"platformCampaignId": "<string>",
"platformCampaignStatus": "<string>",
"platformObjective": "<string>",
"previousMetrics": {
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerAction": {},
"costPerConversion": 123,
"costPerThruplay": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"engagement": 123,
"engagementBreakdown": {},
"funnel": {},
"impressions": 123,
"inlineLinkClickCtr": 123,
"inlineLinkClicks": 123,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"outboundClicks": 123,
"outboundClicksCtr": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123,
"uniqueClicks": 123,
"uniqueCtr": 123,
"video2SecWatchedActions": 123,
"video30SecWatchedActions": 123,
"video6SecFocusedViews": 123,
"video6SecWatchedActions": 123,
"videoAvgTimeWatchedActions": 123,
"videoP100WatchedActions": 123,
"videoP25WatchedActions": 123,
"videoP50WatchedActions": 123,
"videoP75WatchedActions": 123,
"videoP95WatchedActions": 123,
"videoPlayActions": 123,
"videoThruplayWatchedActions": 123
},
"promotedObject": {
"custom_event_type": "<string>",
"page_id": "<string>",
"pixel_id": "<string>"
},
"results": {},
"reviewStatus": "in_review",
"roasAverageFloor": 123,
"status": "active"
}
],
"pagination": {
"limit": 123,
"page": 123,
"pages": 123,
"total": 123
},
"previousRange": {
"fromDate": "2023-12-25",
"toDate": "2023-12-25"
},
"syncedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Get campaign tree
Ad Campaigns. Read only. Shows your campaigns with their ad sets and ads nested inside, with spend and results rolled up at every level. ### How it aggregates Uses a two-stage aggregation: ads are grouped into ad sets, then ad sets into campaigns. Metrics are computed over an optional date range, then rolled up from ad level to ad set and campaign levels. Pagination is at the campaign level.
curl --request GET \
--url https://api.aisa.one/apis/v1/ads/tree \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/ads/tree"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/ads/tree', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/ads/tree",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/ads/tree"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/ads/tree")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/tree")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"backfillPending": true,
"campaigns": [
{
"adCount": 123,
"adSetCount": 123,
"adSets": [
{}
],
"advertisingChannelType": "<string>",
"bidAmount": 123,
"bidStrategy": "LOWEST_COST_WITHOUT_CAP",
"budget": {
"amount": 123,
"type": "daily"
},
"budgetLevel": "campaign",
"campaignBudget": {
"amount": 123,
"type": "daily"
},
"campaignIssuesInfo": [
{}
],
"campaignName": "<string>",
"connectionId": "<string>",
"createdTime": "2023-11-07T05:31:56Z",
"currency": "<string>",
"daily": [
{}
],
"isBudgetScheduleEnabled": false,
"isSmartPlus": true,
"metrics": {
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerAction": {},
"costPerConversion": 123,
"costPerThruplay": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"engagement": 123,
"engagementBreakdown": {},
"funnel": {},
"impressions": 123,
"inlineLinkClickCtr": 123,
"inlineLinkClicks": 123,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"outboundClicks": 123,
"outboundClicksCtr": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123,
"uniqueClicks": 123,
"uniqueCtr": 123,
"video2SecWatchedActions": 123,
"video30SecWatchedActions": 123,
"video6SecFocusedViews": 123,
"video6SecWatchedActions": 123,
"videoAvgTimeWatchedActions": 123,
"videoP100WatchedActions": 123,
"videoP25WatchedActions": 123,
"videoP50WatchedActions": 123,
"videoP75WatchedActions": 123,
"videoP95WatchedActions": 123,
"videoPlayActions": 123,
"videoThruplayWatchedActions": 123
},
"optimizationGoal": "<string>",
"platform": "facebook",
"platformAdAccountId": "<string>",
"platformAdAccountName": "<string>",
"platformCampaignId": "<string>",
"platformCampaignStatus": "<string>",
"platformObjective": "<string>",
"previousMetrics": {
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerAction": {},
"costPerConversion": 123,
"costPerThruplay": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"engagement": 123,
"engagementBreakdown": {},
"funnel": {},
"impressions": 123,
"inlineLinkClickCtr": 123,
"inlineLinkClicks": 123,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"outboundClicks": 123,
"outboundClicksCtr": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123,
"uniqueClicks": 123,
"uniqueCtr": 123,
"video2SecWatchedActions": 123,
"video30SecWatchedActions": 123,
"video6SecFocusedViews": 123,
"video6SecWatchedActions": 123,
"videoAvgTimeWatchedActions": 123,
"videoP100WatchedActions": 123,
"videoP25WatchedActions": 123,
"videoP50WatchedActions": 123,
"videoP75WatchedActions": 123,
"videoP95WatchedActions": 123,
"videoPlayActions": 123,
"videoThruplayWatchedActions": 123
},
"promotedObject": {
"custom_event_type": "<string>",
"page_id": "<string>",
"pixel_id": "<string>"
},
"results": {},
"reviewStatus": "in_review",
"roasAverageFloor": 123,
"status": "active"
}
],
"pagination": {
"limit": 123,
"page": 123,
"pages": 123,
"total": 123
},
"previousRange": {
"fromDate": "2023-12-25",
"toDate": "2023-12-25"
},
"syncedAt": "2023-11-07T05:31:56Z"
}{
"backfillPending": true,
"campaigns": [
{
"adCount": 123,
"adSetCount": 123,
"adSets": [
{}
],
"advertisingChannelType": "<string>",
"bidAmount": 123,
"bidStrategy": "LOWEST_COST_WITHOUT_CAP",
"budget": {
"amount": 123,
"type": "daily"
},
"budgetLevel": "campaign",
"campaignBudget": {
"amount": 123,
"type": "daily"
},
"campaignIssuesInfo": [
{}
],
"campaignName": "<string>",
"connectionId": "<string>",
"createdTime": "2023-11-07T05:31:56Z",
"currency": "<string>",
"daily": [
{}
],
"isBudgetScheduleEnabled": false,
"isSmartPlus": true,
"metrics": {
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerAction": {},
"costPerConversion": 123,
"costPerThruplay": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"engagement": 123,
"engagementBreakdown": {},
"funnel": {},
"impressions": 123,
"inlineLinkClickCtr": 123,
"inlineLinkClicks": 123,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"outboundClicks": 123,
"outboundClicksCtr": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123,
"uniqueClicks": 123,
"uniqueCtr": 123,
"video2SecWatchedActions": 123,
"video30SecWatchedActions": 123,
"video6SecFocusedViews": 123,
"video6SecWatchedActions": 123,
"videoAvgTimeWatchedActions": 123,
"videoP100WatchedActions": 123,
"videoP25WatchedActions": 123,
"videoP50WatchedActions": 123,
"videoP75WatchedActions": 123,
"videoP95WatchedActions": 123,
"videoPlayActions": 123,
"videoThruplayWatchedActions": 123
},
"optimizationGoal": "<string>",
"platform": "facebook",
"platformAdAccountId": "<string>",
"platformAdAccountName": "<string>",
"platformCampaignId": "<string>",
"platformCampaignStatus": "<string>",
"platformObjective": "<string>",
"previousMetrics": {
"actionValues": {},
"actions": {},
"allConversions": 123,
"clicks": 123,
"conversions": 123,
"costPerAction": {},
"costPerConversion": 123,
"costPerThruplay": 123,
"cpc": 123,
"cpm": 123,
"ctr": 123,
"engagement": 123,
"engagementBreakdown": {},
"funnel": {},
"impressions": 123,
"inlineLinkClickCtr": 123,
"inlineLinkClicks": 123,
"lastSyncedAt": "2023-11-07T05:31:56Z",
"outboundClicks": 123,
"outboundClicksCtr": 123,
"purchaseValue": 123,
"reach": 123,
"roas": 123,
"spend": 123,
"uniqueClicks": 123,
"uniqueCtr": 123,
"video2SecWatchedActions": 123,
"video30SecWatchedActions": 123,
"video6SecFocusedViews": 123,
"video6SecWatchedActions": 123,
"videoAvgTimeWatchedActions": 123,
"videoP100WatchedActions": 123,
"videoP25WatchedActions": 123,
"videoP50WatchedActions": 123,
"videoP75WatchedActions": 123,
"videoP95WatchedActions": 123,
"videoPlayActions": 123,
"videoThruplayWatchedActions": 123
},
"promotedObject": {
"custom_event_type": "<string>",
"page_id": "<string>",
"pixel_id": "<string>"
},
"results": {},
"reviewStatus": "in_review",
"roasAverageFloor": 123,
"status": "active"
}
],
"pagination": {
"limit": 123,
"page": 123,
"pages": 123,
"total": 123
},
"previousRange": {
"fromDate": "2023-12-25",
"toDate": "2023-12-25"
},
"syncedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: GET /apis/v1/ads/tree
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/ads/tree - connectionId: query; required
- page: query; optional
- limit: query; optional
- source: query; optional
- platform: query; optional
- status: query; optional
- adAccountId: query; optional
- pageId: query; optional
- campaignId: query; optional
- updatedSince: query; optional
- search: query; optional
- fromDate: query; optional
- toDate: query; optional
- hasDelivery: query; optional
- minSpend: query; optional
- sort: query; optional
- timeIncrement: query; optional
- dailyLevel: query; optional
- compare: query; optional
- results: query; optional
{
"operationId": "get_aisa_ads_apis_v1_ads_tree",
"method": "GET",
"path": "/apis/v1/ads/tree",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "The ads connection (adc_...) the request runs on: one of yours, from GET /apis/v1/ads/connections. On a request with a JSON body it may be sent as a top-level body member instead.",
"in": "query",
"name": "connectionId",
"required": true,
"schema": {
"pattern": "^adc_[0-9A-Za-z]+$",
"type": "string"
}
},
{
"description": "Page number (1-based)",
"in": "query",
"name": "page",
"required": false,
"schema": {
"default": 1,
"minimum": 1,
"type": "integer"
}
},
{
"description": "Campaigns per page",
"in": "query",
"name": "limit",
"required": false,
"schema": {
"default": 20,
"maximum": 100,
"minimum": 1,
"type": "integer"
}
},
{
"description": "Matches the web UI's default view. Status is NOT filtered by default; use the `status` param for that.",
"in": "query",
"name": "source",
"required": false,
"schema": {
"default": "all",
"enum": [
"aisa",
"all"
],
"type": "string"
}
},
{
"in": "query",
"name": "platform",
"required": false,
"schema": {
"enum": [
"facebook",
"instagram",
"tiktok",
"linkedin",
"pinterest",
"google",
"twitter",
"openai",
"reddit",
"microsoft",
"meta",
"x"
],
"type": "string"
}
},
{
"description": "Filter by derived campaign status (post-aggregation)",
"in": "query",
"name": "status",
"required": false,
"schema": {
"enum": [
"active",
"paused",
"pending_review",
"rejected",
"completed",
"cancelled",
"error"
],
"type": "string"
}
},
{
"description": "Comma-separate for multiple (`?adAccountId=act_1,act_2,act_3`); a single value keeps its old shape. Max 50 accounts per request.",
"in": "query",
"name": "adAccountId",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Meta only: Facebook Page ID. Prunes the tree to ads whose creative is backed by this Page: campaigns and ad sets with no ad on the Page drop out, and rolled-up metrics cover only the Page's ads.",
"in": "query",
"name": "pageId",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Restrict the tree to one or more campaigns by platform campaign id (the id the platform assigns, e.g. Meta's numeric campaign id). Comma-separate up to 100 ids (`?campaignId=123,456`). Must be yours: it is checked through the connection before the request is sent, and an id that is not yours answers not_found.",
"in": "query",
"name": "campaignId",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Returns only campaigns with a change stored since this time (ISO 8601 with offset, e.g. `2026-09-30T10:00:00Z`). Each matching campaign comes back whole (every ad set and ad).",
"in": "query",
"name": "updatedSince",
"required": false,
"schema": {
"format": "date-time",
"type": "string"
}
},
{
"description": "Case-insensitive substring match on campaign, ad set and ad names (`_`, `%` and spaces match literally), or an exact platform campaign, ad set or ad id. A campaign whose name matches returns with all its ad sets and ads.",
"in": "query",
"name": "search",
"required": false,
"schema": {
"maxLength": 500,
"type": "string"
}
},
{
"description": "Start of the METRICS date range (YYYY-MM-DD). On its own it affects only the spend/impression numbers overlaid on each node, not which campaigns are returned. Pass `hasDelivery` or `minSpend` to also filter the campaign set to this window.",
"in": "query",
"name": "fromDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "End of metrics date range (YYYY-MM-DD). Defaults to today. Max 730-day range.",
"in": "query",
"name": "toDate",
"required": false,
"schema": {
"format": "date",
"type": "string"
}
},
{
"description": "Return only campaigns that delivered between `fromDate` and `toDate`: spend above zero, or impressions served at zero spend.",
"in": "query",
"name": "hasDelivery",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"description": "Return only campaigns whose spend between `fromDate` and `toDate` reaches this amount.",
"in": "query",
"name": "minSpend",
"required": false,
"schema": {
"minimum": 0,
"type": "number"
}
},
{
"description": "Campaign-level sort order. `newest` (default) / `oldest` order by the campaign's newest-ad createdAt. `spend_desc` / `spend_asc` order by aggregated spend in the requested date range; campaigns with no spend land at the end.",
"in": "query",
"name": "sort",
"required": false,
"schema": {
"default": "newest",
"enum": [
"newest",
"oldest",
"spend_desc",
"spend_asc"
],
"type": "string"
}
},
{
"description": "Set to `1` to also return a daily breakdown (mirrors Meta Insights' `time_increment=1`). Only `1` (daily) is supported. See `dailyLevel` to control which levels carry it.",
"in": "query",
"name": "timeIncrement",
"required": false,
"schema": {
"enum": [
1
],
"type": "integer"
}
},
{
"description": "Which tree levels get the `daily[]` series when `timeIncrement=1`. Ignored when `timeIncrement` is unset. `campaign` (default): on campaign nodes only. The common per-campaign-trend case, and the smallest payload. `adset`: on ad sets too.",
"in": "query",
"name": "dailyLevel",
"required": false,
"schema": {
"default": "campaign",
"enum": [
"campaign",
"adset",
"ad"
],
"type": "string"
}
},
{
"description": "Set to `previous` to also read the period of the same length that ends the day before `fromDate`.",
"in": "query",
"name": "compare",
"required": false,
"schema": {
"enum": [
"previous"
],
"type": "string"
}
},
{
"description": "Set to `true` to add your own results (see Campaign results): every campaign gains `results`, the values you sent for the range plus each formula they allow, and the response gains `resultMetrics` to label them.",
"in": "query",
"name": "results",
"required": false,
"schema": {
"type": "boolean"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
No additional charge for this operation. Ad spend is billed separately by the ad platform to your connected ad account.Authorizations
Query Parameters
Restrict the tree to one or more campaigns by platform campaign id (the id the platform assigns, e.g. Meta's numeric campaign id). Comma-separate up to 100 ids (?campaignId=123,456). Must be yours: it is checked through the connection before the request is sent, and an id that is not yours answers not_found.
Campaign-level sort order. newest (default) / oldest order by the campaign's newest-ad createdAt. spend_desc / spend_asc order by aggregated spend in the requested date range; campaigns with no spend land at the end.
newest, oldest, spend_desc, spend_asc Which tree levels get the daily[] series when timeIncrement=1. Ignored when timeIncrement is unset. campaign (default): on campaign nodes only. The common per-campaign-trend case, and the smallest payload. adset: on ad sets too.
campaign, adset, ad Response
Nested campaign tree with pagination