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

# Meta Ads

> Connect Meta Ads to VexiData to analyze Facebook and Instagram campaigns with your AI assistant.

Connect Meta Ads and your AI assistant can report on Facebook and Instagram campaign performance, read and manage ad objects through the Graph API, and search the public Meta Ad Library.

## Prerequisites

* A Meta account with access to the ad accounts you want to use, through Meta Business Suite or Business Manager
* The **Connect sources** capability in your VexiData organization, to connect the platform — Owners and Admins have it by default

## Connect Meta Ads

**1. Open the Integrations page**

Go to the [**Integrations**](https://vexidata.com/integrations) page in VexiData and find **Meta Ads**.

**2. Log in with Meta**

Click **Connect**. VexiData redirects you to Meta's login — sign in with the profile that has access to your ad accounts and approve the request.

VexiData asks for the `ads_read`, `ads_management`, `read_insights`, and `business_management` permissions, plus your basic profile and email address. Keep every ad permission enabled in the Meta dialog — if one is turned off, the connection is refused and you need to connect again.

**3. Pick your default ad accounts**

Click the new connection's card to open its page. In the **Settings** card, check the ad accounts the AI should use when you don't name one, then click **Save**.

> [!NOTE]
>
> Meta issues a long-lived access token that lasts about **60 days** and can't
> be renewed silently. When it expires, the connection shows **Reconnect
> required** and stops working until someone who can connect a new source
> opens it and clicks **Reconnect** — one Meta login away. The **Access
> expires** date is on the connection's **Connection details** card.

## Managing the connection

To connect another Meta profile, click **Add account** on the Meta Ads card on the [**Integrations**](https://vexidata.com/integrations) page. Each profile becomes its own connection, and the one with the **Primary** badge is the primary, which tools use when a request doesn't name a connection.

Click a connection's card to open its page. It has **Connection details**, **Settings**, and **Connection** cards, plus an [**Access**](https://vexidata.com/docs/workspaces/invite-team-members.md#access-to-a-data-source) section for choosing who can use the connection. From there you can:

* **Set default ad accounts** — in **Settings**, check the accounts the AI uses by default and click **Save**.
* **Make primary** — in **Connection**, make this connection the primary one. The button is hidden on the connection that is already primary.
* **Reconnect** — appears in **Connection** only when the Meta token has expired (the card shows **Reconnect required**). Log in with the same Meta profile to refresh this connection. A different profile is added as a separate connection.
* **Disconnect** — in **Connection**, remove the connection. AI tools stop working for it immediately.

## What the AI can do

| Tool | What it does | Access |
| - | - | - |
| `meta_ads_list_ad_accounts` | Lists the ad accounts the connected Meta profile can access. | Read |
| `meta_ads_run_insights` | Runs the Insights API for campaign, ad set, and ad performance. | Read |
| `meta_ads_graph_read` | Reads Graph API objects — campaigns, ad sets, ads, creatives, and audiences. | Read |
| `meta_ads_graph_write` | Creates or updates Graph API objects, such as pausing a campaign or changing a budget. | Write |
| `meta_ads_graph_delete` | Deletes a Graph API object. | Destructive |
| `meta_ads_search_ad_library` | Searches the public Meta Ad Library for ads from other advertisers. Outside the EU it returns only political and social-issue ads — see [Searching the Ad Library](#searching-the-ad-library). | Read |

> [!WARNING]
>
> `meta_ads_graph_write` and `meta_ads_graph_delete` change a live ad account,
> and budget or status changes affect real spend. They need **Write** access
> on the connection — by default, Owners and Admins. Review what the AI
> proposes before approving.

> [!NOTE]
>
> Meta expresses budgets in your account currency's **minor units** (cents): a
> `daily_budget` of `5000` on a USD account is \$50.00. Keep that in mind when
> reading or setting budgets.

### Searching the Ad Library

`meta_ads_search_ad_library` queries Meta's public [Ad Library](https://www.facebook.com/ads/library/) for ads run by advertisers other than you, which makes it useful for competitor research. Every search must name the **countries** to look in, plus either **search terms** or the **Facebook page IDs** of the advertisers whose ads you want to list. Try: *"What is \[competitor] running in Germany and France right now?"*

> [!NOTE]
>
> Outside the European Union, Meta's Ad Library API returns only political and
> social-issue ads. A search for a commercial advertiser in, say, the US will
> usually come back empty — that is expected, not a failure. The search has no
> setting that widens this, so search EU countries when you research a
> competitor's regular ads.

## Troubleshooting

> [accordion] Connection expired or tools return authorization errors
>
> Meta's long-lived tokens expire after about 60 days. Once a token has run out, the connection's card on the **Integrations** page shows **Reconnect required** — open it and click **Reconnect** in the **Connection** card.
>
> If you changed your Meta password or removed the app earlier, the connection can still show **Connected** while tools return authorization errors. Click **Add account** on the Meta Ads card and log in with the same Meta profile — VexiData refreshes the existing connection instead of adding a second one.

> [accordion] An ad account is missing from the list
>
> VexiData sees exactly the ad accounts the connected Meta profile can access:
>
> * Check the account appears in [Meta Business Suite](https://business.facebook.com) for that profile
> * Ask a Business Manager admin to grant the profile access to the ad account
> * If you logged in with the wrong profile, click **Add account** on the **Integrations** page and log in with the right one — a different profile becomes a second connection — then open the wrong connection and click **Disconnect**

> [accordion] Tools don't appear in my AI client
>
> Tools register as soon as the platform is connected, but some clients cache the tool list. Reload or reconnect the VexiData connector in your AI client.


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