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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://imbrace.gitbook.io/imbrace-documentation/api/facebook-ad-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
