> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# Create a Promoted Pin

Create a Pinterest Pin and promote it in one POST /v1/ads/create call, with its board, budget and run window.

Create a Pin and promote it in one `POST /v1/ads/create` call. To promote a Pin you already published, see [Promote a post](/platforms/pinterest-ads/boost).

## Create a campaign

Pinterest creates the Pin and promotes it in the same call, so `headline`, `imageUrl` and `linkUrl` are required. `body` is optional, up to 500 characters.

`boardId` chooses the board. Without it, the Pin lands on a `Zernio Ads` board that Zernio creates once.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
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);
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

created = client.ad_campaigns.create_standalone_ad(
    account_id="66b2e19d8c3f5a7e9d0b1c2d",
    ad_account_id="549123456789",
    name="Spring home decor",
    goal="traffic",
    budget_amount=30,
    budget_type="daily",
    headline="Freshen up your space",
    body="Spring drops, limited time.",
    image_url="https://cdn.example.com/spring-decor.jpg",
    link_url="https://example.com/spring-decor",
    countries=["US", "CA"],
    age_min=25,
    age_max=44,
)

print(created["ad"]["platformAdSetId"])
```
</Tab>
<Tab value="curl">
```bash
curl -X POST "https://zernio.com/api/v1/ads/create" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "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
  }'
```
</Tab>
</Tabs>

Response (`201`):

```json
{
  "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. The minimum is $5.

Every sample in this folder reuses the `zernio` and `client` constructors from this one. The targeting fields are listed in [Targeting fields](/platforms/pinterest-ads/targeting).

## Run window

`startDate` and `endDate` set the run window at the top level of the body. 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`.

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `400` with code `missing_required_field` | One of `headline`, `imageUrl`, `linkUrl` or `goal` is absent | Send all four; Pinterest builds the Pin from them. |
| `400` with code `invalid_field_value` | A `goal` outside the 4 Pinterest values, or a headline over 100 or a body over 500 characters | Use a supported goal and trim the copy. |
| `400` naming `endDate` | The ad account requires Campaign Budget Optimization | Send `endDate` with a `lifetime` budget. |
| `403` with code `ads_allowance_exceeded` | The team has no payment method on file and has reached 500 live ads | Add a card to resume creating ads. |
| `502` with code `platform_api_error` | Pinterest rejected the request | Read `platformError` for Pinterest's own payload. |

## Related

- [Promote a post](/platforms/pinterest-ads/boost): promote a Pin that is already live.
- [Targeting fields](/platforms/pinterest-ads/targeting): every targeting field the create takes.
- [Media & Limits](/platforms/pinterest-ads/reference): image and video requirements.
- [Create standalone ad](/ad-campaigns/create-standalone-ad): every field of the request.