> ## 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

> पोस्ट को Facebook के 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="/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="/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="/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 बनाने के लिए मौजूदा Facebook पोस्ट को boost करें।
यह endpoint आपको कस्टम targeting, बजट और scheduling parameters के साथ आपके organic पोस्ट्स को paid विज्ञापनों में परिवर्तित करने की अनुमति देता है।

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

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

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

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

### Ad Goals

प्रत्येक 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 को बढ़ाने के लिए डिज़ाइन किया गया।
    Facebook उन उपयोगकर्ताओं को ad दिखाने को प्राथमिकता देता है जिनके इसके साथ engage होने की सबसे अधिक संभावना है।
  </li>

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

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

Ayrshare के साथ Facebook Marketing API को integrate करने के बारे में हमारी [Facebook Marketing API Integration Guide](https://www.ayrshare.com/blog/facebook-ads-api-boosting-with-the-marketing-api/) में और जानें।

## Header Parameters

<HeaderAPI />

## Body Parameters

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

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

<ParamField body="bidAmount" type="number" required>
  USD में अधिकतम bid राशि। न्यूनतम bid राशि \$1.00 है।
</ParamField>

<ParamField body="budget" type="number" required>
  USD में दैनिक बजट। न्यूनतम बजट \$1.00 है।
</ParamField>

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

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

<ParamField body="locations" type="object" required default={{ countries: ["US"] }}>
  arrays के object के साथ ad locations को target करें: `countries`, `regions`, `cities`।

  <Expandable title="child attributes">
    <ParamField body="countries" type="array">
      देश कोड की सूची।

      ```json theme={"system"}
      {
        "countries": ["US", "CA"]
      }
      ```
    </ParamField>

    <ParamField body="regions" type="array">
      Regions के लिए Facebook का region `key` मान आवश्यक है। अधिक जानकारी के लिए [regions endpoint](/apis/ads/facebook/get-ad-regions) देखें।

      ```json theme={"system"}
      {
        "regions": [{ "key": "3886" }]
      }
      ```
    </ParamField>

    <ParamField body="cities" type="array">
      Cities के लिए आवश्यक: `key` (Facebook से), `radius`, और `distance_unit`।
      `radius` शहर के आस-पास की दूरी है: 10–50 miles या 17–80 kilometers।
      `distance_unit` `mile` या `kilometer` है।
      अधिक जानकारी के लिए [cities endpoint](/apis/ads/facebook/get-ad-cities) देखें।

      ```json theme={"system"}
      {
        "cities": [
          { "key": "2420605", "radius": 25, "distance_unit": "mile" }
        ]
      }
      ```
    </ParamField>
  </Expandable>
</ParamField>

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

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

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

<ParamField body="adSetBudgetSharingEnabled" type="boolean" default={false}>
  Meta के campaign-level ad set budget sharing को नियंत्रित करता है।
  Meta अब campaign-level बजट के बिना बनाए गए हर campaign पर इस wire field की आवश्यकता रखता है, इसलिए Ayrshare इसे हमेशा भेजता है — backward compatibility के लिए डिफ़ॉल्ट `false` है।

  Meta को समग्र प्रदर्शन को optimize करने के लिए एक ही campaign में अन्य ad sets के बीच ad set के बजट का लगभग 20% साझा करने देने के लिए `true` पर सेट करें। विवरण के लिए Meta का [ad campaign group reference](https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group/) देखें।
</ParamField>

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

  <Expandable title="child attributes">
    <ParamField body="pixelId" type="number" required>
      Ad को track करने के लिए Facebook 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>

  <Warning>
    Meta उन विज्ञापनदाताओं से आवश्यकता रखता है जिन्होंने अपनी campaign category स्वयं-पहचानी है।
    Meta इस प्रकार के ads की पहचान करने के लिए मानव समीक्षकों और machine-learning का उपयोग करता है।
    यदि आप हमें एक गलत `specialAdCategory` भेजते हैं, तो जोखिम है कि आपके ads तब तक रोक दिए जाएंगे जब तक campaign समायोजित नहीं हो जाती।
  </Warning>
</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">
  `countries`, `regions`, और `cities` के arrays वाले object का उपयोग करके locations को exclude करें।

  <Expandable title="child attributes">
    <ParamField body="countries" type="array">
      Exclude करने के लिए देश कोड की सूची।

      ```json theme={"system"}
      {
        "countries": ["US", "CA"]
      }
      ```
    </ParamField>

    <ParamField body="regions" type="array">
      Regions के लिए Facebook का region `key` मान आवश्यक है। अधिक जानकारी के लिए [regions endpoint](/apis/ads/facebook/get-ad-regions) देखें।

      ```json theme={"system"}
      {
        "regions": [{ "key": "3886" }]
      }
      ```
    </ParamField>

    <ParamField body="cities" type="array">
      Cities के लिए आवश्यक: `key` (Facebook से), `radius`, और `distance_unit`।
      `radius` शहर के आस-पास की दूरी है: 10–50 miles या 17–80 kilometers।
      `distance_unit` `mile` या `kilometer` है।
      अधिक जानकारी के लिए [cities endpoint](/apis/ads/facebook/get-ad-cities) देखें।

      ```json theme={"system"}
      {
        "cities": [
          { "key": "2420605", "radius": 25, "distance_unit": "mile" }
        ]
      }
      ```
    </ParamField>
  </Expandable>
</ParamField>

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

<ParamField body="interests" type="array">
  Facebook [interest ids](/apis/ads/facebook/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>

<ParamField body="dsaBeneficiary" type="string">
  EU देशों के लिए Digital Services Act (DSA) अनुपालन हेतु ad का beneficiary। यदि दोनों में से कोई एक प्रदान किया जाता है
  तो `dsaPayor` के साथ सेट किया जाना चाहिए। अधिक जानकारी के लिए कृपया हमारी [DSA
  guide](/apis/ads/facebook/get-dsa-recommendations) देखें।
</ParamField>

<ParamField body="dsaPayor" type="string">
  EU देशों के लिए Digital Services Act (DSA) अनुपालन हेतु ad का payor। यदि दोनों में से कोई एक प्रदान किया जाता है
  तो `dsaBeneficiary` के साथ सेट किया जाना चाहिए।
</ParamField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl -X POST https://api.ayrshare.com/api/ads/facebook/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/facebook/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/facebook/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/facebook/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/facebook/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/facebook/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/facebook/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);
          Map<String, Object> locations = new HashMap<>();
          locations.put("countries", Arrays.asList("US"));
          payload.put("locations", locations);
          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/facebook/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",
      "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: budget"
  }
  ```
</ResponseExample>
