# Manage ads

Pause, rename, rebudget, rebid, retarget and archive Reddit campaigns, ad groups and ads.

import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

Reddit keeps an on/off switch at each level, and Zernio writes to the level you call.

## Pause or resume

`PUT /v1/ads/{adId}/status`, or `status` on `PUT /v1/ads/{adId}`, sets the ad's own switch. Its ad group, campaign and sibling ads keep theirs.

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

Response (`200`):

```json
{ "updated": 1, "skipped": 0, "status": "paused", "configuredStatus": "PAUSED" }
```

`PUT /v1/ads/campaigns/{campaignId}/status` and `PUT /v1/ads/ad-sets/{adSetId}/status` set the campaign's or the ad group's switch the same way.

## Other changes

| Change | Call | Reddit behaviour |
|--------|------|------------------|
| Rename | `name` on `PUT /v1/ads/{adId}`, `PUT /v1/ads/campaigns/{campaignId}` or `PUT /v1/ads/ad-sets/{adSetId}` | |
| Budget | `budget: { amount, type }` on `PUT /v1/ads/{adId}` or `PUT /v1/ads/ad-sets/{adSetId}` | Changes the amount; the type must stay the same |
| Bid | `bidStrategy` and `bidAmount` on `PUT /v1/ads/ad-sets/{adSetId}` | See [Set a bid](#set-a-bid) |
| Targeting | `targeting` on `PUT /v1/ads/{adId}` | Replaces the ad group's targeting with the fields you send |
| Delete | `DELETE /v1/ads/{adId}`, `DELETE /v1/ads/campaigns/{campaignId}`, `DELETE /v1/ads/ad-sets/{adSetId}` | Archives |

## Set a bid

`bidStrategy` on an ad group takes:

- `LOWEST_COST_WITHOUT_CAP` (automatic bidding)
- `LOWEST_COST_WITH_BID_CAP` (a manual bid of `bidAmount`)
- `COST_CAP` (Reddit's maximize-volume bidding capped at `bidAmount`)

`bidAmount` is in whole currency units. Any other strategy returns `422`.

## Create a campaign on its own

`POST /v1/ads/campaigns` creates a campaign on its own ([Create a standalone campaign](/ad-campaigns/create-ad-campaign)).

With a `budget` it becomes a campaign-budget campaign: a lifetime budget needs `endDate` (without it the call returns `400`), and the [pixel](/platforms/reddit-ads/create-ads#pixel) rules apply.

Under a campaign budget, change the budget with `PUT /v1/ads/campaigns/{campaignId}`: an ad group budget update answers with an error that points there.

## How it behaves

- Reddit cannot switch a published budget between daily and lifetime, so sending the other type returns `422`: keep the type, or create a new ad.
- A targeting update replaces the whole set, so a field you leave out is cleared on the ad group (locations fall back to `US`).
- Creative edits are not available: `creative` on `PUT /v1/ads/{adId}` returns `501` with code `feature_not_available`; create a new ad instead.
- Deleting archives. Zernio sets the campaign, ad group or ad to `ARCHIVED` on Reddit and marks it `cancelled` in Zernio.
- Reddit only lets an archived entity be deleted for good after it has been archived for 3 hours, and Zernio never performs that final delete.
- Reddit's listings stop returning archived and deleted entities, so Zernio re-reads by id any stored campaign, ad group or ad the listing no longer returns.
- One that was archived or deleted in Reddit Ads Manager settles as `cancelled`, and one Reddit no longer finds is marked deleted.

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `422` with `param: "budget"` | A budget type change, or an ad group budget under a campaign budget | Keep the type, or update the campaign budget. |
| `422` on `bidStrategy` | A strategy outside the three Reddit takes | Use one of the strategies in [Set a bid](#set-a-bid). |
| `501` with code `feature_not_available` | `creative` sent to `PUT /v1/ads/{adId}` | Create a new ad instead. |
| `400` on `POST /v1/ads/campaigns` | A lifetime budget without `endDate` | Send `endDate`, or a daily budget. |
| `429` with code `rate_limited` | Reddit's rate limit for the connected user | Wait `Retry-After` seconds and retry. |

## Related

- [Update ad](/ad-campaigns/update-ad), [Update a campaign](/ad-campaigns/update-ad-campaign) and [Get campaign tree](/ad-campaigns/get-ad-tree).
- [Pause or resume a single ad](/ad-campaigns/update-ad-status): the switch and its read-back.
- [Update an ad set](/ad-campaigns/update-ad-set): ad group budget, bid and name.
- [Targeting](/platforms/reddit-ads/targeting): the fields a targeting update takes.