> For the complete documentation index, see [llms.txt](https://imbrace.gitbook.io/imbrace-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://imbrace.gitbook.io/imbrace-documentation/api/facebook-ad-api.md).

# Facebook Ad API

Facebook (a.k.a. Meta) allows businesses to run ad campaigns on their platforms. The following instructions show how to start an ad campaign using the Facebook Business platform.

To begin, you will need:

* A Facebook Business account with the ability to run ad campaigns.

{% hint style="info" %}
You may need to verify yourself using your account password and/or two-factor authentication while following these steps, if you have not already done so.
{% endhint %}

## Getting the Ad ID

**STEP 1**: Log in to the [Meta Business Manager](https://business.facebook.com/).

**STEP 2:** In the left side-bar, click on the hamburger menu icon, then go to **\[Ads Manager]**.

<figure><img src="/files/WLTRfieHgp2IxGUwKVyz" alt=""><figcaption></figcaption></figure>

**STEP 3:** Under the **Ads** tab, select the desired ad from the list and click the **\[Edit]** button.

<figure><img src="/files/pqBLnROIpbvYsWXdmMln" alt=""><figcaption></figcaption></figure>

**STEP 4:** In the left side-bar, click on the three dots next to the ad to open a context menu. The relevant ID is located at the bottom of the menu. You can copy the ad ID by clicking on it.

<figure><img src="/files/ph1n2LsqQ73SUzXgtbsy" alt=""><figcaption></figcaption></figure>

## Generating a permanent access token

**STEP 1:** Log in to the [Meta Business Manager](https://business.facebook.com/).

**STEP 2:** In the left side-bar, click on the hamburger menu icon, then go to **\[Business settings]**.

<figure><img src="/files/U6JJbqt1ZuDCeEemf3E0" alt=""><figcaption></figcaption></figure>

**STEP 3:** In the left side-bar, go to **\[Users] > \[System users]**.

<figure><img src="/files/Z7DDdVRCbBmk1Be81rHQ" alt=""><figcaption></figcaption></figure>

**STEP 4:** Select the relevant system user, then go to **\[Generate New Token]**.

<figure><img src="/files/D6EZnkN7xxr7iziN3DlW" alt=""><figcaption></figcaption></figure>

**STEP 5:** Select the app to generate the access token for, then set the **Token expiration** to **Permanent**.

<figure><img src="/files/iI6SgbXmR0dnpTAfxhSs" alt=""><figcaption></figcaption></figure>

**STEP 6:** Select the **permissions** you would like to assign to the access token from the given list, then click **\[Generate Token]**. You can then copy the access token.

<figure><img src="/files/XxxVc8HOktihyaMHwvjD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/zgvSlf0h7ye96aX0njsB" alt=""><figcaption></figcaption></figure>
