# List ad sets

Returns ad sets, one page at a time.

```http
GET https://api.pozy.ai/v1/ads/ad-sets
```

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

## Query parameters

- `accountId` (string)
- `adAccountId` (string)
- `campaignId` (string)
- `adSetId` (string)
- `platform` (string): one of facebook, instagram, tiktok, linkedin, pinterest, google, twitter, openai, reddit
- `status` (string)
- `page` (integer)
- `limit` (integer)
- `live` (boolean)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/ads/ad-sets?limit=500" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/ads/ad-sets?limit=500", {
  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/ad-sets",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "limit": 500,
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `adSets`, array of object
  - `platformAdSetId`, string
  - `platform`, string
  - `adSetName`, string: Can be null
  - `status`, string: Can be null
  - `platformAdSetStatus`, string: Can be null
  - `platformCampaignId`, string: Can be null
  - `platformAdAccountId`, string
  - `accountId`, string: Can be null
  - `profileId`, string
  - `currency`, string: Can be null
  - `budget`, object: Can be null
    - `amount`, number
    - `type`, string: One of `daily`, `lifetime`
    - `daily`, number
    - `lifetime`, number
    - `pacing`, string
  - `schedule`, object: Can be null
    - `startDate`, string (date-time)
    - `endDate`, string (date-time)
  - `targeting`, object: Can be null
    - `include`, object
    - `exclude`, object
    - `audienceExpansionEnabled`, boolean
    - `offsiteDeliveryEnabled`, boolean
  - `isExternal`, boolean: Can be null
  - `platformCreatedAt`, string (date-time): Can be null
  - `statusReadAt`, string (date-time): Can be null
  - `optimizationGoal`, string: Can be null
  - `billingEvent`, string: Can be null
  - `bidStrategy`, string: Can be null
  - `bidAmount`, number: Can be null
  - `promotedObject`, object: Can be null
  - `nativeSettings`, object
  - `configReadAt`, string (date-time): Can be null
- `pagination`, object
  - `page`, integer
  - `limit`, integer
  - `total`, integer
  - `pages`, integer

```json
{
  "adSets": [
    {
      "platformAdSetId": "6749c05fd96acf71ce38cbc7",
      "platform": "instagram",
      "adSetName": "Acme",
      "status": "active",
      "platformAdSetStatus": "instagram",
      "platformCampaignId": "68f1e8569b986839e821d8ba",
      "platformAdAccountId": "673c621a82c88059710de3fd",
      "accountId": "696e0b682d0a31188e7a2ba9",
      "profileId": "6a0b6573846efc28aaa9a3ff",
      "currency": "USD",
      "budget": {
        "amount": 12.5,
        "type": "daily",
        "daily": 12.5,
        "lifetime": 12.5,
        "pacing": "string"
      },
      "schedule": {
        "startDate": "2026-10-02T09:00:00.000Z",
        "endDate": "2026-10-02T09:00:00.000Z"
      },
      "targeting": {
        "include": {},
        "exclude": {},
        "audienceExpansionEnabled": true,
        "offsiteDeliveryEnabled": true
      },
      "isExternal": true,
      "platformCreatedAt": "2026-10-02T09:00:00.000Z",
      "statusReadAt": "2026-10-02T09:00:00.000Z",
      "optimizationGoal": "string",
      "billingEvent": "string",
      "bidStrategy": "string",
      "bidAmount": 12.5,
      "promotedObject": {},
      "nativeSettings": {},
      "configReadAt": "2026-10-02T09:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 1,
    "total": 42,
    "pages": 1
  }
}
```
