Ads · Messaging Ads

Create Click-to-Call ad

Creates a Click-to-Call ad. Works with Meta Ads.

POSThttps://api.pozy.ai/v1/ads/call
Facebook and InstagramcreateCallAd

Guides: 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

NameTypeNotes
Idempotency-KeystringUp to 255 charactersRetries with the same key return the original result. See Idempotency

Request body

application/json, required

  • creativeFeaturesmap of string
  • trackingobject
    • pixelIdstring
    • urlTagsarray of object
      2 child fields
      • keystringrequired
      • valuestringrequired
    • pozyTagboolean

      Default false.

  • accountIdstringrequired
  • adAccountIdstringrequired
  • namestringrequired
  • campaignNamestring

    Up to 255 characters.

  • adSetNamestring

    Up to 255 characters.

  • platformPostIdstring
  • existingPostIdstringdeprecated
  • objectStoryIdstring

    Matches ^\d+_\d+$.

  • pageIdstring
  • whatsappPhoneNumberstring

    Matches ^\+[1-9]\d{6,14}$.

  • headlinestring

    1 to 255 characters.

  • bodystring
  • descriptionstring

    1 to 255 characters.

  • imageUrlstring (URL)
  • videoobject
    • urlstring (URL)
    • idstring
    • thumbnailUrlstring (URL)
  • welcomeMessageobject
    • textstringrequired
    • prefillTextstring
    • quickRepliesarray of object

      At least 1 item. Up to 13 items.

      2 child fields
      • titlestringrequired

        1 to 20 characters.

      • payloadstringrequired

        1 to 1000 characters.

  • carouselCardsarray of object

    At least 2 items. Up to 10 items.

    • imageUrlstring (URL)required
    • headlinestring

      Up to 255 characters.

    • descriptionstring

      Up to 255 characters.

    • callToActionstring
    • linkUrlstring
  • optimizeCardOrderboolean
  • creativesarray of object

    At least 1 item.

    10 child fields
    • platformPostIdstring
    • existingPostIdstringdeprecated
    • objectStoryIdstring

      Matches ^\d+_\d+$.

    • creativeFeaturesmap of string
    • headlinestring

      1 to 255 characters.

    • bodystring
    • imageUrlstring (URL)
    • videoobject
      3 child fields
      • urlstring (URL)
      • idstring
      • thumbnailUrlstring (URL)
    • welcomeMessageobject
      3 child fields
      • textstringrequired
      • prefillTextstring
      • quickRepliesarray of object

        At least 1 item. Up to 13 items.

        2 child fields
        • titlestringrequired

          1 to 20 characters.

        • payloadstringrequired

          1 to 1000 characters.

    • carouselCardsarray of object

      At least 2 items. Up to 10 items.

      5 child fields
      • imageUrlstring (URL)required
      • headlinestring

        Up to 255 characters.

      • descriptionstring

        Up to 255 characters.

      • callToActionstring
      • linkUrlstring
  • adSetIdstring
  • existingCampaignIdstring

    Matches ^\d+$.

  • budgetLevelstring

    One of adset, campaign.

  • budgetAmountnumber
  • budgetTypestring

    One of daily, lifetime.

  • currencystring

    3 to 3 characters.

  • startDatestring
  • endDatestring
  • countriesarray of string

    Each item: 2 to 2 characters.

  • citiesarray of object
    • keystringrequired
    • radiusnumber
    • distance_unitstring

      One of mile, kilometer.

  • regionsarray of object
    • keystringrequired
  • zipsarray of object
    • keystringrequired
    • namestring
  • metrosarray of object
    • keystringrequired
    • namestring
  • countryGroupsarray of string

    Each 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 object
    • latitudenumberrequired

      -90 to 90.

    • longitudenumberrequired

      -180 to 180.

    • radiusnumberrequired
    • distanceUnitstringrequired

      One of mile, kilometer.

    • namestring
    • addressstring
  • ageMininteger

    13 to 65.

  • ageMaxinteger

    13 to 65.

  • interestsarray of object
    • idstringrequired
    • namestring
  • audienceIdstring
  • placementsobject
    8 child fields
    • publisherPlatformsarray of string

      Each item: one of facebook, instagram, threads, messenger, audience_network, whatsapp.

    • facebookPositionsarray of string

      Each item: one of feed, right_hand_column, marketplace, story, search, instream_video, facebook_reels, facebook_reels_overlay, profile_feed, notification.

    • instagramPositionsarray of string

      Each item: one of stream, story, explore, explore_home, reels, profile_feed, ig_search, profile_reels.

    • messengerPositionsarray of string

      Each item: one of messenger_home, sponsored_messages, story.

    • audienceNetworkPositionsarray of string

      Each item: one of classic, rewarded_video.

    • threadsPositionsarray of string

      Each item: one of threads_stream.

    • whatsappPositionsarray of string

      Each item: one of status.

    • devicePlatformsarray of string

      Each item: one of mobile, desktop.

  • genderstring

    One of all, male, female.

  • languagesarray of string
  • placesarray of object
    • keystringrequired
  • neighborhoodsarray of object
    • keystringrequired
  • excludedLocationsobject
  • behaviorsarray of object
    • idstringrequired
    • namestring
  • workPositionsarray of object
    • idstringrequired
    • namestring
  • workEmployersarray of object
    • idstringrequired
    • namestring
  • workIndustriesarray of object
    • idstringrequired
    • namestring
  • incomeTierstring

    One of top_5, top_10, top_10_25, top_25_50.

  • userOsarray of string

    At least 1 item.

  • userDevicearray of string

    At least 1 item.

  • audienceIncludearray of string

    At least 1 item.

  • audienceExcludearray of string

    At least 1 item.

  • savedTargetingIdstring
  • targetingobject
    31 child fields
    • userOsarray of string

      At least 1 item.

    • userDevicearray of string

      At least 1 item.

    • countriesarray of string
    • regionsarray of string or object

      One of:

      string
      Option 2 (2 fields)
      • keystringrequired
      • namestring
    • citiesarray of string or object

      One of:

      string
      Option 2 (4 fields)
      • keystringrequired
      • namestring
      • radiusnumber
      • distanceUnitstring

        One of mile, kilometer.

    • zipsarray of object
      2 child fields
      • keystringrequired
      • namestring
    • metrosarray of object
      2 child fields
      • keystringrequired
      • namestring
    • countryGroupsarray of string

      Each 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 object
      6 child fields
      • latitudenumberrequired

        -90 to 90.

      • longitudenumberrequired

        -180 to 180.

      • radiusnumberrequired
      • distanceUnitstringrequired

        One of mile, kilometer.

      • namestring
      • addressstring
    • excludedLocationsobject
      8 child fields
      • countriesarray of string
      • countryGroupsarray of string

        Each 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 object
        2 child fields
        • keystringrequired
        • namestring
      • citiesarray of object
        3 child fields
        • keystringrequired
        • radiusnumber
        • distanceUnitstring

          One of mile, kilometer.

      • zipsarray of object
        2 child fields
        • keystringrequired
        • namestring
      • placesarray of object
        1 child field
        • keystringrequired
      • neighborhoodsarray of object
        1 child field
        • keystringrequired
      • customLocationsarray of object
        6 child fields
        • latitudenumberrequired

          -90 to 90.

        • longitudenumberrequired

          -180 to 180.

        • radiusnumberrequired
        • distanceUnitstringrequired

          One of mile, kilometer.

        • namestring
        • addressstring
    • ageMininteger

      13 to 100.

    • ageMaxinteger

      13 to 100.

    • genderstring

      One of all, male, female.

    • incomeTierstring

      One of top_5, top_10, top_10_25, top_25_50.

    • languagesarray of string
    • interestsarray of object
      2 child fields
      • idstringrequired
      • namestring
    • behaviorsarray of object
      2 child fields
      • idstringrequired
      • namestring
    • workPositionsarray of object
      2 child fields
      • idstringrequired
      • namestring
    • workEmployersarray of object
      2 child fields
      • idstringrequired
      • namestring
    • workIndustriesarray of object
      2 child fields
      • idstringrequired
      • namestring
    • industriesarray of string
    • companySizesarray of string
    • senioritiesarray of string
    • jobFunctionsarray of string
    • skillsarray of string
    • audienceIncludearray of string
    • audienceExcludearray of string
    • communitiesarray of string
    • excludedCommunitiesarray of string
    • conversationKeywordsarray of string
    • excludedConversationKeywordsarray of string
  • rawTargetingobject
  • specialAdCategoriesarray of string

    Each item: one of HOUSING, EMPLOYMENT, CREDIT, ISSUES_ELECTIONS_POLITICS, FINANCIAL_PRODUCTS_SERVICES, ONLINE_GAMBLING_AND_GAMING.

  • specialAdCategoryCountryarray of string
  • advantageAudienceinteger

    One of 0, 1.

  • objectivestring

    One of OUTCOME_ENGAGEMENT, OUTCOME_SALES, OUTCOME_LEADS.

  • statusstring

    One of ACTIVE, PAUSED.

  • campaignStatusstring

    One of ACTIVE, PAUSED.

  • adSetStatusstring

    One of ACTIVE, PAUSED.

  • adStatusstring

    One of ACTIVE, PAUSED.

  • bidStrategystring

    One of LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS.

  • bidAmountnumber
  • roasAverageFloornumber
  • dsaBeneficiarystring

    Up to 100 characters.

  • dsaPayorstring

    Up to 100 characters.

  • regionalRegulatedCategoriesarray of string
  • regionalRegulationIdentitiesmap of string or integer
  • phoneNumberstringrequired
  • linkUrlstring (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"
}'

Response

201 on success

201 response
{
  "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:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in Messaging Ads