Ads · Ad Campaigns
Creates a Performance Max asset group. Works with Google Ads.
https://api.pozy.ai/v1/ads/campaigns/{campaignId}/asset-groupsGuide: Google Ads
Request
Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the ads resource group disabled get 403 resource_group_disabled. Authentication
Path parameters
| Name | Type | Notes |
|---|---|---|
campaignIdrequired | string | Matches ^\d+$ |
Request body
application/json, required
namestringrequired1 to 128 characters.
finalUrlsarray of string (URL)requiredAt least 1 item. Up to 10 items.
finalMobileUrlsarray of string (URL)At least 1 item. Up to 10 items.
path1stringUp to 15 characters.
path2stringUp to 15 characters.
statusstringOne of
ENABLED,PAUSED. DefaultPAUSED.assetsarray of objectUp to 100 items.
fieldTypestringrequiredassetstringtextstringUp to 90 characters.
imageUrlstring (URL)youtubeVideoIdstringMatches
^[A-Za-z0-9_-]{11}$.
listingGroupFilterobjectchildrenarray of objectAt least 2 items.
3 child fields
dimensionobjectrequired7 child fields
productBrandobject1 child field
valuestring
productCategoryobject2 child fields
categoryIdstringlevelstringrequiredOne of
LEVEL1,LEVEL2,LEVEL3,LEVEL4,LEVEL5.
productTypeobject2 child fields
valuestringlevelstringrequiredOne of
LEVEL1,LEVEL2,LEVEL3,LEVEL4,LEVEL5.
productItemIdobject1 child field
valuestring
productConditionobject1 child field
conditionstringOne of
NEW,REFURBISHED,USED.
productChannelobject1 child field
channelstringOne of
ONLINE,LOCAL.
productCustomAttributeobject2 child fields
valuestringindexstringrequiredOne of
INDEX0,INDEX1,INDEX2,INDEX3,INDEX4.
excludedbooleanchildrenarray of objectAt least 2 items.
validateOnlybooleanDefault
false.
Example
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"
]
}'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);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 on success
validateOnlybooleanmessagestring
{
"validateOnly": true,
"message": "Hello from Pozy"
}Errors
Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:
| 400 | invalid_request_error | A parameter or body field is missing or invalid. param names it. |
| 401 | authentication_error | The API key is missing, revoked or expired. |
| 403 | permission_error | The key is read-only, scoped to other profiles, or has this resource group disabled. |
| 404 | not_found | Nothing with that id exists in your workspace. |
| 429 | rate_limit_error | Too many requests this minute. Wait for Retry-After seconds. |
Every code is listed in Errors.