# Create a standalone campaign

Creates a standalone campaign.

```http
POST https://api.pozy.ai/v1/ads/campaigns
```

- Area: Ads / Ad Campaigns
- Auth: Authorization: Bearer pz_live_...

## Header parameters

- `Idempotency-Key` (string)

## Request body

Content type: `application/json`

- `accountId`, string, required
- `adAccountId`, string, required
- `name`, string, required: Up to 255 characters
- `goal`, string, required: One of `engagement`, `traffic`, `awareness`, `video_views`, `lead_generation`, `lead_conversion`, `job_applicants`, `conversions`, `app_promotion`, `catalog_sales`, `page_likes`, `page_visits`
- `isSkadnetworkAttribution`, boolean
- `promotedObject`, object
  - `pixelId`, string
  - `customEventType`, string
  - `customEventStr`, string
  - `pageId`, string
  - `applicationId`, string
  - `objectStoreUrl`, string (URL)
  - `customConversionId`, string
  - `productCatalogId`, string
  - `productSetId`, string
  - `offlineConversionDataSetId`, string
  - `whatsappPhoneNumber`, string
- `buyingType`, string: One of `AUCTION`, `RESERVED`
- `validateOnly`, boolean
- `specialAdCategories`, array of string: Each item: one of `HOUSING`, `EMPLOYMENT`, `CREDIT`, `ISSUES_ELECTIONS_POLITICS`, `FINANCIAL_PRODUCTS_SERVICES`, `ONLINE_GAMBLING_AND_GAMING`
- `budgetAmount`, number
- `budgetType`, string: One of `daily`, `lifetime`
- `status`, string: One of `ACTIVE`, `PAUSED`. Default `PAUSED`
- `startDate`, string (date-time)
- `endDate`, string (date-time)
- `locationTargetingType`, object
- `bidStrategy`, string: One of `LOWEST_COST_WITHOUT_CAP`, `LOWEST_COST_WITH_BID_CAP`, `COST_CAP`, `LOWEST_COST_WITH_MIN_ROAS`
- `bidAmount`, number
- `roasAverageFloor`, number
- `portfolioBidStrategyId`, string: Matches `^\d+$`
- `targetImpressionShare`, object
  - `location`, string, required: One of `ANYWHERE_ON_PAGE`, `TOP_OF_PAGE`, `ABSOLUTE_TOP_OF_PAGE`
  - `percent`, number, required: At most 100
  - `maxCpc`, number, required
- `manualCpc`, object
  - `maxCpc`, number, required
- `networkSettings`, object
  - `searchPartners`, boolean
  - `displayNetwork`, boolean

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/ads/campaigns" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "adAccountId": "666219aad7bab67ace411e4f",
  "name": "Acme",
  "goal": "engagement"
}'
```

```ts
import { randomUUID } from "node:crypto";

const res = await fetch("https://api.pozy.ai/v1/ads/campaigns", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Idempotency-Key": randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9",
    adAccountId: "666219aad7bab67ace411e4f",
    name: "Acme",
    goal: "engagement"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/ads/campaigns",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
        "adAccountId": "666219aad7bab67ace411e4f",
        "name": "Acme",
        "goal": "engagement",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `validateOnly`, boolean
- `adAccountId`, string
- `campaignId`, string: Always ``
- `objective`, string
- `status`, string: Always `VALIDATED`

```json
{
  "validateOnly": true,
  "adAccountId": "666219aad7bab67ace411e4f",
  "campaignId": "",
  "objective": "string",
  "status": "VALIDATED"
}
```
