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

# Create an ad

Create a Reddit image, video, carousel or text ad, with its goal, pixel, budget and schedule.

`POST /v1/ads/create` creates the post, the campaign, the ad group and the ad in one call.

The shape of the creative picks the format:

- `carouselCards` makes a carousel.
- `video` makes a video ad.
- `imageUrl` makes an image ad.
- None of them makes a text ad.

## Create a campaign

<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: 'a2_gu5tcd9ah5se',
    name: 'Planner launch',
    goal: 'traffic',
    budgetAmount: 50,
    budgetType: 'daily',
    headline: 'The planner your whole team will actually open',
    body: 'Tasks, docs and meetings in one place. Free for teams of 5.',
    imageUrl: 'https://cdn.example.com/planner.png',
    linkUrl: 'https://example.com/planner',
    callToAction: 'SIGN_UP',
    countries: ['US', 'CA'],
    targeting: {
      communities: ['productivity', 'r/projectmanagement'],
      conversationKeywords: ['task manager']
    }
  }
});

console.log(created.ad.id);
```
</Tab>
<Tab value="Python">
```python
from zernio import Zernio

client = Zernio()

created = client.ad_campaigns.create_standalone_ad(
    account_id="66b2e19d8c3f5a7e9d0b1c2d",
    ad_account_id="a2_gu5tcd9ah5se",
    name="Planner launch",
    goal="traffic",
    budget_amount=50,
    budget_type="daily",
    headline="The planner your whole team will actually open",
    body="Tasks, docs and meetings in one place. Free for teams of 5.",
    image_url="https://cdn.example.com/planner.png",
    link_url="https://example.com/planner",
    call_to_action="SIGN_UP",
    countries=["US", "CA"],
    targeting={
        "communities": ["productivity", "r/projectmanagement"],
        "conversationKeywords": ["task manager"],
    },
)

print(created["ad"]["id"])
```
</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": "a2_gu5tcd9ah5se",
    "name": "Planner launch",
    "goal": "traffic",
    "budgetAmount": 50,
    "budgetType": "daily",
    "headline": "The planner your whole team will actually open",
    "body": "Tasks, docs and meetings in one place. Free for teams of 5.",
    "imageUrl": "https://cdn.example.com/planner.png",
    "linkUrl": "https://example.com/planner",
    "callToAction": "SIGN_UP",
    "countries": ["US", "CA"],
    "targeting": {
      "communities": ["productivity", "r/projectmanagement"],
      "conversationKeywords": ["task manager"]
    }
  }'
```
</Tab>
</Tabs>

Response (`201`):

```json
{
  "ad": {
    "id": "66f0a1b2c3d4e5f6a7b8c9d0",
    "name": "Planner launch",
    "platform": "reddit",
    "status": "pending_review",
    "adType": "standalone",
    "goal": "traffic",
    "budget": { "amount": 50, "type": "daily" },
    "platformAdId": "2160485120873925373",
    "platformCampaignId": "2160485120262584829",
    "platformAdSetId": "2160485120597863293",
    "platformAdAccountId": "a2_gu5tcd9ah5se"
  },
  "message": "Ad created and submitted for review"
}
```

`budgetAmount` is in whole units of the ad account's currency, so `50` is $50.00 on a USD account. `platformAdSetId` is the Reddit ad group.

Campaign and ad group names default to `<name> - Campaign` and `<name> - Ad Group`; send `campaignName` and `adSetName` to set them.

Every sample on the Reddit Ads pages reuses the `zernio` and `client` constructors from this one. The `accountId` is the `redditads` account from [Connect](/platforms/reddit-ads#connect).

If Reddit rejects a later step, Zernio archives the campaign and ad group it already created, so a failed create does not leave an empty campaign behind.

## Formats

| Format | Send | Notes |
|--------|------|-------|
| Image | `headline`, `imageUrl`, `linkUrl`, optional `body` and `callToAction` | |
| Video | `headline`, `video.url`, `video.thumbnailUrl` (or `imageUrl` as the thumbnail), `linkUrl`, optional `body` and `callToAction` | `video.id` is not accepted: send a URL |
| Carousel | `headline`, `carouselCards` (2 to 10), optional `body` | Each card takes `imageUrl`, `linkUrl` (falls back to the top-level `linkUrl`), `callToAction` and a caption from its `headline` or `description`. Video cards (`video`) are a `400`: Reddit carousels are images only |
| Text | `headline` and `body` only | A text ad cannot link out: `linkUrl` returns `400`. `callToAction` does not apply |
| Existing post | `POST /v1/ads/boost` | [Promote an existing post](/platforms/reddit-ads/boost) |

`headline` is required on every format and takes up to 300 characters; a longer one returns `400`.

Zernio publishes the creative as a post from the ad account's profile, and the ad promotes that post. Comments are open; send `allowComments: false` to create the post with comments turned off.

## Special ad category

Reddit requires a special ad category for housing, employment and credit ads, and sets it only when the campaign is created.

Send `specialAdCategories` with `HOUSING`, `EMPLOYMENT` or `CREDIT`. Zernio sends Reddit's combined `HOUSING_EMPLOYMENT_CREDIT` on the new campaign.

Other values return `400`, and so does a category with `existingCampaignId` or `adSetId`: the existing campaign keeps its own. It works the same on `POST /v1/ads/boost` and `POST /v1/ads/campaigns`.

## Call to action

`callToAction` takes one of:

- `LEARN_MORE`, `SHOP_NOW`, `SIGN_UP`, `CONTACT_US`, `DOWNLOAD`, `GET_QUOTE`
- `SUBSCRIBE`, `APPLY_NOW`, `BOOK_NOW`, `BUY_TICKETS`, `DONATE_NOW`
- `GET_DIRECTIONS`, `GET_SHOWTIMES`, `LISTEN_NOW`, `ORDER_NOW`, `SEE_MENU`
- `INSTALL_MOBILE_APP` (shown as "Install")

Any other value returns `400` listing these. Omit it to leave the button off.

## Goals

| `goal` | Reddit objective | Delivery | Requires |
|--------|------------------|----------|----------|
| `traffic` | Clicks | Billed per click | |
| `awareness` | Brand awareness | Billed per thousand impressions | |
| `video_views` | Video views | Billed per 6-second view (`optimizationGoal: "VIDEO_VIEW_6S"`, the default) or 15-second view (`VIDEO_VIEW_15S`) | A video creative; anything else returns `422` |
| `conversions` | Conversions | Optimizes toward one pixel event | `promotedObject.customEventType`, and a pixel that has received that event |
| `lead_generation` | Lead generation | Sends people to `linkUrl` and optimizes toward the pixel's `LEAD` event | A pixel that has received `LEAD` |

Any other `goal` returns `422` listing these 5. `conversions` and `lead_generation` ad groups use Reddit's 7-day click, 1-day view attribution window.

## Pixel

Every Reddit ad group carries a pixel. Zernio uses the pixel you name in `promotedObject.pixelId` (or `tracking.pixelId`), and otherwise the ad account's first pixel.

A pixel id that is not a pixel of `adAccountId` returns `400` with `param: "promotedObject.pixelId"`. List an ad account's pixels with [List conversion destinations](/conversions/list-ad-conversion-destinations).

On `conversions`, `promotedObject.customEventType` picks the event the campaign optimizes toward (case-insensitive):

| `customEventType` | Reddit optimization goal |
|-------------------|--------------------------|
| `PURCHASE` | Purchase |
| `LEAD` | Lead |
| `SIGN_UP`, `COMPLETE_REGISTRATION` | Sign up |
| `ADD_TO_CART` | Add to cart |
| `PAGE_VISIT`, `VIEW_CONTENT`, `CONTENT_VIEW` | Page visit |

Omitting it returns `400` with code `missing_required_field`.

```json
{
  "goal": "conversions",
  "promotedObject": { "pixelId": "a2_gu5tcd9ah5se", "customEventType": "PURCHASE" }
}
```

<Callout type="warn">
Reddit only optimizes toward an event the pixel has already received. Before a `conversions` or `lead_generation` create, Zernio reads the pixel's last-fired times.
</Callout>

If the pixel never received the event, the request returns `422` with code `invalid_resource_state`. Fire the event from your site, or send it once through the [Conversions API](/platforms/reddit-ads/conversions), then retry.

## Budget, schedule and bidding

The budget sits on the ad group:

- `budgetType: "daily"` spends up to `budgetAmount` a day.
- `budgetType: "lifetime"` spends it over the whole flight and needs `endDate`, otherwise the request returns `400` with `param: "endDate"`.

`startDate` defaults to now. A `startDate` or `endDate` without a time zone offset is read in the ad account's time zone.

A date-only `endDate` runs to 23:59:59 that day. Send an offset (`2027-01-04T09:00:00Z`) to pin an exact instant.

New ad groups always bid automatically. To set a manual bid or a cost cap, update the ad group after creation ([Manage ads](/platforms/reddit-ads/manage-ads)).

`status: "PAUSED"` creates everything paused so you can review it before it spends; `campaignStatus` overrides the switch for the campaign alone. Omitted, the ad goes live after Reddit's review.

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `422` with code `feature_not_available`, "has no pixel" | The ad account has no pixel | Create one in Reddit Ads Manager, then retry. |
| `422` with code `feature_not_available`, "has no profile" | The ad account has no profile to post the ad from | Add a profile in Reddit Ads Manager. |
| `422` with code `invalid_resource_state` | The pixel never received the event the campaign optimizes toward | Fire the event or [send it](/platforms/reddit-ads/conversions), then retry. |
| `400` with `param: "promotedObject.customEventType"` | `goal: "conversions"` without a supported event | Send one of the events in [Pixel](#pixel). |
| `400` with `param: "promotedObject.pixelId"` | The pixel is not in `adAccountId` | Use a pixel of that ad account. |
| `400` with `param: "linkUrl"` | A text ad with a link | Remove `linkUrl`, or add an image, video or carousel. |
| `400` with `param: "headline"` | Missing, or over 300 characters | Send a headline of 300 characters or fewer. |
| `400` with `param: "endDate"` | A lifetime budget without an end date | Send `endDate`. |
| `400` with code `invalid_field_value`, `param: "goal"` | A goal outside the 5 Reddit values | Use a supported goal. |

## Related

- [Create standalone ad](/ad-campaigns/create-standalone-ad): every field of the request.
- [Targeting](/platforms/reddit-ads/targeting): the targeting fields this request takes.
- [Promote a post](/platforms/reddit-ads/boost): run an existing Reddit post as an ad.
- [Send a conversion event](/platforms/reddit-ads/conversions): fire the event a `conversions` campaign needs.
- [Manage ads](/platforms/reddit-ads/manage-ads): bids, budgets and status after creation.