# Create a Performance Max asset group

Creates a Performance Max asset group. Works with Google Ads.

```http
POST https://api.pozy.ai/v1/ads/campaigns/{campaignId}/asset-groups
```

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

## Path parameters

- `campaignId` (string, required)

## Request body

Content type: `application/json`

- `name`, string, required: 1 to 128 characters
- `finalUrls`, array of string (URL), required: At least 1 item. Up to 10 items
- `finalMobileUrls`, array of string (URL): At least 1 item. Up to 10 items
- `path1`, string: Up to 15 characters
- `path2`, string: Up to 15 characters
- `status`, string: One of `ENABLED`, `PAUSED`. Default `PAUSED`
- `assets`, array of object: Up to 100 items
  - `fieldType`, string, required
  - `asset`, string
  - `text`, string: Up to 90 characters
  - `imageUrl`, string (URL)
  - `youtubeVideoId`, string: Matches `^[A-Za-z0-9_-]{11}$`
- `listingGroupFilter`, object
  - `children`, array of object: At least 2 items
    - `dimension`, object, required
      - `productBrand`, object
        - `value`, string
      - `productCategory`, object
        - `categoryId`, string
        - `level`, string, required: One of `LEVEL1`, `LEVEL2`, `LEVEL3`, `LEVEL4`, `LEVEL5`
      - `productType`, object
        - `value`, string
        - `level`, string, required: One of `LEVEL1`, `LEVEL2`, `LEVEL3`, `LEVEL4`, `LEVEL5`
      - `productItemId`, object
        - `value`, string
      - `productCondition`, object
        - `condition`, string: One of `NEW`, `REFURBISHED`, `USED`
      - `productChannel`, object
        - `channel`, string: One of `ONLINE`, `LOCAL`
      - `productCustomAttribute`, object
        - `value`, string
        - `index`, string, required: One of `INDEX0`, `INDEX1`, `INDEX2`, `INDEX3`, `INDEX4`
    - `excluded`, boolean
    - `children`, array of object: At least 2 items
- `validateOnly`, boolean: Default `false`

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/ads/campaigns/65a3737dd8b11ea61f199e6e/asset-groups" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Acme",
  "finalUrls": [
    "https://pozy.ai/media/example-1.jpg"
  ]
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/ads/campaigns/65a3737dd8b11ea61f199e6e/asset-groups", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "Acme",
    finalUrls: [
      "https://pozy.ai/media/example-1.jpg"
    ]
  }),
});
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.post(
    "https://api.pozy.ai/v1/ads/campaigns/65a3737dd8b11ea61f199e6e/asset-groups",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "name": "Acme",
        "finalUrls": [
            "https://pozy.ai/media/example-1.jpg",
        ],
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `validateOnly`, boolean
- `message`, string

```json
{
  "validateOnly": true,
  "message": "Hello from Pozy"
}
```
