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

# Manage ads

Pause or resume Pinterest campaigns, ad groups and Promoted Pins, change a budget, rename an ad group, and delete or archive.

Change Promoted Pins that already exist: switch delivery on and off, change the budget, rename an ad group, and delete. Targeting and creative cannot change after creation.

## Pause or resume

`PUT /v1/ads/campaigns/{campaignId}/status` switches one campaign's own on/off switch. Its ad groups and Promoted Pins keep their own switches.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: paused } = await zernio.adcampaigns.updateAdCampaignStatus({
  path: { campaignId: '626746010001' },
  body: { status: 'paused', platform: 'pinterest' }
});
```
</Tab>
<Tab value="Python">
```python
paused = client.ad_campaigns.update_ad_campaign_status(
    campaign_id="626746010001",
    status="paused",
    platform="pinterest",
)
```
</Tab>
<Tab value="curl">
```bash
curl -X PUT "https://zernio.com/api/v1/ads/campaigns/626746010001/status" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "paused", "platform": "pinterest" }'
```
</Tab>
</Tabs>

Response (`200`):

```json
{ "status": "paused", "platformCampaignStatus": null, "statusReadAt": null, "updated": 1, "skipped": 0 }
```

Zernio does not read a Pinterest campaign's status back, so `platformCampaignStatus` and `statusReadAt` are always `null`, and the write always goes out.

Resuming a campaign lets each ad group and Promoted Pin deliver again only if its own switch is on. Switch those with `PUT /v1/ads/ad-sets/{adSetId}/status` or `PUT /v1/ads/{adId}/status`, which take the same body.

## Change the budget

`PUT /v1/ads/{adId}` takes `status` and `budget`. The budget is written to the Promoted Pin's ad group.

```bash
curl -X PUT "https://zernio.com/api/v1/ads/66f0a1b2c3d4e5f6a7b8c9d0" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "budget": { "amount": 40, "type": "daily" } }'
```

`amount` is in whole currency units, with a $5 minimum.

`PUT /v1/ads/campaigns/{campaignId}` with `budget` changes the campaign budget only when the campaign uses campaign budget optimization. When its ad groups hold the budgets, the answer is `409` and nothing changes: change each ad group with `PUT /v1/ads/ad-sets/{adSetId}`.

## Rename an ad group

`PUT /v1/ads/ad-sets/{adSetId}` with `name` renames the Pinterest ad group. The new name is stored right away, so `GET /v1/ads/tree` returns it without a sync.

## Preview an ad

`GET /v1/ads/{adId}/preview` renders the Promoted Pin through Pinterest's ad preview API, as one preview with `format: "PIN"`.

`html` is an `<iframe>` to embed and `url` is the preview page it loads. Pinterest expires the page after 7 days, so fetch a new one when needed.

## Delete

| Call | On Pinterest |
|------|--------------|
| `DELETE /v1/ads/{adId}` | Archives the Promoted Pin and marks it cancelled. Zernio keeps it for history. A Pinterest error here is not returned, so check the ad in Pinterest if it matters. |
| `DELETE /v1/ads/ad-sets/{adSetId}` | Archives the ad group, which stays readable for reporting. Its ads are marked cancelled. |
| `DELETE /v1/ads/campaigns/{campaignId}` | Archives the campaign: Pinterest has no campaign delete. |

When Zernio holds no ads for the campaign, it first asks Pinterest whether the campaign still has ad groups. If it does, the answer is `409` and nothing changes.

Otherwise the campaign is archived and its ads are cancelled.

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `501` with code `feature_not_available` | `targeting` or `creative` sent to `PUT /v1/ads/{adId}` | Change status or budget, and recreate the ad for anything else. |
| `409` with code `invalid_field_value` on `campaignId` | A campaign budget sent to a campaign whose ad groups hold the budgets | Change the ad group budgets with `PUT /v1/ads/ad-sets/{adSetId}`. |
| `409` with code `invalid_field_value` on `adSetId` | An ad group budget sent to a campaign that uses campaign budget optimization | Change the campaign budget with `PUT /v1/ads/campaigns/{campaignId}`. |
| `409` with code `invalid_resource_state` | Zernio holds no ads for the campaign, and Pinterest still has ad groups in it | Sync the ad account and delete the campaign again, or delete its ad groups first. |
| `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. |
| `502` with code `platform_api_error` | Pinterest rejected the request | Read `platformError` for Pinterest's own payload. |

## Related

- [Pause or resume a campaign](/ad-campaigns/update-ad-campaign-status): every field of the status call.
- [Update ad](/ad-campaigns/update-ad): status and budget edits.
- [Delete a campaign](/ad-campaigns/delete-ad-campaign): the archive and its checks.
- [Media & Limits](/platforms/pinterest-ads/reference): what Pinterest Ads cannot do.