Ads APIAPI

Paid campaigns on your connected ad accounts, through one API

Connect an ad account once and FoPost speaks to each network for you. Turn a post that is doing well into an ad, manage the campaign tree, pause what is not working, and pull insights in one shape whichever network runs the ad.

POST /v1/ads/boost
curl -X POST https://api.fopost.com/v1/ads/boost \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "9b2f6c1e-...",
    "connectionId": "3f6a9d27-...",
    "adAccountId": "act_1234567890",
    "postId": "7d3e0a52-...",
    "accountId": "4a71d80b-...",
    "name": "Boost: launch day",
    "goal": "engagement",
    "budget": { "minor": 2000, "type": "daily" },
    "targeting": { "countries": ["US", "CA"], "ageMin": 25, "ageMax": 54, "gender": "all" }
  }'

{
  "data": {
    "id": "c1d8e4b6-...", "kind": "boost", "name": "Boost: launch day", "goal": "engagement",
    "status": "paused", "effectiveStatus": "PAUSED", "platform": "instagram-business",
    "sourcePostId": "7d3e0a52-...", "budgetMinor": 2000, "budgetType": "daily",
    "currency": "USD", "insights": null, "lastError": null, "createdAt": "2026-11-12T10:04:51Z"
  }
}

Boost a post

Promote a post you already published, without rebuilding the creative.

Starts paused

New ads are created paused unless you pass paused: false.

One insights shape

Impressions, reach, clicks, spend, CTR, and leads, the same on every network.

Connect

The ad networks your team already uses

Meta, Google, LinkedIn, TikTok, Pinterest, and X ad accounts connect through each network’s own login. GET /v1/ads/providers lists every network with what it supports, and boosting works for posts published to Facebook, Instagram, LinkedIn, TikTok, Pinterest, and X. Google has no post to promote, so its ads are built rather than boosted.

Read the connections reference
Connected accounts across every network in one workspace

Capabilities per network

Each provider says whether it offers boosting, lead forms, pixels, and more.

Existing ads too

GET /v1/ads/external lists ads made in the network’s own manager.

Workspace scoped

A connection belongs to one workspace and is only reachable from it.

Build

Campaigns, ad sets, ads, creatives, and audiences

When a boost is not enough, build the full tree: POST /v1/ads/campaigns, /v1/ads/ad-sets, and /v1/ads/ads, with creatives and saved audiences alongside. Goals cover engagement, traffic, awareness, video views, messages, calls, WhatsApp, and sales, as far as each network runs them. Pause or resume up to 50 objects in one call.

See the campaign endpoints
POST /v1/ads/status
curl -X POST https://api.fopost.com/v1/ads/status \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspaceId": "9b2f6c1e-...",
    "connectionId": "3f6a9d27-...",
    "status": "paused",
    "objects": [
      { "id": "120210000000001", "level": "campaign" },
      { "id": "120210000000042", "level": "ad_set" }
    ]
  }'

{
  "data": [
    { "id": "120210000000001", "level": "campaign", "ok": true, "error": null },
    { "id": "120210000000042", "level": "ad_set", "ok": true, "error": null }
  ]
}

Duplicate

Copy a campaign, ad set, or ad. Copies start paused by default.

Audiences

Create saved audiences and search the targeting options a network offers.

Spend needs publish

Launching, boosting, pausing, or deleting requires the publish scope.

Measure

Read results without learning each reporting API

GET /v1/ads/insights takes an object id and a date range and returns totals, an optional breakdown by age, gender, placement, or country, and a daily timeline. Spend is in the ad account’s currency, in minor units. For Google Ads, POST /v1/ads/insights/query runs a Google Ads query against the connected customer.

Read the insights reference
GET /v1/ads/insights
curl "https://api.fopost.com/v1/ads/insights?workspace_id=9b2f6c1e-...&connection_id=3f6a9d27-...&object_id=120210000000001&since=2026-11-01&until=2026-11-11&breakdown=country" \
  -H "X-API-Key: $API_KEY"

{
  "data": {
    "objectId": "120210000000001", "currency": "USD",
    "since": "2026-11-01", "until": "2026-11-11", "breakdownBy": "country",
    "totals": { "impressions": 48210, "reach": 31977, "clicks": 1204, "spendMinor": 22000, "ctr": 2.5, "leads": 0 },
    "breakdown": [{ "key": "US", "metrics": { "impressions": 39102, "clicks": 1003, ... } }],
    "timeline": []
  }
}

Any date range

since and until in the ad account’s time zone; add daily=true for a timeline.

Refresh an ad

POST /v1/ads/:id/refresh pulls current status and lifetime numbers.

Minor units

Budgets and spend are integers in the smallest currency unit.

Follow up

Leads, ad comments, and conversion tracking

Create lead forms on Meta and LinkedIn and read the leads each form collects. Subscribe a Page and its new leads arrive in GET /v1/ads/leads as the network reports them. On TikTok, read the comments under an ad and reply to or hide them. Manage pixels on Meta, LinkedIn, and TikTok, and send conversion events back to the network.

Start building
Analytics overview across connected accounts

Leads feed

One paginated list of leads across every subscribed Page.

Ad comments

POST /v1/ads/comments/:id/reply and /hide on TikTok ads.

Pixels

Create, share, and read stats and match quality for a pixel.

Ads API questions, answered

Which ad networks are supported?

Meta, Google, LinkedIn, TikTok, Pinterest, and X. Features differ by network; GET /v1/ads/providers returns what each one supports and whether it is open to connect.

Will an API call start spending money?

Only if you ask it to. New boosts, ads, and copies are created paused by default, and every call that launches, boosts, pauses, or deletes needs a key with the publish scope.

Who pays for the ads?

The ad network bills your own ad account, as it would for an ad made in its manager.

Can I manage ads I created somewhere else?

Yes. Ads made in the network’s own manager are listed through GET /v1/ads/external, and their campaigns, ad sets, and ads can be read, paused, and resumed by id.

Which API key scopes do I need?

Reading needs the ads scope. Launching, boosting, pausing, resuming, or deleting also needs publish.

Is there a rate limit?

Yes, 100 requests per minute per key. Ad networks apply their own limits too, and a refusal comes back with the network’s message.

Build on the Ads API today

Starting is free and the full API is included. Create a key and make your first call in minutes.

Get your API key