> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/meta-ads.md).

# Meta Ads

Read ad accounts, campaigns, ad sets, ads, and performance insights from Meta Ads across Facebook and Instagram.

### Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector | Authentication |
| --------- | -------------- |
| Meta Ads  | OAuth sign-in  |

#### Meta Ads

Connect to Meta Ads to read ad accounts, campaigns, ad sets, ads, and performance insights across Facebook and Instagram.

**Set up in Meta Ads**

1. In the Meta App Dashboard, create an app and choose the "Create & manage ads with Marketing API" use case. Attach the business portfolio that owns the ad accounts you want to read, since the app reaches accounts through the portfolio it belongs to.
2. Back in the app, open Facebook Login for Business in the left menu and go to Settings. Set Client OAuth login and Web OAuth login to Yes, then paste the redirect URI into Valid OAuth Redirect URIs and save. The Marketing API use case configures no login by itself, so this list starts empty and the authorization dialog refuses to open until the exact URI is in it. Meta matches it character for character and accepts no wildcards.
3. Grant both permissions the dialog asks for. The first covers reading your ads and their statistics. The second covers your business assets, and without it only the accounts your own user holds a role on come back, which leaves out most of an agency's inventory.

**Set up in StackAI**

1. Open **Settings → Connections**, add a connection, and select **Meta Ads**.
2. Select **Connect**, sign in to the provider account, and review the requested access. Complete authorization to return to StackAI.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

StackAI obtains the OAuth credentials during sign-in. You do not need to paste an access token or refresh token.

**Provider documentation:** [Setup reference](https://developers.facebook.com/docs/marketing-api/get-started/).

#### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

### Use an action

1. Add the required **Meta Ads** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

### Actions

#### List Ad Accounts

List the Meta ad accounts this connection can reach, with currency, timezone, and status. Start here to find the ad account ID other actions need.

**Required permissions:** `ads_read`, `business_management`.

**Inputs**

| Field       | Type    | Required | Description                             |
| ----------- | ------- | -------- | --------------------------------------- |
| Max Results | integer | No       | How many ad accounts to return at most. |

**Outputs**

| Field       | Type          | Description                                                                                         |
| ----------- | ------------- | --------------------------------------------------------------------------------------------------- |
| Ad Accounts | object\_array | Ad accounts the connected user can access, with name, currency, timezone, billing name, and status. |

#### Get Ad Account

Get one Meta ad account in full: currency, timezone, status, lifetime spend, balance, spend cap and the business that owns it.

**Required permissions:** `ads_read`, `business_management`.

**Inputs**

| Field      | Type            | Required | Description                                                        |
| ---------- | --------------- | -------- | ------------------------------------------------------------------ |
| Ad Account | select (string) | Yes      | The ad account to read. Options load from the selected connection. |

**Outputs**

| Field      | Type   | Description                                                                                                 |
| ---------- | ------ | ----------------------------------------------------------------------------------------------------------- |
| Ad Account | object | The ad account with its currency, timezone, status, lifetime spend, balance, spend cap and owning business. |

#### List Campaigns

List an ad account's campaigns with their status, objective, budgets, and schedule. Filter by status to see only what is live.

**Required permissions:** `ads_read`, `business_management`.

**Inputs**

| Field            | Type                      | Required | Description                                                                                                                                                                                                   |
| ---------------- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Ad Account       | select (string)           | Yes      | The ad account whose campaigns to list. Options load from the selected connection.                                                                                                                            |
| Effective Status | multiple\_select (string) | No       | Only campaigns currently in these states. Leave empty for every campaign, including archived ones. Available values: Active, Paused, Deleted, Archived, Pending review, Disapproved, In process, With issues. |
| Max Results      | integer                   | No       | How many campaigns to return at most.                                                                                                                                                                         |
| Cursor           | string                    | No       | Continue a previous listing from where it left off.                                                                                                                                                           |

**Outputs**

| Field       | Type          | Description                                                                                                                            |
| ----------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Campaigns   | object\_array | Campaigns with name, status, objective, bid strategy, budgets, and schedule. Budget amounts are in the account currency's minor units. |
| Next Cursor | string        | Pass back as Cursor to fetch the next page; empty when there are no more results.                                                      |

#### List Ad Sets

List an ad account's ad sets with their optimization goal, budgets, schedule and audience. Filter by campaign to see how one campaign is split up.

**Required permissions:** `ads_read`, `business_management`.

**Inputs**

| Field            | Type                      | Required | Description                                                                                                                                                                                               |
| ---------------- | ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Ad Account       | select (string)           | Yes      | The ad account whose ad sets to list. Options load from the selected connection.                                                                                                                          |
| Campaign         | select (string)           | No       | Only ad sets inside one campaign. Leave empty for the account. Options load from the selected connection.                                                                                                 |
| Effective Status | multiple\_select (string) | No       | Only ad sets currently in these states. Leave empty for every ad set, including archived ones. Available values: Active, Paused, Deleted, Archived, Pending review, Disapproved, In process, With issues. |
| Max Results      | integer                   | No       | How many ad sets to return at most.                                                                                                                                                                       |
| Cursor           | string                    | No       | Continue a previous listing from where it left off.                                                                                                                                                       |

**Outputs**

| Field       | Type          | Description                                                                          |
| ----------- | ------------- | ------------------------------------------------------------------------------------ |
| Ad Sets     | object\_array | Ad sets with their status, optimization goal, budgets, schedule and who they target. |
| Next Cursor | string        | Pass back as Cursor to fetch the next page; empty when there are no more results.    |

#### List Ads

List an ad account's ads with their status and the campaign and ad set they belong to. Filter by campaign, ad set or status to audit a slice of them.

**Required permissions:** `ads_read`, `business_management`.

**Inputs**

| Field            | Type                      | Required | Description                                                                                                                                                                                       |
| ---------------- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Ad Account       | select (string)           | Yes      | The ad account whose ads to list. Options load from the selected connection.                                                                                                                      |
| Campaign         | select (string)           | No       | Only ads inside one campaign. Leave empty for the account. Options load from the selected connection.                                                                                             |
| Ad Set           | select (string)           | No       | Only ads inside one ad set. Leave empty for the account. Options load from the selected connection.                                                                                               |
| Effective Status | multiple\_select (string) | No       | Only ads currently in these states. Leave empty for every ad, including archived ones. Available values: Active, Paused, Deleted, Archived, Pending review, Disapproved, In process, With issues. |
| Max Results      | integer                   | No       | How many ads to return at most.                                                                                                                                                                   |
| Cursor           | string                    | No       | Continue a previous listing from where it left off.                                                                                                                                               |

**Outputs**

| Field       | Type          | Description                                                                                                        |
| ----------- | ------------- | ------------------------------------------------------------------------------------------------------------------ |
| Ads         | object\_array | Ads with their name, status, the campaign and ad set they belong to, and the copy of the creative behind each one. |
| Next Cursor | string        | Pass back as Cursor to fetch the next page; empty when there are no more results.                                  |

#### Get Insights

Get Meta Ads performance for an ad account: impressions, clicks, reach, spend, CTR, CPC, CPM, conversions and ROAS, broken down by campaign, ad set, or ad over a date range.

**Required permissions:** `ads_read`, `business_management`.

**Inputs**

| Field              | Type                      | Required | Description                                                                                                                                                                                                                                                                                                                                            |
| ------------------ | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Ad Account         | select (string)           | Yes      | The ad account to report on. Options load from the selected connection.                                                                                                                                                                                                                                                                                |
| Level              | select (string)           | No       | The level Meta reports at: one row for the whole account, or one row per campaign, ad set, or ad. Available values: Account (one total row), Campaign (one row per campaign), Ad set (one row per ad set), Ad (one row per ad). Default: campaign.                                                                                                     |
| Date Range         | select (string)           | No       | A relative date range. Ignored when both Start date and End date are set. Available values: Today, Yesterday, This week (Mon to today), Last week (Mon to Sun), Last 7 days, Last 14 days, Last 28 days, Last 30 days, Last 90 days, This month, Last month, This quarter, Last quarter, This year, Last year, Maximum available. Default: last\_30d.  |
| Start Date         | string                    | No       | First day to include, as YYYY-MM-DD. Set both dates to override the preset.                                                                                                                                                                                                                                                                            |
| End Date           | string                    | No       | Last day to include, as YYYY-MM-DD. Set both dates to override the preset.                                                                                                                                                                                                                                                                             |
| Campaign           | select (string)           | No       | Only report on one campaign. Leave empty for the whole account. Options load from the selected connection.                                                                                                                                                                                                                                             |
| Time Breakdown     | select (string)           | No       | Collapse the whole range into one row per item, or split it into daily, weekly or monthly rows. Available values: Whole range in one row, One row per day, One row per week, One row per calendar month. Default: all\_days.                                                                                                                           |
| Delivery Breakdown | multiple\_select (string) | No       | Split each row by audience or placement, for example by age or by platform. Meta treats this and Time breakdown as two halves of one setting, so it refuses most attempts to combine them. Available values: Age, Gender, Country, Region, Platform (Facebook, Instagram), Placement (feed, stories), Device model, Device platform (mobile, desktop). |
| Max Rows           | integer                   | No       | How many result rows to return at most.                                                                                                                                                                                                                                                                                                                |
| Cursor             | string                    | No       | Continue a previous report from where it left off.                                                                                                                                                                                                                                                                                                     |

**Outputs**

| Field       | Type          | Description                                                                                                                              |
| ----------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Insights    | object\_array | Performance rows with impressions, clicks, reach, spend, CTR, CPC, CPM, conversions and return on ad spend for the requested date range. |
| Range Start | string        | First day the returned rows cover, empty on a partial report.                                                                            |
| Range End   | string        | Last day the returned rows cover, empty on a partial report.                                                                             |
| Next Cursor | string        | Pass back as Cursor to fetch the next page; empty when there are no more rows.                                                           |

### Important behavior

If an operation is denied, check the connection’s granted permissions and the account’s access in the provider. Reauthorize the connection when it needs additional permissions.

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/meta-ads.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
