# Boost post as ad

Boosts a post as ad.

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

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

## Header parameters

- `Idempotency-Key` (string)

## Request body

Content type: `application/json`

- `creativeFeatures`, map of string
- `postId`, string
- `platformPostId`, string
- `accountId`, string, required
- `adAccountId`, string, required
- `name`, string, required: Up to 255 characters
- `campaignName`, string: Up to 255 characters
- `adSetName`, string: Up to 255 characters
- `goal`, string, required: One of `engagement`, `traffic`, `awareness`, `video_views`, `lead_generation`, `conversions`, `app_promotion`
- `adSetId`, string
- `existingCampaignId`, string
- `identityId`, string
- `identityType`, string: One of `TT_USER`, `CUSTOMIZED_USER`, `BC_AUTH_TT`
- `budgetAmount`, number
- `budgetType`, string: One of `daily`, `lifetime`
- `lifetimeBudgetCap`, number
- `budget`, object
  - `amount`, number, required
  - `type`, string, required: One of `daily`, `lifetime`
- `instagramAccountId`, string
- `destinationType`, string: One of `INSTAGRAM_PROFILE`, `WEBSITE`, `ON_AD`, `MESSENGER`, `WHATSAPP`, `INSTAGRAM_DIRECT`
- `whatsappPhoneNumber`, string: Matches `^\+[1-9]\d{6,14}$`
- `workflowId`, string: Matches `^[a-fA-F0-9]{24}$`
- `currency`, string: 3 to 3 characters
- `startDate`, string (date-time)
- `endDate`, string (date-time)
- `schedule`, object
  - `startDate`, string (date-time)
  - `endDate`, string (date-time)
- `targeting`, object
  - `ageMin`, integer: 13 to 65
  - `ageMax`, integer: 13 to 65
  - `gender`, string: One of `all`, `male`, `female`
  - `languages`, array of string
  - `countries`, array of string
  - `regions`, array of object
    - `key`, string, required
    - `name`, string
  - `cities`, array of object
    - `key`, string, required
    - `name`, string
    - `radius`, number
    - `distanceUnit`, string: One of `mile`, `kilometer`
  - `zips`, array of object
    - `key`, string, required
    - `name`, string
  - `metros`, array of object
    - `key`, string, required
    - `name`, string
  - `customLocations`, array of object
    - `latitude`, number, required: -90 to 90
    - `longitude`, number, required: -180 to 180
    - `radius`, number, required
    - `distanceUnit`, string, required: One of `mile`, `kilometer`
    - `name`, string
    - `address`, string
  - `interests`, array of object
    - `id`, string, required
    - `name`, string, required
  - `advantage_audience`, integer: One of `0`, `1`
- `locationTargetingType`, object
- `rawTargeting`, object
- `bidStrategy`, object
- `bidAmount`, number
- `roasAverageFloor`, number
- `platformSpecificData`, object
  - one of: Linked In Ads settings
    - `costType`, string: One of `CPM`, `CPC`, `CPV`
    - `unitCost`, number
    - `optimizationTargetType`, string
    - `creativeSelection`, string: One of `OPTIMIZED`, `ROUND_ROBIN`
    - `audienceExpansionEnabled`, boolean
    - `offsiteDeliveryEnabled`, boolean
    - `connectedTelevisionOnly`, boolean
    - `carousel`, object
      - `cards`, array of object, required: At least 2 items. Up to 10 items
        - `imageUrl`, string (URL), required
        - `headline`, string
        - `landingUrl`, string (URL)
    - `document`, object
      - `url`, string (URL), required
      - `title`, string, required
    - `spotlight`, object
      - `headline`, string, required
      - `description`, string
      - `callToAction`, string, required
      - `landingUrl`, string (URL), required
      - `logoUrl`, string (URL)
      - `organizationName`, string
      - `showMemberProfilePhoto`, boolean
      - `backgroundImageUrl`, string (URL)
    - `follower`, object
      - `headline`, object, required
        - `preApproved`, string
        - `custom`, string
      - `description`, object, required
        - `preApproved`, string
        - `custom`, string
      - `callToAction`, string, required: One of `VISIT_ORGANIZATION_COMPANY_PAGE`, `VISIT_ORGANIZATION_LIFE_PAGE`, `VISIT_ORGANIZATION_JOBS_PAGE`, `VISIT_ORGANIZATION_CAREERS_PAGE`
      - `logoUrl`, string (URL)
      - `organizationName`, string
      - `showMemberProfilePhoto`, boolean
    - `jobs`, object
      - `headline`, object, required
        - `preApproved`, string
        - `custom`, string
      - `buttonLabel`, object, required
        - `preApproved`, string
        - `custom`, string
      - `logoUrl`, string (URL)
      - `organizationName`, string
      - `showMemberProfilePhoto`, boolean
    - `textAd`, object
      - `headline`, string, required: Up to 25 characters
      - `description`, string, required: Up to 75 characters
      - `landingUrl`, string (URL), required
      - `imageUrl`, string (URL)
    - `conversation`, object
      - `subject`, string, required
      - `sender`, string
      - `body`, string
      - `footer`, string
      - `headline`, string
      - `firstMessageId`, string, required
      - `messages`, array of object, required: At least 1 item. Up to 25 items
        - `id`, string, required
        - `text`, string, required: Up to 500 characters
        - `buttons`, array of object: At least 1 item. Up to 5 items
          - `text`, string, required: Up to 35 characters
          - `nextMessageId`, string
          - `url`, string (URL)
    - `event`, object
      - `urn`, string, required: Matches `^urn:li:event:\d+$`
    - `thoughtLeader`, object
      - `postUrn`, string, required: Matches `^urn:li:(share|ugcPost):\d+$`
  - one of: Meta Ads settings
    - `bidStrategy`, string: One of `LOWEST_COST_WITHOUT_CAP`, `LOWEST_COST_WITH_BID_CAP`, `COST_CAP`, `LOWEST_COST_WITH_MIN_ROAS`
    - `bidAmount`, number
    - `roasAverageFloor`, number
    - `dailyMinSpendTarget`, number
    - `lifetimeMinSpendTarget`, number
    - `customerLifecycle`, object
      - `strategy`, string, required: One of `all_customers`, `new_customers`, `new_customers_excluding_engaged`
      - `existingCustomerAudienceIds`, array of string
      - `engagedAudienceIds`, array of string
    - `adSchedule`, object: At least 1 item
      - `dayOfWeek`, string, required: One of `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`, `SUNDAY`
      - `startHour`, integer, required: 0 to 23
      - `endHour`, integer, required: 1 to 24
      - `timezoneType`, string: One of `USER`, `ADVERTISER`. Default `USER`
- `tracking`, object
  - `pixelId`, string
  - `urlTags`, array of object
    - `key`, string
    - `value`, string
- `specialAdCategories`, array of string: Each item: one of `HOUSING`, `EMPLOYMENT`, `CREDIT`, `FINANCIAL_PRODUCTS_SERVICES`, `ISSUES_ELECTIONS_POLITICS`, `ONLINE_GAMBLING_AND_GAMING`
- `specialAdCategoryCountry`, array of string
- `regionalRegulatedCategories`, array of string
- `regionalRegulationIdentities`, map of string or integer
- `linkUrl`, string (URL)
- `callToAction`, string
- `sparkAuthCode`, string
- `smartPlus`, boolean
- `sparkPosts`, array of object: At least 1 item. Up to 50 items
  - `platformPostId`, string, required
  - `sparkAuthCode`, string, required
- `promoCodes`, array of object: At least 1 item. Up to 10 items
  - `discountType`, string, required: One of `PERCENTAGE`, `CASH`
  - `discountValue`, number, required
  - `discountCurrency`, string
  - `promoCode`, string: Up to 30 characters
  - `minimumPurchaseType`, string: One of `QUANTITY`, `SUBTOTAL`
  - `minimumPurchaseValue`, number
  - `minimumPurchaseCurrency`, string
- `promotedObject`, object
  - `pixelId`, string
  - `customEventType`, string
  - `customEventStr`, string
  - `customConversionId`, string
- `dsaBeneficiary`, string: Up to 100 characters
- `dsaPayor`, string: Up to 100 characters
- `leadGenFormId`, string
- `status`, string: One of `ACTIVE`, `PAUSED`
- `campaignStatus`, string: One of `ACTIVE`, `PAUSED`
- `adSetStatus`, string: One of `ACTIVE`, `PAUSED`
- `adStatus`, string: One of `ACTIVE`, `PAUSED`
- `budgetLevel`, string: One of `adset`, `campaign`
- `attributionSpec`, array of object: At least 1 item. Up to 3 items
  - `eventType`, string, required: One of `CLICK_THROUGH`, `VIEW_THROUGH`, `ENGAGED_VIDEO_VIEW`
  - `windowDays`, integer, required: One of `1`, `7`, `28`
- `bodies`, array of string: At least 1 item. Up to 5 items
- `rehostOnInstagramVideoRejection`, boolean: Default `true`
- `smartTargeting`, object
  - `audience`, boolean
  - `interestsBehaviors`, boolean
- `optimizationGoal`, string
- `metaObjective`, string: One of `OUTCOME_ENGAGEMENT`
- `validateOnly`, boolean: Default `false`

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/ads/boost" \
  -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/boost", {
  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/boost",
    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
- `results`, array of object
  - `node`, string: One of `campaign`, `adSet`, `creative`, `ad`
  - `status`, string: One of `validated`, `skipped`, `unverified`
  - `reason`, string
- `message`, string

```json
{
  "validateOnly": true,
  "results": [
    {
      "node": "campaign",
      "status": "validated",
      "reason": "string"
    }
  ],
  "message": "Hello from Pozy"
}
```
