# Read an ad account's campaigns and ad sets live

Reads an ad account's campaigns and ad sets live. Works with Meta Ads and TikTok Ads.

```http
GET https://api.pozy.ai/v1/ads/accounts/live
```

- Area: Ads / Ad Accounts
- Auth: Authorization: Bearer pz_live_...

## Query parameters

- `accountId` (string, required)
- `adAccountId` (string, required)
- `status` (string)
- `level` (string): one of campaign, adSet
- `limit` (integer)
- `after` (string)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/ads/accounts/live?accountId=696e0b682d0a31188e7a2ba9&adAccountId=666219aad7bab67ace411e4f&limit=200" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/ads/accounts/live?accountId=696e0b682d0a31188e7a2ba9&adAccountId=666219aad7bab67ace411e4f&limit=200", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/ads/accounts/live",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "adAccountId": "666219aad7bab67ace411e4f",
        "limit": 200,
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `accountId`, string
- `adAccountId`, string
- `platform`, string: One of `facebook`, `tiktok`
- `currency`, string
- `readAt`, string (date-time)
- `campaigns`, array of object
  - `platformCampaignId`, string
  - `campaignName`, string: Can be null
  - `platformCampaignStatus`, string: Can be null
  - `configuredStatus`, string: Can be null
  - `status`, string
  - `budget`, object: Can be null
    - `amount`, number
    - `type`, string: One of `daily`, `lifetime`
  - `dailyBudget`, number: Can be null
  - `lifetimeBudget`, number: Can be null
  - `budgetMode`, string: Can be null
  - `budgetRemaining`, number: Can be null
  - `spendCap`, number: Can be null
  - `bidStrategy`, string: Can be null
- `adSets`, array of object
  - `platformAdSetId`, string
  - `adSetName`, string: Can be null
  - `platformCampaignId`, string: Can be null
  - `platformAdSetStatus`, string: Can be null
  - `configuredStatus`, string: Can be null
  - `status`, string
  - `budget`, object: Can be null
    - `amount`, number
    - `type`, string: One of `daily`, `lifetime`
  - `dailyBudget`, number: Can be null
  - `lifetimeBudget`, number: Can be null
  - `budgetMode`, string: Can be null
  - `budgetRemaining`, number: Can be null
  - `bidStrategy`, string: Can be null
  - `bidAmount`, number: Can be null
  - `optimizationGoal`, string: Can be null
  - `billingEvent`, string: Can be null
  - `promotedObject`, object: Can be null
  - `targeting`, object: Can be null
  - `schedule`, object: Can be null
    - `startDate`, string (date-time)
    - `endDate`, string (date-time)
  - `adSchedule`, array of object
    - one of: Meta Ad Schedule
      - `dayOfWeek`, string, required: One of `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`, `SUNDAY`
      - `startHour`, integer, required: 0 to 23
      - `endHour`, integer, required: 1 to 24
      - `timezoneType`, string: One of `USER`, `ADVERTISER`. Default `USER`
- `paging`, object
  - `campaigns`, object
    - `after`, string: Can be null
  - `adSets`, object
    - `after`, string: Can be null

```json
{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "adAccountId": "666219aad7bab67ace411e4f",
  "platform": "facebook",
  "currency": "USD",
  "readAt": "2026-10-02T09:00:00.000Z",
  "campaigns": [
    {
      "platformCampaignId": "68f1e8569b986839e821d8ba",
      "campaignName": "Acme",
      "platformCampaignStatus": "instagram",
      "configuredStatus": "active",
      "status": "active",
      "budget": {
        "amount": 12.5,
        "type": "daily"
      },
      "dailyBudget": 12.5,
      "lifetimeBudget": 12.5,
      "budgetMode": "string",
      "budgetRemaining": 12.5,
      "spendCap": 12.5,
      "bidStrategy": "string"
    }
  ],
  "adSets": [
    {
      "platformAdSetId": "6749c05fd96acf71ce38cbc7",
      "adSetName": "Acme",
      "platformCampaignId": "68f1e8569b986839e821d8ba",
      "platformAdSetStatus": "instagram",
      "configuredStatus": "active",
      "status": "active",
      "budget": {
        "amount": 12.5,
        "type": "daily"
      },
      "dailyBudget": 12.5,
      "lifetimeBudget": 12.5,
      "budgetMode": "string",
      "budgetRemaining": 12.5,
      "bidStrategy": "string",
      "bidAmount": 12.5,
      "optimizationGoal": "string",
      "billingEvent": "string",
      "promotedObject": {},
      "targeting": {},
      "schedule": {
        "startDate": "2026-10-02T09:00:00.000Z",
        "endDate": "2026-10-02T09:00:00.000Z"
      },
      "adSchedule": [
        {
          "dayOfWeek": "MONDAY",
          "startHour": 1,
          "endHour": 1,
          "timezoneType": "USER"
        }
      ]
    }
  ],
  "paging": {
    "campaigns": {
      "after": "string"
    },
    "adSets": {
      "after": "string"
    }
  }
}
```
