# Meta Ads

Create, boost and measure Facebook and Instagram ads with the Zernio API, using classic or business login.

import { PlatformCapabilities } from '@/components/platform-capabilities';

Create, boost and measure Facebook and Instagram ads with `POST /v1/ads/create` and a connected Meta Ads token.

This section covers:

- the campaign tree (campaigns, ad sets, ads, creatives)
- targeting and audiences
- the ad types that need their own request shape
- measurement (insights, pixels, conversions)
- the reads you need around a running ad account

## Quick reference

<PlatformCapabilities rows={[
  { property: 'Hierarchy', value: 'Campaign, ad set, ad (created in one call, or level by level)' },
  { property: 'Goals', value: <>11 values for <code>goal</code>: engagement, traffic, awareness, video_views, lead_generation, lead_conversion, conversions, app_promotion, catalog_sales, page_likes, page_visits</> },
  { property: 'Buying types', value: <>AUCTION (default) and RESERVED (see <a href="/platforms/meta-ads/reach-and-frequency">Reach and Frequency</a>)</> },
  { property: 'Budget levels', value: 'CBO (campaign) and ABO (ad set); reads tell you which one a campaign uses' },
  { property: 'Bid strategies', value: 'LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS' },
  { property: 'Creative formats', value: <>Single image, video, carousel (2 to 10 cards), dynamic creative, per-placement assets, catalog, instant form, messaging, call (see <a href="/platforms/meta-ads/creatives">Creatives</a>)</> },
  { property: 'Call to action values', value: <>The <code>callToAction</code> enum, plus <code>VIEW_INSTAGRAM_PROFILE</code> and the 3 messaging CTAs on boost (see the <a href="/platforms/meta-ads/reference#call-to-action-values">reference</a>)</> },
  { property: 'Special ad categories', value: 'HOUSING, EMPLOYMENT, CREDIT, ISSUES_ELECTIONS_POLITICS, FINANCIAL_PRODUCTS_SERVICES, ONLINE_GAMBLING_AND_GAMING' },
  { property: 'Image formats', value: 'JPEG, PNG (public URL or base64), max 30 MB' },
  { property: 'Video formats', value: 'MP4, MOV, max 4 GB' },
  { property: 'Ad previews', value: <>Yes, Meta iframe HTML for about 60 formats, before or after create (see <a href="/platforms/meta-ads/previews">Previews</a>)</> },
  { property: 'Dry-run validation', value: <>Yes, <code>validateOnly: true</code> validates the whole tree and creates nothing</> },
  { property: 'Insights', value: <>Synced metrics on <code>/v1/ads/tree</code>, live Meta queries and async report runs (see <a href="/platforms/meta-ads/analytics">Insights</a>)</> },
  { property: 'Audiences', value: 'Customer list, website, lookalike, engagement, saved targeting' },
  { property: 'Conversions', value: 'Yes, server-side events with hashed PII, dedup, Event Match Quality and Limited Data Use' },
  { property: 'Lead forms', value: 'Yes, forms plus leads by webhook or polling' },
  { property: 'Scheduling', value: 'Yes, ad set start and end dates, editable after launch' },
  { property: 'Analytics', value: 'Yes' },
]} />

## Before you start

You need a connection with the ads scopes and an ad account (`act_<n>`) it can act on. Use an existing ad account or [create one in the customer's own business portfolio](/platforms/meta-ads/connect#create-an-ad-account).

Ads are included with usage-based billing. A legacy plan without ads gets a `403` on every call here.

Creating Meta ads needs 4 things on the Meta side:

1. A Meta Business account with at least one ad account (`act_<n>`, existing or [created through the API](/platforms/meta-ads/connect#create-an-ad-account)).
2. A Facebook Page. Ads publish as the Page, and Instagram placements need an Instagram professional account linked to that Page.
3. The ads scopes on the connected account.
4. A pixel or dataset for any conversion-optimized goal ([conversion campaigns](/platforms/meta-ads/conversion-campaigns)).

<Callout type="warn">
An Instagram account connected with the default Instagram Login cannot run ads: that login never grants ads scopes. A `facebook` or `metaads` account must exist in the same profile, or ads calls on the Instagram `accountId` return `422 linked_account_required`.
</Callout>

Meta reviews every ad. A successful create means the ad exists, not that it delivers.

`reviewStatus` (`in_review`, `approved`, `rejected`, `with_issues`) is separate from the delivery `status`. Both appear on every node the tree returns.

## Connect

Call `GET /v1/connect/facebook/ads` with `profileId`. Meta has two login options:

- **Classic**, the default (`loginMode=classic`), uses the connected Facebook posting account and its token. An active parent with `ads_management` and `ads_read` can be reused without another OAuth round trip.
- **Facebook Login for Business** (`loginMode=business`, also accepted on `GET /v1/connect/instagram/ads`) creates an independent `metaads` connection with a Business Integration System User token. No posting account is created or required. Open the returned `authUrl` in a browser to complete consent.

The full flow, with code for every step, is on [Connect](/platforms/meta-ads/connect#choose-a-login-mode).

## Connections and billing

A Meta Ads connection is its own account, with `platform: "metaads"` and its own `accountId`.

What else exists next to it, and who pays for spend, depends on how it was connected. See [Connections and billing](/platforms/meta-ads/connect#connections-and-billing).

## The campaign tree

Every Meta ad lives in a 3-level tree. Each level owns different settings, and that decides which endpoint you call:

<Mermaid
  chart={`flowchart TB
  C["Campaign: goal, bid strategy, budget (CBO)"] --> S1["Ad set: targeting, schedule, budget (ABO)"]
  C --> S2["Ad set"]
  S1 --> A1["Ad: creative"]
  S1 --> A2["Ad: creative"]
  S2 --> A3["Ad: creative"]`}
/>

| Level | Owns | Page |
|---|---|---|
| Campaign | Objective (`goal`), bid strategy, spend cap, the budget on CBO campaigns | [Campaigns](/platforms/meta-ads/create-ads) |
| Ad set (`adSetId`) | Targeting, schedule, optimization goal, `promotedObject`, the budget on ABO campaigns | [Ad sets](/platforms/meta-ads/ad-sets) |
| Ad | The creative: headline, body, media, call to action, link | [Creatives](/platforms/meta-ads/creatives) |

You rarely build the tree level by level:

- `POST /v1/ads/create` creates all 3 in one call
- `POST /v1/ads/boost` wraps an existing post the same way
- `GET /v1/ads/tree` reads the hierarchy back with rolled-up metrics

Which level holds the budget (CBO or ABO) decides which update endpoint accepts a budget change. The [campaigns page](/platforms/meta-ads/create-ads#reading-the-campaign-tree) explains `budgetLevel`.

## Common errors

3 errors are section-wide rather than endpoint-specific.

| Error | Cause | Fix |
|---|---|---|
| `403` `{ "error": "Ads add-on required" }` | The team is on a legacy plan without ads, or the Meta token is missing the ads permissions | Ads are included with usage-based billing; otherwise reconnect the account so the consent screen requests the ads scopes |
| `403` `ads_allowance_exceeded` | The team has no payment method on file and has reached its 500 free live ads | Add a card to resume creating and resuming ads |
| `422` `linked_account_required` | The call names an Instagram account connected with Instagram Login, which never carries ads scopes | Connect a `facebook` or `metaads` account on the same profile and call with its `accountId` |

Everything below the platform boundary comes back as `type: "platform_error"`, with Meta's own message and subcode in `platformError`.

The [reference](/platforms/meta-ads/reference#common-errors) lists the subcodes worth recognizing on sight.

## In this section

<PlatformPages platform="meta-ads" />

## Related

- [Connecting accounts](/guides/connecting-accounts): the ads-only connect flow and Page selection.
- [Facebook](/platforms/facebook) and [Instagram](/platforms/instagram): the posting accounts an ad runs as.
- [Create standalone ad](/ad-campaigns/create-standalone-ad): every field of the create request.
- [Webhooks for ads](/webhooks/ads): `lead.received` and ad status events.
- [Error handling](/guides/error-handling): the envelope every `4xx` uses, including `platform_error` with Meta's own code.