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

# Promote a post

Promote a post you already published on X as an ad, keeping its engagement and media.

`POST /v1/ads/boost` promotes a post that is already published, keeping its engagement.

## Promote a post

Pass the Zernio `postId` of a post published on X, with the X Ads account and a budget. The ad carries the media of the post, video included.

<Tabs items={['Node.js', 'Python', 'curl']}>
<Tab value="Node.js">
```typescript
const { data: boosted } = await zernio.adcampaigns.boostPost({
  body: {
    postId: '65f1c0a9e2b5af0012ab34cd',
    accountId: '66b2e19d8c3f5a7e9d0b1c2d',
    adAccountId: '18ce54d4x5t',
    name: 'Boost launch post',
    goal: 'engagement',
    budget: { amount: 50, type: 'daily' },
    schedule: { startDate: '2027-01-04', endDate: '2027-01-11' }
  }
});

console.log(boosted.ad._id);
```
</Tab>
<Tab value="Python">
```python
boosted = client.ad_campaigns.boost_post(
    post_id="65f1c0a9e2b5af0012ab34cd",
    account_id="66b2e19d8c3f5a7e9d0b1c2d",
    ad_account_id="18ce54d4x5t",
    name="Boost launch post",
    goal="engagement",
    budget={"amount": 50, "type": "daily"},
    schedule={"startDate": "2027-01-04", "endDate": "2027-01-11"},
)

print(boosted["ad"]["_id"])
```
</Tab>
<Tab value="curl">
```bash
curl -X POST "https://zernio.com/api/v1/ads/boost" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "postId": "65f1c0a9e2b5af0012ab34cd",
    "accountId": "66b2e19d8c3f5a7e9d0b1c2d",
    "adAccountId": "18ce54d4x5t",
    "name": "Boost launch post",
    "goal": "engagement",
    "budget": { "amount": 50, "type": "daily" },
    "schedule": { "startDate": "2027-01-04", "endDate": "2027-01-11" }
  }'
```
</Tab>
</Tabs>

Response (`201`):

```json
{
  "ad": {
    "_id": "66f0a1b2c3d4e5f6a7b8c9d1",
    "name": "Boost launch post",
    "platform": "twitter",
    "status": "pending_review",
    "adType": "boost",
    "goal": "engagement",
    "budget": { "amount": 50, "type": "daily" }
  },
  "message": "Ad created"
}
```

Boosts are not idempotent. Send an `Idempotency-Key` header to make a retry replay the original `201` instead of creating a second ad ([idempotency](/guides/idempotency)).

## How it behaves

- A boost is the way to run a video ad on X, since a create carries an image only through the website card.
- `goal` takes the same 5 values as a create: `engagement`, `traffic`, `awareness`, `video_views`, `app_promotion`.
- After the boost only status, budget and bid change ([Manage ads](/platforms/x-ads/manage-ads)).

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `422` with code `ads_connection_required` | The profile has no `xads` account | Run the [connect](/platforms/x-ads#connect) flow with the X posting account id. |
| `400` with code `invalid_field_value` | A `goal` outside the 5 X values | Use a supported goal. |
| `403` with code `ads_allowance_exceeded` | No payment method on file and 500 live ads reached | Add a card to resume creating ads. |
| `502` with code `platform_api_error` | X rejected the request | Read `platformError` for X's own payload. |

## Related

- [Boost post](/ad-campaigns/boost-post): every field of the request.
- [Create a campaign](/platforms/x-ads/create-ads): a new promoted-only post instead.
- [Manage ads](/platforms/x-ads/manage-ads): pause, rebudget and delete the boost.
- [Idempotency](/guides/idempotency): safe retries with `Idempotency-Key`.