Create a Promoted Pin
Create a Pinterest Pin and promote it in one POST /v1/ads/create call, with country, region, age, language and interest targeting.
Pinterest creates the Pin and promotes it in the same call, so headline, body, imageUrl and linkUrl are all required.
boardId chooses the board. Without it, the Pin lands on a Zernio Ads board that Zernio creates once.
startDate and endDate set the run window at the top level of the body. The boost below takes a schedule object instead.
Omit them and the Promoted Pin runs until you pause it.
Campaign Budget Optimization. An ad account that requires it needs endDate with a lifetime budget. Without one, it returns a 400 naming endDate.
import Zernio from '@zernio/node';
const zernio = new Zernio();
const { data: created } = await zernio.adcampaigns.createStandaloneAd({
body: {
accountId: '66b2e19d8c3f5a7e9d0b1c2d',
adAccountId: '549123456789',
name: 'Spring home decor',
goal: 'traffic',
budgetAmount: 30,
budgetType: 'daily',
headline: 'Freshen up your space',
body: 'Spring drops, limited time.',
imageUrl: 'https://cdn.example.com/spring-decor.jpg',
linkUrl: 'https://example.com/spring-decor',
countries: ['US', 'CA'],
ageMin: 25,
ageMax: 44
}
});
console.log(created.ad.platformAdSetId);Response (201):
{
"ad": {
"_id": "66f0a1b2c3d4e5f6a7b8c9d0",
"name": "Spring home decor",
"platform": "pinterest",
"status": "pending_review",
"adType": "standalone",
"goal": "traffic",
"budget": { "amount": 30, "type": "daily" },
"platformAdId": "687195120340",
"platformCampaignId": "626746010001",
"platformAdSetId": "2680069880002"
},
"message": "Ad created"
}budgetAmount is in whole currency units of the ad account, so 30 is $30.00 on a USD account.
Every sample below reuses the zernio and client constructors from this one.
Targeting fields
These fields apply on Pinterest:
countries,regions,metros,zipsageMin,ageMax,genderlanguages(ISO 639-1). A code Pinterest cannot target returns400.interests, fromGET /v1/ads/interestsaudienceIncludeandaudienceExclude, which take the Pinterest customer list id of an audience
Pinterest's geo spec takes region codes or postal codes but never both. Sending regions and zips together returns a 400 with code mutually_exclusive_fields.
incomeTier is rejected on Pinterest. cities, customLocations and behaviors are Meta and TikTok only.