Ads · Messaging Ads
Creates a Click-to-Call ad. Works with Meta Ads.
https://api.pozy.ai/v1/ads/callGuides: Meta Ads, Idempotency and safe retries
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
Headers
| Name | Type | Notes |
|---|---|---|
Idempotency-Key | string | Up to 255 charactersRetries with the same key return the original result. See Idempotency |
Request body
application/json, required
creativeFeaturesmap of stringtrackingobjectpixelIdstringurlTagsarray of object2 child fields
keystringrequiredvaluestringrequired
pozyTagbooleanDefault
false.
accountIdstringrequiredadAccountIdstringrequirednamestringrequiredcampaignNamestringUp to 255 characters.
adSetNamestringUp to 255 characters.
platformPostIdstringexistingPostIdstringdeprecatedobjectStoryIdstringMatches
^\d+_\d+$.pageIdstringwhatsappPhoneNumberstringMatches
^\+[1-9]\d{6,14}$.headlinestring1 to 255 characters.
bodystringdescriptionstring1 to 255 characters.
imageUrlstring (URL)videoobjecturlstring (URL)idstringthumbnailUrlstring (URL)
welcomeMessageobjecttextstringrequiredprefillTextstringquickRepliesarray of objectAt least 1 item. Up to 13 items.
2 child fields
titlestringrequired1 to 20 characters.
payloadstringrequired1 to 1000 characters.
carouselCardsarray of objectAt least 2 items. Up to 10 items.
imageUrlstring (URL)requiredheadlinestringUp to 255 characters.
descriptionstringUp to 255 characters.
callToActionstringlinkUrlstring
optimizeCardOrderbooleancreativesarray of objectAt least 1 item.
10 child fields
platformPostIdstringexistingPostIdstringdeprecatedobjectStoryIdstringMatches
^\d+_\d+$.creativeFeaturesmap of stringheadlinestring1 to 255 characters.
bodystringimageUrlstring (URL)videoobject3 child fields
urlstring (URL)idstringthumbnailUrlstring (URL)
welcomeMessageobject3 child fields
textstringrequiredprefillTextstringquickRepliesarray of objectAt least 1 item. Up to 13 items.
2 child fields
titlestringrequired1 to 20 characters.
payloadstringrequired1 to 1000 characters.
carouselCardsarray of objectAt least 2 items. Up to 10 items.
5 child fields
imageUrlstring (URL)requiredheadlinestringUp to 255 characters.
descriptionstringUp to 255 characters.
callToActionstringlinkUrlstring
adSetIdstringexistingCampaignIdstringMatches
^\d+$.budgetLevelstringOne of
adset,campaign.budgetAmountnumberbudgetTypestringOne of
daily,lifetime.currencystring3 to 3 characters.
startDatestringendDatestringcountriesarray of stringEach item: 2 to 2 characters.
citiesarray of objectkeystringrequiredradiusnumberdistance_unitstringOne of
mile,kilometer.
regionsarray of objectkeystringrequired
zipsarray of objectkeystringrequirednamestring
metrosarray of objectkeystringrequirednamestring
countryGroupsarray of stringEach item: one of
africa,asia,europe,north_america,south_america,oceania,central_america,caribbean,eea,euro_area,nafta,mercosur,afta,apec,gcc,cisfta,emerging_markets,itunes_app_store,android_free_store,android_paid_store.customLocationsarray of objectlatitudenumberrequired-90 to 90.
longitudenumberrequired-180 to 180.
radiusnumberrequireddistanceUnitstringrequiredOne of
mile,kilometer.namestringaddressstring
ageMininteger13 to 65.
ageMaxinteger13 to 65.
interestsarray of objectidstringrequirednamestring
audienceIdstringplacementsobject8 child fields
publisherPlatformsarray of stringEach item: one of
facebook,instagram,threads,messenger,audience_network,whatsapp.facebookPositionsarray of stringEach item: one of
feed,right_hand_column,marketplace,story,search,instream_video,facebook_reels,facebook_reels_overlay,profile_feed,notification.instagramPositionsarray of stringEach item: one of
stream,story,explore,explore_home,reels,profile_feed,ig_search,profile_reels.messengerPositionsarray of stringEach item: one of
messenger_home,sponsored_messages,story.audienceNetworkPositionsarray of stringEach item: one of
classic,rewarded_video.threadsPositionsarray of stringEach item: one of
threads_stream.whatsappPositionsarray of stringEach item: one of
status.devicePlatformsarray of stringEach item: one of
mobile,desktop.
genderstringOne of
all,male,female.languagesarray of stringplacesarray of objectkeystringrequired
neighborhoodsarray of objectkeystringrequired
excludedLocationsobjectbehaviorsarray of objectidstringrequirednamestring
workPositionsarray of objectidstringrequirednamestring
workEmployersarray of objectidstringrequirednamestring
workIndustriesarray of objectidstringrequirednamestring
incomeTierstringOne of
top_5,top_10,top_10_25,top_25_50.userOsarray of stringAt least 1 item.
userDevicearray of stringAt least 1 item.
audienceIncludearray of stringAt least 1 item.
audienceExcludearray of stringAt least 1 item.
savedTargetingIdstringtargetingobject31 child fields
userOsarray of stringAt least 1 item.
userDevicearray of stringAt least 1 item.
countriesarray of stringregionsarray of string or objectOne of:
string
Option 2 (2 fields)
keystringrequirednamestring
citiesarray of string or objectOne of:
string
Option 2 (4 fields)
keystringrequirednamestringradiusnumberdistanceUnitstringOne of
mile,kilometer.
zipsarray of object2 child fields
keystringrequirednamestring
metrosarray of object2 child fields
keystringrequirednamestring
countryGroupsarray of stringEach item: one of
africa,asia,europe,north_america,south_america,oceania,central_america,caribbean,eea,euro_area,nafta,mercosur,afta,apec,gcc,cisfta,emerging_markets,itunes_app_store,android_free_store,android_paid_store.customLocationsarray of object6 child fields
latitudenumberrequired-90 to 90.
longitudenumberrequired-180 to 180.
radiusnumberrequireddistanceUnitstringrequiredOne of
mile,kilometer.namestringaddressstring
excludedLocationsobject8 child fields
countriesarray of stringcountryGroupsarray of stringEach item: one of
africa,asia,europe,north_america,south_america,oceania,central_america,caribbean,eea,euro_area,nafta,mercosur,afta,apec,gcc,cisfta,emerging_markets,itunes_app_store,android_free_store,android_paid_store.regionsarray of object2 child fields
keystringrequirednamestring
citiesarray of object3 child fields
keystringrequiredradiusnumberdistanceUnitstringOne of
mile,kilometer.
zipsarray of object2 child fields
keystringrequirednamestring
placesarray of object1 child field
keystringrequired
neighborhoodsarray of object1 child field
keystringrequired
customLocationsarray of object6 child fields
latitudenumberrequired-90 to 90.
longitudenumberrequired-180 to 180.
radiusnumberrequireddistanceUnitstringrequiredOne of
mile,kilometer.namestringaddressstring
ageMininteger13 to 100.
ageMaxinteger13 to 100.
genderstringOne of
all,male,female.incomeTierstringOne of
top_5,top_10,top_10_25,top_25_50.languagesarray of stringinterestsarray of object2 child fields
idstringrequirednamestring
behaviorsarray of object2 child fields
idstringrequirednamestring
workPositionsarray of object2 child fields
idstringrequirednamestring
workEmployersarray of object2 child fields
idstringrequirednamestring
workIndustriesarray of object2 child fields
idstringrequirednamestring
industriesarray of stringcompanySizesarray of stringsenioritiesarray of stringjobFunctionsarray of stringskillsarray of stringaudienceIncludearray of stringaudienceExcludearray of stringcommunitiesarray of stringexcludedCommunitiesarray of stringconversationKeywordsarray of stringexcludedConversationKeywordsarray of string
rawTargetingobjectspecialAdCategoriesarray of stringEach item: one of
HOUSING,EMPLOYMENT,CREDIT,ISSUES_ELECTIONS_POLITICS,FINANCIAL_PRODUCTS_SERVICES,ONLINE_GAMBLING_AND_GAMING.specialAdCategoryCountryarray of stringadvantageAudienceintegerOne of
0,1.objectivestringOne of
OUTCOME_ENGAGEMENT,OUTCOME_SALES,OUTCOME_LEADS.statusstringOne of
ACTIVE,PAUSED.campaignStatusstringOne of
ACTIVE,PAUSED.adSetStatusstringOne of
ACTIVE,PAUSED.adStatusstringOne of
ACTIVE,PAUSED.bidStrategystringOne of
LOWEST_COST_WITHOUT_CAP,LOWEST_COST_WITH_BID_CAP,COST_CAP,LOWEST_COST_WITH_MIN_ROAS.bidAmountnumberroasAverageFloornumberdsaBeneficiarystringUp to 100 characters.
dsaPayorstringUp to 100 characters.
regionalRegulatedCategoriesarray of stringregionalRegulationIdentitiesmap of string or integerphoneNumberstringrequiredlinkUrlstring (URL)required
Example
curl -X POST "https://api.pozy.ai/v1/ads/call" \
-H "Authorization: Bearer $POZY_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"accountId": "696e0b682d0a31188e7a2ba9",
"adAccountId": "666219aad7bab67ace411e4f",
"name": "Acme",
"phoneNumber": "+14155550123",
"linkUrl": "https://pozy.ai/media/example-1.jpg"
}'import { randomUUID } from "node:crypto";
const res = await fetch("https://api.pozy.ai/v1/ads/call", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POZY_API_KEY}`,
"Idempotency-Key": randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
accountId: "696e0b682d0a31188e7a2ba9",
adAccountId: "666219aad7bab67ace411e4f",
name: "Acme",
phoneNumber: "+14155550123",
linkUrl: "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/call",
headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
json={
"accountId": "696e0b682d0a31188e7a2ba9",
"adAccountId": "666219aad7bab67ace411e4f",
"name": "Acme",
"phoneNumber": "+14155550123",
"linkUrl": "https://pozy.ai/media/example-1.jpg",
},
timeout=30,
)
resp.raise_for_status()
print(resp.json())Response
201 on success
{
"adType": "single",
"ad": {},
"message": "Hello from Pozy",
"warnings": [
"string"
]
}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. |
| 429 | rate_limit_error | Too many requests this minute. Wait for Retry-After seconds. |
Every code is listed in Errors.