> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Boost Post

> पोस्ट को Instagram के ad platform पर सबमिट करके boost करें

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/docs/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/docs/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/docs/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

<PlansAvailable plans={["premium"]} maxPackRequired={false} />

एक ad बनाने के लिए मौजूदा Instagram पोस्ट को boost करें।
यह endpoint आपको कस्टम targeting, बजट और scheduling parameters के साथ आपके organic पोस्ट्स को paid विज्ञापनों में परिवर्तित करने की अनुमति देता है।

<ul className="custom-bullets">
  <li>Budget और bid राशियाँ USD में अधिकतम दो दशमलव स्थानों तक निर्दिष्ट की जानी चाहिए।</li>
  <li>Instagram की आवश्यकता को पूरा करने के लिए ad कम से कम 30 घंटे चलना चाहिए।</li>

  <li>
    Targeting के लिए interest ID खोजने के लिए आप [interests endpoint](/docs/apis/ads/instagram/get-ad-interests) का
    उपयोग कर सकते हैं।
  </li>

  <li>Instagram को boosted पोस्ट्स की समीक्षा और अनुमोदन में 24 घंटे तक लग सकते हैं।</li>

  <li>
    यदि `socialPostId` का सीधे उपयोग कर रहे हैं (Ayrshare `postId` के बजाय), तो सुनिश्चित करें कि यह एक वैध Instagram post
    ID है।
  </li>

  <li>
    अगर Facebook द्वारा campaign बनाए जाने के बाद (creative, ad set या ad चरण पर) कोई boost विफल हो जाता है,
    तो हम उस campaign को हटाने की कोशिश करते हैं। अगर हटाना भी विफल हो जाता है, तो खाली campaign आपके ad
    account में बना रहता है। आप इसे Ads Manager में ढूंढकर हटा सकते हैं।
  </li>
</ul>

<h3 id="ad-goals">
  Ad Goals
</h3>

प्रत्येक ad का एक goal होना चाहिए। Goal यह निर्धारित करता है कि ad को display के लिए किस प्रकार optimize किया जाएगा।

<ul className="custom-bullets">
  <li>
    `engagement`: यह goal engagement बढ़ाने का प्रयास करता है और साथ ही यह सुनिश्चित करता है कि ad अधिकतम संख्या में
    unique उपयोगकर्ताओं तक पहुँचे। यह visibility को engagement के साथ संतुलित करता है, ad को अधिक से अधिक विभिन्न
    लोगों को दिखाता है जो इसके साथ interact कर सकते हैं।
  </li>

  <li>
    `interactions`: ad पर interactions जैसे likes, comments, और shares को बढ़ाने के लिए डिज़ाइन किया गया।
    Instagram उन उपयोगकर्ताओं को ad दिखाने को प्राथमिकता देता है जिनके इसके साथ engage होने की सबसे अधिक संभावना है।
  </li>

  <li>
    `awareness_views`: ad को दिखाए जाने की अधिकतम संख्या के माध्यम से ब्रांड जागरूकता बढ़ाने पर केंद्रित है।
    यह unique reach की परवाह किए बिना, बजट के भीतर ad को अधिक से अधिक बार दिखाने को प्राथमिकता देता है।
  </li>

  <li>
    `awareness_audience`: ad को देखने वाले unique लोगों की संख्या को अधिकतम करके ब्रांड जागरूकता बढ़ाने का लक्ष्य रखता है।
    यह सुनिश्चित करता है कि ad अधिक से अधिक विभिन्न उपयोगकर्ताओं तक पहुँचे और एक ही audience को कई बार दिखाने के बजाय
    unique audience के आकार को अधिकतम करे।
  </li>
</ul>

<Note>
  Instagram ads के लिए Facebook के माध्यम से जुड़ा हुआ Instagram Business account, एक संबद्ध Facebook Page, और `ads_management` अनुमति आवश्यक है। यह अनुमति देने के लिए Facebook के माध्यम से फिर से लिंक करें। Instagram Login से जुड़े accounts इन ads endpoints का उपयोग नहीं कर सकते। Media ID और Instagram account ID आपके linked account से resolve किए जाते हैं; `instagram_user_id` न भेजें।
</Note>

`socialPostId` selector Instagram-विशिष्ट alias `igPostId` को भी स्वीकार करता है। `fbPostId` केवल Facebook पर लागू होता है। सफल प्रतिक्रियाओं में `platform: "instagram"`, `socialPostId`, और `igPostId` शामिल होते हैं।

## Header Parameters

<HeaderAPI />

## Body Parameters

<ParamField body="idempotencyKey" type="string">
  इस boost अनुरोध के लिए एक unique, non-empty key। डुप्लिकेट ad बनने से बचने के लिए उसी payload को उसी key के साथ retry करें। किसी अलग payload या platform के साथ key का पुन: उपयोग करने पर HTTP 409 लौटाया जाता है। अभी भी प्रगति में चल रहा अनुरोध भी 409 लौटाता है; अनुपलब्ध reservation बिना कोई ad बनाए 503 लौटाता है।
</ParamField>

<ParamField body="adSetBudgetSharingEnabled" type="boolean" default={false}>
  Meta को campaign में ad sets के बीच बजट साझा करने की अनुमति दें।
</ParamField>

<ParamField body="accountId" type="string" required>
  उस Instagram ad account की ID जिस पर पोस्ट को boost करना है। Account ID को
  [ad accounts endpoint](/docs/apis/ads/instagram/get-ad-accounts) से प्राप्त किया जा सकता है।
</ParamField>

<ParamField body="adName" type="string" required>
  आपके ad का नाम (Instagram Ad Manager में दिखाई देता है) `{adName} - {postId or socialPostId} - {current date}` फ़ॉर्मैट के साथ।
</ParamField>

<ParamField body="bidAmount" type="number" required>
  USD में अधिकतम bid राशि, अधिकतम दो दशमलव स्थानों वाली एक positive राशि के रूप में।
</ParamField>

<ParamField body="budget" type="number" required>
  USD में दैनिक बजट। अधिकतम दो दशमलव स्थानों वाली positive राशि का उपयोग करें। Meta आपके account और goal के लिए अतिरिक्त न्यूनतम सीमाएँ लागू कर सकता है।
</ParamField>

<ParamField body="socialPostId" type="string">
  Boost करने के लिए पोस्ट की [Instagram social post ID](/docs/apis/overview#social-post-id), जो आपको
  सीधे Instagram पर बनाए गए पोस्ट से एक ad बनाने की अनुमति देती है। यह [Instagram पर पोस्ट](/docs/apis/history/history-platform) की ID है,
  Ayrshare की नहीं। यदि `postId` सेट नहीं है तो आवश्यक है।
</ParamField>

<ParamField body="goal" type="string" default="engagement">
  ad का goal। मान: `engagement`, `interactions`, `awareness_views`, और
  `awareness_audience`। अधिक जानकारी के लिए ऊपर [ad goals details](/docs/apis/ads/instagram/boost-post#ad-goals) देखें।
</ParamField>

<ParamField body="locations" type="object" default={{ countries: ["US"] }}>
  [country codes](/docs/iso-codes/country) का उपयोग करते हुए `{"countries": ["US", "CA"]}` के साथ देशों को target करें। आप `regions` और `cities` arrays भी दे सकते हैं; [regions](/docs/apis/ads/instagram/get-ad-regions) और [cities](/docs/apis/ads/instagram/get-ad-cities) देखें। ऐसा object जिसमें कोई देश, क्षेत्र या शहर नहीं दिया गया हो, जैसे `{}`, code `101` के साथ अस्वीकार कर दिया जाता है; US को target करने के लिए `locations` को छोड़ दें।
</ParamField>

<ParamField body="postId" type="string">
  Boost करने के लिए पोस्ट की [Ayrshare post ID](/docs/apis/overview#ayrshare-post-id)। यदि
  `socialPostId` सेट नहीं है तो आवश्यक है।
</ParamField>

<ParamField body="status" type="string" default="active">
  ad का status। मान: `active` और `paused`।

  आप बाद में [update ad endpoint](/docs/apis/ads/instagram/put-ad-update) का उपयोग करके ad का status बदल सकते हैं।
</ParamField>

<ParamField body="tracking" type="object">
  Meta Pixel का उपयोग करके ad को track करें।

  <Expandable title="child attributes">
    <ParamField body="pixelId" type="number" required>
      Ad को track करने के लिए Meta Pixel की ID।

      ```json theme={"system"}
      {
       "pixelId": 1234567890
      }
      ```
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="urlTags" type="array">
  ad URL में UTM tags जोड़ें।

  ```json theme={"system"}
  {
    "urlTags": ["utm_source=ayrshare", "utm_medium=social", "utm_campaign=ayrshare-social"]
  }
  ```

  उदाहरण के लिए यदि linking URL `https://www.mysite.com/my-post` है और जोड़े गए URL tags हैं:

  `utm_source=ayrshare`, `utm_medium=social`, और `utm_campaign=ayrshare-social`।

  Ad URL होगा:
  `https://www.mysite.com/my-post?utm_source=ayrshare&utm_medium=social&utm_campaign=ayrshare-social`।
</ParamField>

<ParamField body="specialAdCategories" type="array">
  Meta [special ad categories](https://www.facebook.com/business/help/298000447747885?helpref=faq_content) में विज्ञापनदाताओं से अपनी campaign category स्वयं-पहचान करने की आवश्यकता रखता है।

  यदि आपका व्यवसाय इनमें से किसी एक श्रेणी में है, तो अपनी पोस्ट को boost करते समय आपको उपयुक्त श्रेणी चुननी होगी।

  निम्नलिखित मान समर्थित हैं:

  <ul className="custom-bullets">
    <li>
      `housing`: ऐसे ads जो आवास के अवसर या संबंधित सेवा को promote करते हैं या सीधे लिंक करते हैं,
      जिनमें घर या अपार्टमेंट की बिक्री या किराए, homeowners insurance, mortgage insurance, mortgage loans,
      housing repairs और home equity या appraisal सेवाओं के लिए listings शामिल हैं, लेकिन इन्हीं तक सीमित नहीं हैं।
    </li>

    <li>
      `financial_product_services`: ऐसे ads जो credit सहित financial products और services offer को promote करते हैं
      या सीधे लिंक करते हैं।
    </li>

    <li>
      `employment`: ऐसे ads जो किसी employment अवसर को promote करते हैं या सीधे लिंक करते हैं, जिसमें part- या full-time jobs,
      internships या professional certification programs शामिल हैं, लेकिन इन्हीं तक सीमित नहीं हैं। इस श्रेणी में आने वाले संबंधित
      ads में किसी विशिष्ट नौकरी की पेशकश की परवाह किए बिना, job boards या fairs, aggregation services, या किसी कंपनी द्वारा
      प्रदान किए जा सकने वाले perks का विवरण देने वाले ads के promotions शामिल हैं।
    </li>

    <li>
      `issues_elections_politics`: ऐसे ads जो सार्वजनिक पद के लिए उम्मीदवार, राजनीतिक शख्सियत, राजनीतिक दल द्वारा, उनकी ओर से
      या उनके बारे में बनाए गए हैं या सार्वजनिक पद के लिए चुनाव के परिणाम की वकालत करते हैं। इसमें किसी भी चुनाव, referendum या
      ballot initiative के बारे में ads भी शामिल हैं, जिनमें "Go out and vote" चुनाव अभियान शामिल हैं। जहाँ ad रखा जा रहा है वहाँ
      राजनीतिक विज्ञापन के रूप में विनियमित ads या सामाजिक मुद्दों के बारे में ads। यदि issues, elections, या politics का चयन कर रहे हैं,
      तो आपको उस देश का चयन करना होगा जिसमें आप ये ads चलाना चाहते हैं। आपको निर्दिष्ट देश में सामाजिक मुद्दों, चुनावों, या
      राजनीति के बारे में ads चलाने के लिए अधिकृत होना आवश्यक है।
    </li>
  </ul>

  Meta को उन देशों की भी जानकारी चाहिए जिनमें special category ad चलता है। Ayrshare इन्हें `locations` से लेता है: आपके द्वारा सूचीबद्ध देश, साथ ही हर region और city का देश। इसलिए UK के किसी city को target करने वाला `housing` boost आपके request में कुछ भी अतिरिक्त जोड़े बिना UK के लिए set up हो जाता है। `locations` के बिना ad US में चलता है, और campaign US के लिए set up होता है।

  Meta इन categories के लिए हर city के आसपास एक न्यूनतम radius भी तय करता है। 17 किलोमीटर radius वाले एक UK city को `#2909039` के साथ अस्वीकार कर दिया गया, जो कम से कम 25 किलोमीटर (15 मील) की मांग करता है, इसलिए 25 किलोमीटर या उससे अधिक का उपयोग करें।

  <Warning>
    Meta विज्ञापनदाताओं से अपनी campaign category सही ढंग से पहचानने की आवश्यकता रखता है।
    Meta इस प्रकार के ads की पहचान करने के लिए मानव समीक्षकों और machine-learning का उपयोग करता है।
    यदि आप हमें एक गलत `specialAdCategories` भेजते हैं, तो जोखिम है कि आपके ads तब तक रोक दिए जाएंगे जब तक campaign समायोजित नहीं हो जाती।
  </Warning>
</ParamField>

<ParamField body="dsaBeneficiary" type="string">
  वह व्यक्ति या संगठन जिसे ad से लाभ होता है। `dsaPayor` के साथ मिलकर सेट करें। सुझावों के लिए [DSA recommendations endpoint](/docs/apis/ads/instagram/get-dsa-recommendations) का उपयोग करें।
</ParamField>

<ParamField body="dsaPayor" type="string">
  वह व्यक्ति या संगठन जो ad के लिए भुगतान करता है। `dsaBeneficiary` के साथ मिलकर सेट करें।
</ParamField>

<ParamField body="endDate" type="string">
  ISO 8601 फ़ॉर्मैट में समाप्ति तिथि और समय (start के बाद कम से कम 30 घंटे होना चाहिए), उदाहरण के लिए `2025-03-01T00:00:00Z`।

  यदि सेट नहीं है, तो ad अनिश्चित काल तक चलेगा और उसकी end date `ongoing` होगी।
</ParamField>

<ParamField body="excludedLocations" type="object">
  `locations` की ही `countries`, `regions`, और `cities` संरचना का उपयोग करके locations को exclude करें।
</ParamField>

<ParamField body="gender" type="string" default="all">
  Audience का लिंग। मान: `all`, `male`, `female`।
</ParamField>

<ParamField body="interests" type="array">
  Instagram [interest ids](/docs/apis/ads/instagram/get-ad-interests) के array के रूप में ad के target interests।
</ParamField>

<ParamField body="maxAge" type="number" default={65}>
  Ad को target करने के लिए अधिकतम आयु (डिफ़ॉल्ट: 65)।
</ParamField>

<ParamField body="minAge" type="number" default={18}>
  Ad को target करने के लिए न्यूनतम आयु (डिफ़ॉल्ट: 18)।
</ParamField>

<ParamField body="startDate" type="string">
  ISO 8601 फ़ॉर्मैट में प्रारंभ तिथि और समय, उदाहरण के लिए `2025-03-01T00:00:00Z`।

  यदि सेट नहीं है, तो ad तुरंत शुरू हो जाएगा।
</ParamField>

उदाहरण IDs को अपनी IDs से बदलें। `startDate` और `endDate` को अपने इच्छित schedule पर सेट करें; उदाहरण की तिथियाँ केवल उदाहरणस्वरूप हैं।

<h2 id="campaign-budgets">
  Campaign पर बजट
</h2>

बजट को ad set के बजाय campaign पर रखने के लिए, nested form में `budget.level: "campaign"` भेजें। तब ad set का अपना कोई बजट नहीं होता। यह daily और lifetime दोनों budgets के साथ काम करता है।

```json theme={"system"}
{
  "accountId": "123456789",
  "postId": "Ut1fWU6XkqkMayHGnJZ",
  "goal": "engagement",
  "budget": { "amount": 50, "type": "lifetime", "level": "campaign" },
  "schedule": { "start": "2026-11-01T00:00:00Z", "end": "2026-11-08T00:00:00Z" },
  "platformOptions": { "instagram": { "adName": "November boost", "bidAmount": 2 } }
}
```

* `budget.level`: `adSet` (डिफ़ॉल्ट) या `campaign`। campaign budget को `adSetBudgetSharingEnabled` के साथ नहीं जोड़ा जा सकता। दोनों भेजने पर अनुरोध `400` और `code: 101` के साथ अस्वीकार कर दिया जाता है।
* campaign budget के लिए response में `budgetLevel: "campaign"` जुड़ता है। ad set budget `budgetLevel` नहीं लौटाता, इसलिए अनुपस्थित field को `adSet` मानें।
* [History](/docs/apis/ads/instagram/get-ad-history) में, daily campaign budget वाले ad के लिए `budgetDaily` campaign का daily budget दिखाता है। यदि कई ads एक ही campaign budget साझा करते हैं, तो हर ad अपना हिस्सा नहीं, बल्कि पूरा campaign budget दिखाता है। History lifetime budgets नहीं दिखाता, न campaign पर और न ad set पर। lifetime campaign budget खर्च हो जाने पर, अगले nightly update के बाद उस campaign का हर ad `deliveryStatus: "COMPLETED"` दिखाता है, जिसमें scheduled या review में मौजूद ad भी शामिल है। rejected ad `REJECTED` ही रहता है।

<h2 id="attach-to">
  किसी मौजूदा campaign या ad set में boost करें
</h2>

डिफ़ॉल्ट रूप से हर boost अपना campaign, ad set और ad बनाता है। boost को Meta में पहले से चल रहे अपने किसी campaign या ad set में जोड़ने के लिए, `attachTo` के साथ nested form भेजें।

* `attachTo.campaignId`: boost उस campaign के अंदर एक नया ad set और ad बनाता है। `budget`, `targeting` और `bidAmount` सामान्य रूप से भेजें: ये नए ad set पर लागू होते हैं।
* `attachTo.adSetId`: boost उस ad set के अंदर केवल ad बनाता है। साथ में `attachTo.campaignId` भी भेजें, यानी वह campaign जिससे ad set संबंधित है। `budget`, `targeting` और `platformOptions.instagram.bidAmount` न भेजें: ad set अपने ही मान रखता है। इनमें से कोई भी भेजने पर `code: 101` के साथ `400` लौटता है।

```json theme={"system"}
{
  "accountId": "123456789",
  "postId": "Ut1fWU6XkqkMayHGnJZ",
  "goal": "engagement",
  "attachTo": { "campaignId": "120210000000000001", "adSetId": "120210000000000002" },
  "platformOptions": { "instagram": { "adName": "November boost" } }
}
```

* campaign या ad set उसी ad account में होना चाहिए जिसकी ID `accountId` में दी गई है, और वह किसी अन्य उपयोगकर्ता के boosts का नहीं होना चाहिए। अन्यथा अनुरोध `400` लौटाता है। कोई Instagram boost ऐसे campaign से भी नहीं जुड़ सकता जिसे किसी Facebook boost ने बनाया हो, और इसका उलटा भी लागू होता है।
* `attachTo` को `budget.level: "campaign"`, `specialAdCategories` या `adSetBudgetSharingEnabled` के साथ नहीं जोड़ा जा सकता, क्योंकि ये नए campaign पर सेट होते हैं। इन्हें भेजने पर `code: 101` लौटता है।
* boost को रोकने या सक्रिय करने से केवल वही बदलता है जो boost ने बनाया था: ad, और ad set यदि उसे boost ने बनाया था। `attachTo` में आपके द्वारा दिया गया campaign या ad set अपना status बनाए रखता है। ad केवल तभी चलता है जब उसके ऊपर का campaign और ad set सक्रिय हों। यह तब भी लागू होता है जब Ayrshare आपके ads रोकता है, उदाहरण के लिए जब कोई profile हटाई जाती है।
* यदि boost विफल हो जाता है, तो `attachTo` में दिया गया campaign या ad set कभी नहीं हटाया जाता।
* यदि आप जिस ad set से जोड़ते हैं वह ऐसे campaign में है जिसके पास बजट है (campaign budget), तो [History](/docs/apis/ads/instagram/get-ad-history) boost को campaign budget वाले किसी भी ad की तरह रिपोर्ट करता है: `budgetDaily` boost का हिस्सा नहीं, बल्कि पूरा campaign budget दिखाता है, और lifetime campaign budget खर्च हो जाने पर, अगले nightly update के बाद उस campaign में Ayrshare द्वारा ट्रैक किया गया हर ad `deliveryStatus: "COMPLETED"` दिखाता है, जिसमें scheduled या review में मौजूद ad भी शामिल है। rejected ad `REJECTED` ही रहता है।

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X POST https://api.ayrshare.com/api/ads/instagram/boost \
    -H "Authorization: Bearer API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "postId": "1234567890",
      "accountId": "1234567890",
      "adName": "My Ad",
      "status": "active",
      "goal": "engagement",
      "minAge": 18,
      "maxAge": 65,
      "locations": {"countries": ["US"]},
      "budget": 100,
      "bidAmount": 1,
      "startDate": "2025-03-01T00:00:00Z",
      "endDate": "2025-03-07T23:59:59Z",
      "interests": [1234567890, 1234567891]
    }'
  ```

  ```javascript JavaScript theme={"system"}
  const API_KEY = "API_KEY";

  fetch("https://api.ayrshare.com/api/ads/instagram/boost", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${API_KEY}`
    },
    body: JSON.stringify({
      postId: "1234567890",
      accountId: "1234567890",
      adName: "My Ad",
      status: "active",
      goal: "engagement",
      minAge: 18,
      maxAge: 65,
      locations: { countries: ["US"] },
      budget: 100,
      bidAmount: 1,
      startDate: "2025-03-01T00:00:00Z",
      endDate: "2025-03-07T23:59:59Z",
      interests: [1234567890, 1234567891]
    })
  })
    .then((res) => res.json())
    .then((json) => console.log(json))
    .catch(console.error);
  ```

  ```python Python theme={"system"}
  import requests

  API_KEY = "API_KEY"

  url = "https://api.ayrshare.com/api/ads/instagram/boost"
  payload = {
      "postId": "1234567890",
      "accountId": "1234567890",
      "adName": "My Ad",
      "status": "active",
      "goal": "engagement",
      "minAge": 18,
      "maxAge": 65,
      "locations": {"countries": ["US"]},
      "budget": 100,
      "bidAmount": 1,
      "startDate": "2025-03-01T00:00:00Z",
      "endDate": "2025-03-07T23:59:59Z",
      "interests": [1234567890, 1234567891]
  }

  response = requests.post(url, headers={"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}, json=payload)

  print(response.json())
  ```

  ```php PHP theme={"system"}
  <?php
  $API_KEY = "API_KEY";

  $payload = [
      "postId" => "1234567890",
      "accountId" => "1234567890",
      "adName" => "My Ad",
      "status" => "active",
      "goal" => "engagement",
      "minAge" => 18,
      "maxAge" => 65,
      "locations" => ["countries" => ["US"]],
      "budget" => 100,
      "bidAmount" => 1,
      "startDate" => "2025-03-01T00:00:00Z",
      "endDate" => "2025-03-07T23:59:59Z",
      "interests" => [1234567890, 1234567891]
  ];

  $ch = curl_init("https://api.ayrshare.com/api/ads/instagram/boost");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Content-Type: application/json",
      "Authorization: Bearer " . $API_KEY
  ]);

  $response = curl_exec($ch);
  $result = json_decode($response, true);

  print_r($result);
  curl_close($ch);
  ```

  ```csharp C# theme={"system"}
  using System;
  using System.Net.Http;
  using System.Net.Http.Headers;
  using System.Text;
  using System.Text.Json;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main()
      {
          string API_KEY = "API_KEY";

          var payload = new
          {
              postId = "1234567890",
              accountId = "1234567890",
              adName = "My Ad",
              status = "active",
              goal = "engagement",
              minAge = 18,
              maxAge = 65,
              locations = new { countries = new[] { "US" } },
              budget = 100,
              bidAmount = 1,
              startDate = "2025-03-01T00:00:00Z",
              endDate = "2025-03-07T23:59:59Z",
              interests = new[] { 1234567890, 1234567891 }
          };

          using var client = new HttpClient();
          client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", API_KEY);

          var content = new StringContent(
              JsonSerializer.Serialize(payload),
              Encoding.UTF8,
              "application/json"
          );

          var response = await client.PostAsync("https://api.ayrshare.com/api/ads/instagram/boost", content);
          var responseBody = await response.Content.ReadAsStringAsync();

          Console.WriteLine(responseBody);
      }
  }
  ```

  ```go Go theme={"system"}
  package main

  import (
  	"bytes"
  	"encoding/json"
  	"fmt"
  	"io/ioutil"
  	"net/http"
  )

  func main() {
  	apiKey := "API_KEY"

  	payload := map[string]interface{}{
  		"postId":    "1234567890",
  		"accountId": "1234567890",
  		"adName":    "My Ad",
  		"status":    "active",
  		"goal":      "engagement",
  		"minAge":    18,
  		"maxAge":    65,
  		"locations": map[string]interface{}{"countries": []string{"US"}},
  		"budget":    100,
  		"bidAmount": 1,
  		"startDate": "2025-03-01T00:00:00Z",
  		"endDate":   "2025-03-07T23:59:59Z",
  		"interests": []int{1234567890, 1234567891},
  	}

  	jsonData, err := json.Marshal(payload)
  	if err != nil {
  		fmt.Println("Error marshaling JSON:", err)
  		return
  	}

  	req, err := http.NewRequest("POST", "https://api.ayrshare.com/api/ads/instagram/boost", bytes.NewBuffer(jsonData))
  	if err != nil {
  		fmt.Println("Error creating request:", err)
  		return
  	}

  	req.Header.Set("Content-Type", "application/json")
  	req.Header.Set("Authorization", "Bearer "+apiKey)

  	client := &http.Client{}
  	resp, err := client.Do(req)
  	if err != nil {
  		fmt.Println("Error sending request:", err)
  		return
  	}
  	defer resp.Body.Close()

  	body, err := ioutil.ReadAll(resp.Body)
  	if err != nil {
  		fmt.Println("Error reading response:", err)
  		return
  	}

  	fmt.Println(string(body))
  }
  ```

  ```java Java theme={"system"}
  import java.io.IOException;
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.util.Arrays;
  import java.util.HashMap;
  import java.util.Map;

  import com.fasterxml.jackson.databind.ObjectMapper;

  public class BoostPost {
      public static void main(String[] args) {
          String API_KEY = "API_KEY";
          String url = "https://api.ayrshare.com/api/ads/instagram/boost";

          Map<String, Object> payload = new HashMap<>();
          payload.put("postId", "1234567890");
          payload.put("accountId", "1234567890");
          payload.put("adName", "My Ad");
          payload.put("status", "active");
          payload.put("goal", "engagement");
          payload.put("minAge", 18);
          payload.put("maxAge", 65);
          payload.put("locations", Map.of("countries", Arrays.asList("US")));
          payload.put("budget", 100);
          payload.put("bidAmount", 1);
          payload.put("startDate", "2025-03-01T00:00:00Z");
          payload.put("endDate", "2025-03-07T23:59:59Z");
          payload.put("interests", Arrays.asList(1234567890, 1234567891));

          try {
              ObjectMapper objectMapper = new ObjectMapper();
              String requestBody = objectMapper.writeValueAsString(payload);

              HttpClient client = HttpClient.newHttpClient();
              HttpRequest request = HttpRequest.newBuilder()
                      .uri(URI.create(url))
                      .header("Content-Type", "application/json")
                      .header("Authorization", "Bearer " + API_KEY)
                      .POST(HttpRequest.BodyPublishers.ofString(requestBody))
                      .build();

              HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
              System.out.println(response.body());

          } catch (IOException | InterruptedException e) {
              e.printStackTrace();
          }
      }
  }
  ```

  ```ruby Ruby theme={"system"}
  require 'net/http'
  require 'uri'
  require 'json'

  API_KEY = "API_KEY"

  uri = URI.parse("https://api.ayrshare.com/api/ads/instagram/boost")
  payload = {
    postId: "1234567890",
    accountId: "1234567890",
    adName: "My Ad",
    status: "active",
    goal: "engagement",
    minAge: 18,
    maxAge: 65,
    locations: { countries: ["US"] },
    budget: 100,
    bidAmount: 1,
    startDate: "2025-03-01T00:00:00Z",
    endDate: "2025-03-07T23:59:59Z",
    interests: [1234567890, 1234567891]
  }

  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.request_uri)
  request["Content-Type"] = "application/json"
  request["Authorization"] = "Bearer #{API_KEY}"
  request.body = payload.to_json

  response = http.request(request)
  puts response.body
  ```
</RequestExample>

<ResponseExample>
  ```json 200: Post Boosted theme={"system"}
  {
      "status": "success",
      "adId": "120217670757750410",
      "adName": "API Post - DE6gpw8kxlonHy2b7Lo - 2025-03-26T23:42:43",
      "adStatus": "active",
      "bidAmount": 10,
      "budget": 100,
      "endDate": "2026-03-28T22:30:00Z",
      "goal": {
          "title": "Get More Engagement",
          "description": "This goal seeks to increase engagement...",
          "type": "engagement"
      },
      "interests": [
          "6003195554098"
      ],
      "locations": {"countries": ["US"]},
      "maxAge": 65,
      "minAge": 18,
      "postId": "DE6gpw8kxlonHy2b7Lo",
      "socialPostId": "1234567890",
      "igPostId": "1234567890",
      "platform": "instagram",
      "startDate": "2026-03-26T22:30:00Z"
  }
  ```

  ```json 400: Invalid Account ID theme={"system"}
  {
    "action": "boost post",
    "status": "error",
    "code": 369,
    "message": "Unable to boost post. Please try again or contact us if the issue persists.",
    "details": "The accountId likely does not exist. Please check the accountId and try again."
  }
  ```

  ```json 400: Missing Required Parameters theme={"system"}
  {
    "action": "request",
    "status": "error",
    "code": 101,
    "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
    "details": "Missing required fields: accountId"
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.