Skip to content

Ads API Reference

The Ads API runs and reads paid ads through one cross-network contract: boost a post you already published, create ads from your own creative, manage campaigns and ad sets, and pull performance reports.

Supported networks: Meta (Facebook and Instagram), Google Ads (Search, Performance Max and Display), Pinterest (promoted Pins) and TikTok (Spark Ads, video ads and image carousels). LinkedIn Ads is coming soon.

CapabilityMetaGoogle AdsPinterestTikTok
Boost a published postFacebook, InstagramNoPinsSpark Ads
Create an ad from your own creativeImage, video, carouselSearch, Performance Max, DisplayImage, video, carouselVideo, image carousel
Campaigns and ad setsYesYesYesYes
Pause / resumeYesYesYesYes
ArchiveYesNoYesNo
DeleteYesYesArchives insteadYes
validate_onlyYesYesNoNo
Analytics and insightsYesYesYesYes
Breakdowns8 dimensionsNone8 dimensions, last 90 days6 dimensions
Review statusYesYesYesYes
PreviewYesNoYesNo
Targeting searchYesYesYesYes
Browse targeting, DSA recommendationsYesNoNoNo
Keywords and negative keywordsNoYesYesNo
Search terms, Keyword PlannerNoYesNoNo
Campaign targeting, ad scheduleNoYesNoNo
IdentitiesNoNoNoYes

An operation or field a network has no equivalent for returns 501 Not Implemented.

Each network uses its own names for the three levels. The API always says campaign, ad set and ad:

APIMetaGoogle AdsPinterestTikTok
CampaignCampaignCampaignCampaignCampaign
Ad setAd setAd group (Performance Max: asset group)Ad groupAd group
AdAdAd group adPromoted PinAd

An ads connection is its own profile, separate from the profiles you publish with. Its platform is meta_ads, google_ads, pinterest_ads or tiktok_ads, and it holds the ads permissions and the ad accounts the login can reach.

Connect one from the Profiles page in the dashboard, or generate a connection link with Initialize connection using one of the ads platforms. Ads profiles cannot be posted to.

  • Stored: ad accounts, campaigns, ad sets, ads and their latest metrics are synced in the background and served from Postproxy. Ads created outside Postproxy are imported too, with source: "platform".
  • Live: every write, live=true reads, ad account health, analytics, insights, review, preview and targeting lookups go to the network. A repeat of the same live read within a few seconds returns the previous answer with "cached": true.

Every id, ad_account_id, campaign_id and ad_set_id in responses, paths, parameters and filters is a Postproxy ID. The network’s own IDs are returned next to them as platform_id, platform_ad_account_id, platform_campaign_id and platform_ad_set_id, and are not accepted as input.

campaign_id or ad_set_id is null when the parent has not been imported (objects that are not live and have not changed in 90 days are left out); the platform_ value is still there. An ad account ID names one ad account of one ads profile, so profile_id is never needed next to ad_account_id.

Stored lists paginate with page (1-based) and per_page (default 25, max 100) and return { total, page, per_page, data }. Lists read live from the network (keywords, search terms, targeting lookups, identities) return { data, next_page_token, cached }.

MethodEndpointDescription
GET/api/ads/ad_accountsList ad accounts
GET/api/ads/ad_accounts/:ad_account_idGet an ad account
GET/api/ads/ad_accounts/:ad_account_id/healthCheck ad account health
GET/api/ads/ad_accounts/:ad_account_id/identitiesList TikTok identities
POST/api/ads/boost_postBoost a published post
POST/api/adsCreate an ad
POST/api/ads/campaignsCreate a campaign
POST/api/ads/ad_setsCreate an ad set
GET/api/ads, /api/ads/campaigns, /api/ads/ad_setsList ads, campaigns, ad sets
GET/api/ads/:id, /api/ads/campaigns/:id, /api/ads/ad_sets/:idGet one
GET/api/ads/treeCampaigns with ad sets and ads nested
PATCH/api/ads/:id, /api/ads/campaigns/:id, /api/ads/ad_sets/:idUpdate
POST…/:id/pause, …/:id/resume, …/:id/archivePause, resume, archive
POST/api/ads/campaigns/update_statusesPause or activate many campaigns
DELETE/api/ads/:id, /api/ads/campaigns/:id, /api/ads/ad_sets/:idDelete
GET…/:id/analyticsAnalytics for one object
GET/api/ads/insightsReport across many objects
GET/api/ads/:id/reviewReview status
GET/api/ads/:id/previewPreview
GET/api/ads/search_targetingSearch targeting options
GET/api/ads/browse_targetingBrowse the targeting catalog
GET/api/ads/dsa_recommendationsDSA recommendations
GET POST PATCH DELETE/api/ads/keywordsKeywords
GET POST DELETE/api/ads/negative_keywordsNegative keywords
GET/api/ads/search_termsSearch terms
POST/api/ads/generate_keyword_ideasKeyword ideas
POST/api/ads/keyword_historical_metricsKeyword historical metrics
GET PATCH/api/ads/campaigns/:id/targetingCampaign targeting
GET PATCH/api/ads/campaigns/:id/ad_scheduleAd schedule

Sandbox keys work against a sandbox ads profile, connected from the dashboard in sandbox mode, for every supported network. It has two ad accounts; ads are created instantly, pass review, and accrue synthetic metrics while active. Writes, analytics, targeting lookups and webhooks behave as in live, with synthetic data. Sandbox ads do not count against the plan’s ad limit.


GET /api/ads/ad_accounts

Lists the ad accounts reachable through your ads profiles. Start here: every other ads call takes an ad account id.

ParameterTypeRequiredDescription
profile_idstringNoLimit to one ads profile. Required with live
platformstringNoOnly ad accounts of one network: meta_ads, google_ads, pinterest_ads, tiktok_ads
livebooleanNoRefetch the ad account list from the network before answering
page, per_pageintegerNoPagination
Terminal window
curl -X GET "https://api.postproxy.dev/api/ads/ad_accounts?platform=meta_ads" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"total": 1,
"page": 1,
"per_page": 25,
"data": [
{
"id": "Yq7HnB",
"platform_id": "12712117149",
"name": "Main Ad Account",
"currency": "USD",
"status": "active",
"platform": "meta_ads",
"profile_id": "OLUOa3o9E",
"profile_group_id": "lmFWNVANy",
"timezone": "America/Los_Angeles",
"timezone_offset_hours_utc": -8,
"platform_status": 1,
"disable_reason": null,
"business": { "id": "1234", "name": "Acme" },
"balance": 0.0,
"amount_spent": 152.4,
"spend_cap": null,
"minimum_daily_budget": 1.0,
"funding_source": { "id": "7846263838068845", "type": 1, "display": "Visa *4242" },
"billing_status": "ok",
"is_prepay": false,
"usable": true,
"unusable_reason": null,
"platform_data": {},
"synced_at": "2026-11-16T14:11:41.000Z"
}
]
}

See Ad account fields.


GET /api/ads/ad_accounts/:ad_account_id

Returns one ad account, in the same shape as a list entry. live=true refetches it from the network first.


GET /api/ads/ad_accounts/:ad_account_id/health

Live check of whether the account can run ads right now. Run it before creating or boosting an ad.

Terminal window
curl -X GET "https://api.postproxy.dev/api/ads/ad_accounts/Yq7HnB/health" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"id": "Yq7HnB",
"platform_id": "12712117149",
"status": "ok",
"ready": true,
"blockers": [],
"checks": [
{ "id": "account_status", "ok": true, "message": null },
{ "id": "payment", "ok": true, "message": null },
{ "id": "spend_cap", "ok": true, "message": null }
]
}

status is ok, attention (fixable, such as a missing payment method) or blocked (the account is disabled or closed). blockers holds the messages of the failed checks.


POST /api/ads/boost_post

Turns a published post into an ad. Creates the campaign, ad set and ad in one call (or attaches to existing ones) and returns the ad. If a later step fails, the campaign created by the call is removed.

The ad account decides the network. Meta boosts Facebook and Instagram posts; Pinterest promotes a Pin; TikTok runs the post as a Spark Ad. Google Ads cannot boost posts (501).

A boost is not idempotent on its own: send an Idempotency-Key header before retrying (see Idempotency).

The table describes Meta. Pinterest and TikTok take the same parameters with the differences listed in their sections.

ParameterTypeRequiredDescription
ad_account_idstringYesFrom List ad accounts
post_idstringOne ofA Postproxy post published to the ad account’s network
platform_post_idstringOne ofThe network’s post ID, for a post not published through Postproxy. On Meta it needs platform
platformstringWith platform_post_idfacebook or instagram. With post_id, picks the placement when the post went to both
post_profile_idstringNoPicks one placement of the post when several can be boosted
page_idstringNoFacebook Page ID. Needed with platform_post_id when the ID does not contain it
instagram_account_idstringWith Instagram platform_post_idInstagram account ID
ad_namestringNoDefaults to Postproxy Ad - <timestamp>
campaign_name, ad_set_namestringNoDefault to ad_name
goalstringNoengagement (default), traffic, awareness, video_views. traffic is not available for Instagram
optimization_goalstringNoPer goal: engagement post_engagement; traffic link_clicks, landing_page_views; awareness reach, impressions; video_views thruplay. Defaults to the first
statusstringNoactive (default) or paused
campaign_status, ad_set_statusstringNoDefault to status
budgetobjectYes*{ amount, type, level }. type: daily (default) or lifetime. level: ad_set (default) or campaign. Amount in the ad account currency, whole units
bid_strategystringNolowest_cost, bid_cap, cost_cap. Defaults to bid_cap when bid_amount is sent, else lowest_cost
bid_amountnumberWith bid_cap / cost_capNot allowed with lowest_cost
scheduleobjectNo{ start, end } ISO 8601. No end runs until paused. end must be at least 30 hours after the start; a lifetime budget requires it
targetingobjectNoSee Targeting. Defaults to US, ages 18 to 65
call_to_actionobjectNo{ type, link, link_title } for a link button (needs goal traffic), or { type, destination } with destination messenger, whatsapp or instagram_dm (needs goal engagement)
trackingobjectNo{ pixel_id }
url_tagsstring[]NoAppended to the ad’s links, e.g. ["utm_source=postproxy"]
special_ad_categoriesstring[]Nohousing, financial_products_services, credit, employment, issues_elections_politics, none
special_ad_category_countriesstring[]NoDefaults to the countries of the targeted locations
dsa_beneficiary, dsa_payorstringNoMust be sent together. Suggestions: DSA recommendations
attach_toobjectNo{ campaign_id } to add a new ad set and ad to a campaign, or { ad_set_id } to add only the ad (its campaign is implied)
ad_set_budget_sharing_enabledbooleanNoMeta ad set budget sharing
platformsobjectNoPer-network extras, keyed by ads platform (see the network sections)
validate_onlybooleanNoCheck the request without creating anything

* Not with attach_to.ad_set_id: the ad set already carries budget, bid and targeting, so those cannot be sent. With attach_to.campaign_id on a campaign that carries its own budget, budget cannot be sent either.

attach_to cannot be combined with budget.level: "campaign", special_ad_categories or ad_set_budget_sharing_enabled.

Instagram posts can be boosted whichever way the Instagram profile was connected. The ads connection must manage the Facebook Page linked to that Instagram account; otherwise the boost returns 422.

KeyDescription
locations{ countries, regions, cities, zips, country_groups, custom_locations }. Regions and cities are { key } objects with keys from Search targeting; a city or custom location radius needs distance_unit mile (10 to 50) or kilometer (17 to 80)
excluded_locationsSame shape
age_min, age_maxIntegers
gendersall (default), male, female
interests, behaviorsArrays of IDs from Search targeting
advantage_audienceboolean, default false
platform_targetingRaw targeting keys passed to the network as they are

Targeting IDs are network-specific: search on the ads profile the ad will run on. Google, Pinterest and TikTok use different locations shapes, described in their sections.

Terminal window
curl -X POST "https://api.postproxy.dev/api/ads/boost_post" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ad_account_id": "Yq7HnB",
"post_id": "rDt5DM9aD",
"goal": "engagement",
"status": "paused",
"budget": { "amount": 10, "type": "daily" },
"targeting": {
"locations": { "countries": ["US", "CA"] },
"age_min": 21,
"age_max": 45
}
}'

Response (201 Created):

{
"id": "Kx82LmQp",
"kind": "ad",
"platform": "meta_ads",
"platform_id": "305559959245942194",
"profile_id": "OLUOa3o9E",
"ad_account_id": "Yq7HnB",
"platform_ad_account_id": "12712117149",
"campaign_id": "c7RtY2Wn",
"platform_campaign_id": "534260176547215351",
"campaign_name": "Postproxy Ad - 2026-11-16 14:11",
"ad_set_id": "s4HdN9Zv",
"platform_ad_set_id": "532339667291788965",
"ad_set_name": "Postproxy Ad - 2026-11-16 14:11",
"name": "Postproxy Ad - 2026-11-16 14:11",
"status": "paused",
"platform_status": "PAUSED",
"configured_status": "PAUSED",
"source": "postproxy",
"ad_type": "boost",
"goal": { "type": "engagement", "title": "Get More Engagement" },
"platform_objective": "OUTCOME_ENGAGEMENT",
"optimization_goal": "POST_ENGAGEMENT",
"bid_strategy": "lowest_cost",
"budget": { "amount": 10.0, "type": "daily", "level": "ad_set", "currency": "USD", "remaining": 10.0 },
"schedule": { "start": "2026-11-16T14:11:41Z", "end": null },
"targeting": {
"age_min": 21,
"age_max": 45,
"genders": "all",
"locations": { "countries": ["US", "CA"] },
"interests": [],
"behaviors": [],
"advantage_audience": 0
},
"creative": { "id": "148287159020790067", "type": "share" },
"review": { "status": "pending", "reasons": [] },
"preview_link": "https://fb.me/HutjLU9Ggi3P",
"billing_event": "IMPRESSIONS",
"post_id": "rDt5DM9aD",
"post_profile_id": "E0fX7OYZR",
"platform_post_id": "104512345678901_122104567890123",
"metrics": {},
"platform_data": {},
"created_at": "2026-11-16T14:11:41.264Z",
"platform_created_at": "2026-11-16T14:11:41.000Z",
"updated_at": "2026-11-16T14:11:41.264Z",
"synced_at": "2026-11-16T14:11:41.264Z"
}

POST /api/ads

Creates an ad from your own creative, with its campaign and ad set (or attached to existing ones). The ad account decides the network, and each network takes its own creative: this section describes Meta; see Google Ads, Pinterest and TikTok for theirs.

Takes every Boost a post parameter except the post ones, plus:

ParameterTypeRequiredDescription
page_idstringYesFacebook Page the ad runs as
instagram_account_idstringNoInstagram account to show the ad from
linkstringYesDestination URL
mediastring[]One ofOne image or video URL
carousel_cardsobject[]One of2 to 10 cards: { media, link, headline, description }
headline, body, descriptionstringNoAd copy
headlines, bodies, descriptionsstring[]NoCopy variants, up to 5 of each; Meta mixes them and shows what performs best. Not with carousel_cards or attach_to.ad_set_id: an ad with variants needs its own ad set
attributionobject[]NoAttribution windows of the ad set: [{ event, window_days }] with event click, view or engaged_view and window_days 1 or 7
platforms.meta_ads.thumbnail_urlstringWith a videoVideo thumbnail
placementsobjectNoManual placements: publisher_platforms, facebook_positions, instagram_positions, messenger_positions, audience_network_positions, threads_positions, device_platforms. Omit for automatic placements
goalstringNoDefaults to traffic

targeting also accepts languages (locale IDs from Search targeting), work_positions, work_employers, work_industries, income, user_os and user_device.

call_to_action.type for a link button is one of LEARN_MORE, APPLY_NOW, SIGN_UP, SHOP_NOW, BOOK_TRAVEL, GET_QUOTE, CONTACT_US, DOWNLOAD or SUBSCRIBE.

Terminal window
curl -X POST "https://api.postproxy.dev/api/ads" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: spring-sale-1" \
-d '{
"ad_account_id": "Yq7HnB",
"page_id": "104512345678901",
"link": "https://example.com/spring",
"headline": "Spring sale",
"body": "20% off everything this week.",
"media": ["https://example.com/spring.jpg"],
"call_to_action": { "type": "SHOP_NOW" },
"goal": "traffic",
"status": "paused",
"budget": { "amount": 15, "type": "daily" },
"targeting": { "locations": { "countries": ["US"] } }
}'

Response (201 Created):

{
"id": "Kx82LmQp",
"kind": "ad",
"platform": "meta_ads",
"platform_id": "305559959245942194",
"profile_id": "OLUOa3o9E",
"ad_account_id": "Yq7HnB",
"platform_ad_account_id": "12712117149",
"campaign_id": "c7RtY2Wn",
"platform_campaign_id": "534260176547215351",
"campaign_name": "Postproxy Ad - 2026-11-16 14:11",
"ad_set_id": "s4HdN9Zv",
"platform_ad_set_id": "532339667291788965",
"ad_set_name": "Postproxy Ad - 2026-11-16 14:11",
"name": "Postproxy Ad - 2026-11-16 14:11",
"status": "paused",
"platform_status": "PAUSED",
"configured_status": "PAUSED",
"source": "postproxy",
"ad_type": "standalone",
"goal": { "type": "traffic", "title": "Get More Website Visitors" },
"platform_objective": "OUTCOME_TRAFFIC",
"optimization_goal": "LINK_CLICKS",
"bid_strategy": "lowest_cost",
"budget": { "amount": 15.0, "type": "daily", "level": "ad_set", "currency": "USD", "remaining": 15.0 },
"schedule": { "start": "2026-11-16T14:11:41Z", "end": null },
"targeting": {
"age_min": 18,
"age_max": 65,
"genders": "all",
"locations": { "countries": ["US"] },
"interests": [],
"behaviors": [],
"advantage_audience": 0
},
"call_to_action": { "type": "SHOP_NOW", "link": "https://example.com/spring" },
"creative": { "id": "148287159020790067", "type": "link" },
"review": { "status": "pending", "reasons": [] },
"preview_link": "https://fb.me/HutjLU9Ggi3P",
"billing_event": "IMPRESSIONS",
"post_id": null,
"post_profile_id": null,
"platform_post_id": null,
"metrics": {},
"platform_data": {},
"created_at": "2026-11-16T14:11:41.264Z",
"platform_created_at": "2026-11-16T14:11:41.000Z",
"updated_at": "2026-11-16T14:11:41.264Z",
"synced_at": "2026-11-16T14:11:41.264Z"
}

POST /api/ads/campaigns

Creates an empty campaign to put ad sets and ads into later, with Create an ad set or attach_to.campaign_id. Paused unless status is active.

ParameterTypeRequiredDescription
ad_account_idstringYes
namestringYes
statusstringNopaused (default) or active
goalstringNoengagement, traffic, awareness, video_views. Defaults to engagement on Meta, traffic on Pinterest and TikTok. Not used by Google
budgetobjectDepends{ amount, type }. Meta: optional, makes it a campaign-budget campaign. Google and Pinterest: required. TikTok: optional overall budget
bid_strategystringNoMeta, only with a budget
special_ad_categories, special_ad_category_countriesstring[]NoMeta
campaign_typestringNoGoogle: search (default) or display. A Performance Max campaign cannot be created empty; use Create an ad
bidding, schedule, targeting, network_settings, eu_political_advertisingNoGoogle, as in Create a Search ad
validate_onlybooleanNoMeta and Google
Terminal window
curl -X POST "https://api.postproxy.dev/api/ads/campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ad_account_id": "Yq7HnB",
"name": "Spring sale",
"goal": "traffic",
"budget": { "amount": 50, "type": "daily" }
}'

Response (201 Created):

{
"id": "c7RtY2Wn",
"kind": "campaign",
"platform": "meta_ads",
"platform_id": "534260176547215351",
"profile_id": "OLUOa3o9E",
"ad_account_id": "Yq7HnB",
"platform_ad_account_id": "12712117149",
"campaign_id": null,
"platform_campaign_id": null,
"campaign_name": null,
"ad_set_id": null,
"platform_ad_set_id": null,
"ad_set_name": null,
"name": "Spring sale",
"status": "paused",
"platform_status": "PAUSED",
"configured_status": "PAUSED",
"source": "postproxy",
"goal": { "type": "traffic", "title": "Get More Website Visitors" },
"platform_objective": "OUTCOME_TRAFFIC",
"bid_strategy": "lowest_cost",
"budget": { "amount": 50.0, "type": "daily", "level": "campaign", "currency": "USD", "remaining": 50.0 },
"buying_type": "AUCTION",
"spend_cap": null,
"issues": [],
"post_id": null,
"post_profile_id": null,
"platform_post_id": null,
"metrics": {},
"platform_data": {},
"created_at": "2026-11-16T14:11:41.264Z",
"platform_created_at": "2026-11-16T14:11:41.000Z",
"updated_at": "2026-11-16T14:11:41.264Z",
"synced_at": "2026-11-16T14:11:41.264Z"
}

POST /api/ads/ad_sets

Creates an ad set in an existing campaign, with no ad in it. Add ads with attach_to: { ad_set_id } in Create an ad or Boost a post. Returns the ad set (201 Created).

ParameterTypeRequiredDescription
ad_account_idstringYes
campaign_idstringYesThe campaign to put it in
namestringYes
statusstringNoactive (default) or paused
goalstringNoMeta. Defaults to the campaign’s goal
budgetobjectDepends{ amount, type }. Meta: required, unless the campaign carries the budget, in which case it cannot be sent. TikTok: required. Pinterest: not accepted (the budget lives on the campaign)
bid_amount, bid_strategy, optimization_goalNoAs in Boost a post
schedule, targeting, placementsobjectDependsAs in Boost a post; targeting.locations is required on Meta, Pinterest and TikTok
dsa_beneficiary, dsa_payorstringNoMeta
keywords, negative_keywords, bidding.max_cpcNoGoogle Search ad group
validate_onlybooleanNoMeta and Google

Send validate_only: true on Boost a post, Create an ad, Create a campaign or Create an ad set to check the request without creating anything. The call returns 200:

{ "valid": true, "validated": ["params", "campaign"] }

On Meta the parameters are validated and the campaign is dry-run on the network; the ad set and ad are not. On Google the whole request is validated. Pinterest and TikTok return 501.


GET /api/ads

GET /api/ads/campaigns

GET /api/ads/ad_sets

Lists stored objects across ad accounts, including ones created outside Postproxy. Each row is an ad object.

ParameterTypeDescription
statusstringOne or several, comma-separated: active, pending_review, paused, rejected, error, completed, archived, deleted
platformstringmeta_ads, google_ads, pinterest_ads, tiktok_ads
profile_idstringOne ads profile
ad_account_idstringOne ad account
campaign_idstringAds and ad sets of a campaign
ad_set_idstringAds of an ad set
platform_idstringThe object with this network ID
post_idstringAds boosting this Postproxy post
platform_post_idstringAds promoting the post with this network ID, whether or not it was published through Postproxy
has_deliverybooleantrue: objects with impressions; false: objects with none
min_spendnumberObjects that spent at least this much, in the ad account’s currency
include_emptybooleanCampaigns and ad sets only. false leaves out the ones with no ads. Default true
sourcestringall (default) or postproxy (created through Postproxy only)
from, toISO 8601Created on the network within this range. No effect on Google Ads
searchstringName contains, or exact network ID
sortstringnewest (default), oldest, spend_desc or spend_asc. Objects with no metrics yet come last in both spend orders
page, per_pageintegerPagination
Terminal window
curl -X GET "https://api.postproxy.dev/api/ads?status=active&ad_account_id=Yq7HnB" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"total": 1,
"page": 1,
"per_page": 25,
"data": [
{
"id": "Kx82LmQp",
"kind": "ad",
"platform": "meta_ads",
"platform_id": "305559959245942194",
"profile_id": "OLUOa3o9E",
"ad_account_id": "Yq7HnB",
"platform_ad_account_id": "12712117149",
"campaign_id": "c7RtY2Wn",
"platform_campaign_id": "534260176547215351",
"campaign_name": "Spring sale",
"ad_set_id": "s4HdN9Zv",
"platform_ad_set_id": "532339667291788965",
"ad_set_name": "Spring sale",
"name": "Spring sale",
"status": "active",
"platform_status": "ACTIVE",
"configured_status": "ACTIVE",
"source": "postproxy",
"ad_type": "boost",
"goal": { "type": "engagement", "title": "Get More Engagement" },
"platform_objective": "OUTCOME_ENGAGEMENT",
"optimization_goal": "POST_ENGAGEMENT",
"bid_strategy": "lowest_cost",
"budget": { "amount": 10.0, "type": "daily", "level": "ad_set", "currency": "USD", "remaining": 5.31 },
"schedule": { "start": "2026-11-16T14:11:41Z", "end": null },
"targeting": {
"age_min": 21,
"age_max": 45,
"genders": "all",
"locations": { "countries": ["US", "CA"] },
"interests": [],
"behaviors": [],
"advantage_audience": 0
},
"creative": { "id": "148287159020790067", "type": "share" },
"review": { "status": "approved", "reasons": [] },
"preview_link": "https://fb.me/HutjLU9Ggi3P",
"billing_event": "IMPRESSIONS",
"post_id": "rDt5DM9aD",
"post_profile_id": "E0fX7OYZR",
"platform_post_id": "104512345678901_122104567890123",
"metrics": { "spend": 41.2, "impressions": 9120, "reach": 6400, "clicks": 180, "ctr": 1.97, "currency": "USD" },
"platform_data": {},
"created_at": "2026-11-16T14:11:41.264Z",
"platform_created_at": "2026-11-16T14:11:41.000Z",
"updated_at": "2026-11-28T09:30:12.118Z",
"synced_at": "2026-11-30T15:00:02.000Z"
}
]
}

GET /api/ads/:id

GET /api/ads/campaigns/:id

GET /api/ads/ad_sets/:id

Returns one ad object with its latest synced metrics. live=true refetches the object and its metrics from the network first.


GET /api/ads/tree

Campaigns with their ad sets and ads nested (data[].ad_sets[].ads[]). Takes the list filters, applied to campaigns, plus depth: campaign, ad_set or ad (default). Paginated by campaign.


PATCH /api/ads/:id

PATCH /api/ads/ad_sets/:id

PATCH /api/ads/campaigns/:id

The table describes Meta; the other networks list the fields they accept in their sections.

FieldAdAd setCampaign
ad_name (or name)YesYesYes
status (active, paused, archived)YesYesYes
budget { amount, type }Applied to its ad setYesYes
bid_amountApplied to its ad setYesNo
targetingApplied to its ad setYesNo
schedule { start, end }Applied to its ad setYesNo
bid_strategyNoYesYes
spend_capNoNoYes
attributionNoYesNo
creativeYesNoNo

targeting replaces the whole targeting and must include locations. A field the network cannot change at that level returns 501. An ad whose budget lives on its campaign returns 422 for budget: update the campaign.

creative (Meta, ads created with Create an ad) takes any of headline, body, description, link, media (one image URL), thumbnail_url, carousel_cards, call_to_action { type, link } and, on an ad created with copy variants, headlines, bodies, descriptions. Fields left out keep their value. The ad gets a new creative, so creative.id changes and the ad goes back into review. Not possible: editing a boosted post’s creative (501; edit the post), replacing a video (501), adding variants to an ad created without them (422).

Returns the updated object, refetched from the network.


POST /api/ads/:id/pause

POST /api/ads/:id/resume

POST /api/ads/:id/archive

The same three exist under /api/ads/ad_sets/:id and /api/ads/campaigns/:id. Only the object addressed is switched; parents and siblings are left alone, so a paused parent still blocks delivery after a resume.

Returns the object plus updated. If it was already in that state, the response carries "updated": false with a skipped_reason.

archive is not available on Google Ads or TikTok (501).

Terminal window
curl -X POST "https://api.postproxy.dev/api/ads/Kx82LmQp/pause" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"id": "Kx82LmQp",
"kind": "ad",
"platform": "meta_ads",
"platform_id": "305559959245942194",
"profile_id": "OLUOa3o9E",
"ad_account_id": "Yq7HnB",
"platform_ad_account_id": "12712117149",
"campaign_id": "c7RtY2Wn",
"platform_campaign_id": "534260176547215351",
"campaign_name": "Spring sale",
"ad_set_id": "s4HdN9Zv",
"platform_ad_set_id": "532339667291788965",
"ad_set_name": "Spring sale",
"name": "Spring sale",
"status": "paused",
"platform_status": "PAUSED",
"configured_status": "PAUSED",
"source": "postproxy",
"ad_type": "boost",
"goal": { "type": "engagement", "title": "Get More Engagement" },
"platform_objective": "OUTCOME_ENGAGEMENT",
"optimization_goal": "POST_ENGAGEMENT",
"bid_strategy": "lowest_cost",
"budget": { "amount": 10.0, "type": "daily", "level": "ad_set", "currency": "USD", "remaining": 5.31 },
"schedule": { "start": "2026-11-16T14:11:41Z", "end": null },
"targeting": {
"age_min": 21,
"age_max": 45,
"genders": "all",
"locations": { "countries": ["US", "CA"] },
"interests": [],
"behaviors": [],
"advantage_audience": 0
},
"creative": { "id": "148287159020790067", "type": "share" },
"review": { "status": "approved", "reasons": [] },
"preview_link": "https://fb.me/HutjLU9Ggi3P",
"billing_event": "IMPRESSIONS",
"post_id": "rDt5DM9aD",
"post_profile_id": "E0fX7OYZR",
"platform_post_id": "104512345678901_122104567890123",
"metrics": { "spend": 41.2, "impressions": 9120, "reach": 6400, "clicks": 180, "ctr": 1.97, "currency": "USD" },
"platform_data": {},
"created_at": "2026-11-16T14:11:41.264Z",
"platform_created_at": "2026-11-16T14:11:41.000Z",
"updated_at": "2026-11-30T15:04:19.502Z",
"synced_at": "2026-11-30T15:04:19.502Z",
"updated": true
}

POST /api/ads/campaigns/update_statuses

Pauses or activates up to 50 campaigns in one call.

Terminal window
curl -X POST "https://api.postproxy.dev/api/ads/campaigns/update_statuses" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "campaign_ids": ["c7RtY2Wn", "Zk4HBg"], "status": "paused" }'
{
"status": "paused",
"data": [
{ "id": "c7RtY2Wn", "ok": true, "updated": true, "status": "paused" },
{ "id": "Zk4HBg", "ok": false, "error": "Campaign not found" }
]
}

status is active or paused. A failed item carries error instead of updated and status.


DELETE /api/ads/:id

DELETE /api/ads/ad_sets/:id

DELETE /api/ads/campaigns/:id

Deletes the object on the network. This cannot be undone. Deleting an ad also deletes its ad set and campaign when Postproxy created them and nothing else is left in them. Pinterest has no delete: the object is archived instead.

{
"deleted": true,
"id": "K6mHNZ",
"platform_id": "616815714713752294",
"status": "deleted",
"removed_parents": [{ "kind": "ad_set", "id": "Zj1HQg", "platform_id": "175364510906434831" }]
}

The object stays readable with status: "deleted".


GET /api/ads/:id/analytics

GET /api/ads/ad_sets/:id/analytics

GET /api/ads/campaigns/:id/analytics

Live performance report for one object over a date range. For many objects at once, use Insights.

ParameterTypeDescription
from, todateYYYY-MM-DD. Defaults to the last 30 days. At most 37 months back (422 beyond); Pinterest: 914 days
breakdownsstringComma-separated dimensions to split the metrics by, see below

Breakdowns per network:

NetworkBreakdowns
Metaage, gender, country, region, publisher_platform, platform_position, device_platform, impression_device
Google AdsNone
Pinterestage, gender, country, region, placement, device, interest, keyword (last 90 days only)
TikTokage, gender, country, platform, placement, language

Breakdowns the network does not offer come back in unsupported_breakdowns instead of failing.

Terminal window
curl -X GET "https://api.postproxy.dev/api/ads/Kx82LmQp/analytics?from=2026-11-01&to=2026-11-30" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"id": "Kx82LmQp",
"kind": "ad",
"platform": "meta_ads",
"platform_id": "305559959245942194",
"currency": "USD",
"range": { "from": "2026-11-01", "to": "2026-11-30" },
"summary": { "spend": 41.2, "impressions": 9120, "reach": 6400, "clicks": 180, "ctr": 1.97, "cpc": 0.23, "cpm": 4.52 },
"daily": [
{ "date": "2026-11-16", "spend": 4.69, "impressions": 297, "reach": 251, "clicks": 9 },
{ "date": "2026-11-17", "spend": 9.84, "impressions": 2190, "reach": 1764, "clicks": 44 },
{ "date": "2026-11-18", "spend": 9.97, "impressions": 2308, "reach": 1812, "clicks": 47 }
],
"breakdowns": {},
"unsupported_breakdowns": [],
"cached": false
}

summary, each daily row and each breakdown row carry the metrics the network reports.


GET /api/ads/insights

One live report across many objects of an ad account: one row per object per day.

ParameterTypeRequiredDescription
levelstringYesaccount, campaign, ad_set, ad
idsstringOne ofUp to 50 Postproxy IDs of that level, comma-separated, all in one ad account. Not with level=account
ad_account_idstringOne ofEvery object of that level in the ad account
from, todateNoAs in Analytics
metricsstringNoComma-separated subset of the metric names. Default: all
breakdownsstringNoAs in Analytics. Pinterest and TikTok take one breakdown per request
page_tokenstringNoFrom next_page_token
Terminal window
curl -X GET "https://api.postproxy.dev/api/ads/insights?level=campaign&ad_account_id=Yq7HnB&from=2026-11-01&to=2026-11-30" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"level": "campaign",
"platform": "meta_ads",
"ad_account_id": "Yq7HnB",
"platform_ad_account_id": "12712117149",
"currency": "USD",
"range": { "from": "2026-11-01", "to": "2026-11-30" },
"totals": { "spend": 24.5, "impressions": 4795, "clicks": 100 },
"data": [
{
"id": "c7RtY2Wn",
"date": "2026-11-16",
"platform_id": "534260176547215351",
"currency": "USD",
"spend": 4.69,
"impressions": 297,
"clicks": 9
},
{
"id": "c7RtY2Wn",
"date": "2026-11-17",
"platform_id": "534260176547215351",
"currency": "USD",
"spend": 9.84,
"impressions": 2190,
"clicks": 44
},
{
"id": "c7RtY2Wn",
"date": "2026-11-18",
"platform_id": "534260176547215351",
"currency": "USD",
"spend": 9.97,
"impressions": 2308,
"clicks": 47
}
],
"unsupported_breakdowns": [],
"next_page_token": null,
"cached": false
}

A row’s id is null for an object that is not imported; platform_id is always present. totals cover the returned page.


GET /api/ads/:id/review

Refetches the ad and returns its review state. Use it to see why an ad is not delivering.

{
"id": "K6mHNZ",
"platform_id": "305559959245942194",
"status": "rejected",
"platform_status": "DISAPPROVED",
"review": { "status": "rejected", "reasons": ["The ad's image contains too much text."] },
"issues": []
}

review.status is pending, approved or rejected. Google also returns approved_limited, with policy_topics.


GET /api/ads/:id/preview

Renders an ad as it appears in a placement. Meta and Pinterest only; other networks return 501.

formats (Meta) is comma-separated, among DESKTOP_FEED_STANDARD (default), MOBILE_FEED_STANDARD, INSTAGRAM_STANDARD, INSTAGRAM_STORY, INSTAGRAM_REELS, FACEBOOK_STORY_MOBILE, FACEBOOK_REELS_MOBILE, RIGHT_COLUMN_STANDARD.

Returns { id, platform_id, previews: [{ format, body }], cached } where body is the network’s iframe HTML. Pinterest returns one preview with format: "PIN" and a url that stays valid for 7 days.


GET /api/ads/search_targeting

Looks up targeting options on the network of an ads profile and returns the IDs to use in targeting.

ParameterTypeRequiredDescription
profile_idstringWhen severalThe ads profile. Optional when exactly one ads profile is connected
typestringYesWhat to search, see the table below
qstringMostlySearch text. On Meta it is optional for behavior, income, industry (lists all) and for location with location_type=region. For interest_suggestion, an interest name to get related ones
location_typestringNoNarrows a location search: country, country_group, region, city, subcity, neighborhood, zip, metro
country_code, region_idstringNoNarrow a location search
limitintegerNoDefault 25, max 100
Networktype valueslocation_type values
Metainterest, interest_suggestion, behavior, income, industry, location, language, work_position, work_employerAll
Google Adslocation, language, topic (Display)country, region, city, zip, metro
Pinterestlocation, interest, language (full list; q filters)country (default), region, metro
TikToklocation, interest, language (full list; q filters)country (default), region, city
{
"data": [
{
"id": "6003139266461",
"name": "Movies",
"type": "interest",
"path": ["Interests", "Entertainment", "Movies"],
"audience_size_lower": 1200000000,
"audience_size_upper": 1400000000
}
],
"next_page_token": null,
"cached": false
}

Location rows also carry country_code, region, region_id, supports_region and supports_city. Use id in targeting.interests, targeting.behaviors, targeting.languages, and as the key of a region or city on Meta.


GET /api/ads/browse_targeting?ad_account_id=...

The network’s full detailed-targeting catalog for an ad account, in the same row shape as Search targeting. Meta only.


GET /api/ads/dsa_recommendations?ad_account_id=...

Suggested values for dsa_beneficiary and dsa_payor, required for ads shown in the EU. Meta only.

{ "data": ["Acme Inc"], "count": 1, "cached": false }

Campaigns, ad sets and ads share one shape; kind tells them apart and fields that do not apply are left out.

{
"id": "K6mHNZ",
"kind": "ad",
"platform": "meta_ads",
"platform_id": "305559959245942194",
"profile_id": "OLUOa3o9E",
"ad_account_id": "Yq7HnB",
"platform_ad_account_id": "12712117149",
"campaign_id": "Zk4HBg",
"platform_campaign_id": "534260176547215351",
"campaign_name": "Spring launch",
"ad_set_id": "Zj1HQg",
"platform_ad_set_id": "532339667291788965",
"ad_set_name": "Spring launch",
"name": "Spring launch",
"status": "active",
"platform_status": "ACTIVE",
"configured_status": "ACTIVE",
"source": "postproxy",
"ad_type": "boost",
"goal": { "type": "engagement", "title": "Get More Engagement" },
"platform_objective": "OUTCOME_ENGAGEMENT",
"optimization_goal": "POST_ENGAGEMENT",
"bid_strategy": "bid_cap",
"bid_amount": 0.5,
"budget": { "amount": 10.0, "type": "daily", "level": "ad_set", "currency": "USD", "remaining": 10.0 },
"schedule": { "start": "2026-11-16T14:11:41Z", "end": null },
"targeting": {
"age_min": 21,
"age_max": 45,
"genders": "all",
"locations": { "countries": ["US", "CA"] },
"interests": [{ "id": "6003139266461", "name": "Movies" }],
"behaviors": [],
"advantage_audience": 0
},
"creative": { "id": "148287159020790067", "type": "share" },
"review": { "status": "approved", "reasons": [] },
"preview_link": "https://fb.me/HutjLU9Ggi3P",
"billing_event": "IMPRESSIONS",
"post_id": "rDt5DM9aD",
"post_profile_id": "E0fX7OYZR",
"platform_post_id": "123_456",
"metrics": { "spend": 0.65, "impressions": 700, "reach": 538, "clicks": 4 },
"platform_data": {},
"created_at": "2026-11-16T14:11:41.264Z",
"platform_created_at": "2026-11-16T14:11:41.000Z",
"updated_at": "2026-11-16T14:11:41.264Z",
"synced_at": "2026-11-16T15:00:02.000Z"
}
FieldTypeDescription
idstringPostproxy ID
kindstringcampaign, ad_set or ad
platformstringmeta_ads, google_ads, pinterest_ads or tiktok_ads
platform_idstringThe network’s ID
profile_idstringThe ads profile
ad_account_id, campaign_id, ad_set_idstring | nullPostproxy IDs of the parents. null when the parent is not imported
platform_ad_account_id, platform_campaign_id, platform_ad_set_idstring | nullThe network’s IDs of the parents
campaign_name, ad_set_name, namestring | nullNames
statusstringNormalised: active, pending_review, paused, rejected, error, completed, archived, deleted
platform_statusstringThe network’s effective status, as is
configured_statusstringThe on/off switch set on this object, as is
sourcestringpostproxy (created through Postproxy) or platform (imported)
ad_typestringAds only: boost or standalone
goalobject{ type, title }
budgetobjectPresent on the level that owns the budget, and on its ads
scheduleobject{ start, end }
targeting, placements, call_to_action, creativeobjectAs the network returns them, normalised where the networks agree
reviewobjectAds only: { status, reasons } with status pending, approved, rejected (Google also approved_limited)
issuesobject[]{ code, summary, message } delivery issues
post_id, post_profile_id, platform_post_idstring | nullThe boosted post, when there is one
metricsobjectSee Metrics. Empty until the first sync with delivery
platform_dataobjectThe network’s raw object
created_at, platform_created_at, updated_at, synced_atstringISO 8601 timestamps

Campaigns add buying_type, spend_cap and issues. Ad sets add learning_status, destination_type and placements. Network-specific keys are listed in the network sections.

metrics on an object holds lifetime totals from the last sync (Pinterest: 90-day totals). Keys the network does not report are absent:

spend, impressions, reach, frequency, clicks, ctr, cpc, cpm, cpp, engagement, unique_clicks, unique_ctr, cost_per_unique_click, inline_link_clicks, cost_per_inline_link_click, outbound_clicks, cost_per_outbound_click, conversions, cost_per_conversion, conversion_value, roas, actions, video_plays, video_p25, video_p50, video_p75, video_p100, video_thruplays, cost_per_thruplay, currency.

FieldTypeDescription
idstringPostproxy ID, the one every ads call takes
platform_idstringThe network’s ID
name, currency, timezonestring
statusstringactive, restricted, disabled or closed
platformstringmeta_ads, google_ads, pinterest_ads or tiktok_ads
profile_id, profile_group_idstringThe ads profile and its profile group
billing_statusstringok, missing or unknown
usablebooleanWhether ads can be created on the account
unusable_reasonstring | nullWhy not
platform_dataobjectThe network’s raw object
synced_atstringISO 8601

Each network adds its own keys, such as balance, amount_spent, spend_cap, minimum_daily_budget, funding_source and business on Meta. Money fields are in the ad account’s currency, in whole units.


A Google Ads profile (platform: "google_ads") uses the same endpoints. What differs:

  • Ad accounts. Every client account the login can reach is listed, including accounts reached through a manager account (login_customer_id shows which manager).
  • IDs. An ad’s platform_id is <ad group id>~<ad id>. Ads have no name.
  • Schedule times come back in the ad account’s time zone with no offset, such as 2026-11-27T12:18:05. Times you send may carry an offset; they are converted to the account’s time zone.
  • Not available (501): boosting a post, previews, archive, DSA recommendations, targeting browse. Breakdowns are returned in unsupported_breakdowns.
  • Campaign types. campaign_type is search (default), performance_max or display. When an ad is attached to an existing campaign, the type is taken from that campaign.
  • Updates: campaign name, status, budget, schedule, bidding; ad group name, status, bid_amount (max CPC) and, for Display, targeting; asset group name, status, creative; ad status only.
  • Changing the bid strategy: PATCH /api/ads/campaigns/:id with bidding: { strategy, target_cpa, target_roas, max_cpc }, the same object as at create; strategy is required and must be one the campaign’s type allows.
  • Shared budgets. budget.shared is true when the campaign’s budget is shared with other campaigns. Changing it changes it for all of them, so the update must say so: budget: { amount, shared: true }; without it the response is 422. A shared budget is always a daily one.
  • Targeting search offers type=location, type=language and type=topic. Location IDs go into targeting.locations; language IDs into campaign targeting; topic IDs into a Display ad group’s targeting.topics.

POST /api/ads

Creates the budget, campaign, ad group, keywords and a responsive search ad in one atomic call: if Google refuses any part, nothing is created.

ParameterTypeRequiredDescription
ad_account_idstringYes
campaign_typestringNosearch (default)
campaign_name, ad_set_namestringNo
final_urlstringYesLanding page
headlinesstring[]Yes3 to 15, each up to 30 characters, unique
descriptionsstring[]Yes2 to 4, each up to 90 characters, unique
path1, path2stringNoDisplay path, up to 15 characters each; path2 needs path1
keywordsarrayYes*{ text, match_type, bid } or plain strings. match_type: exact, phrase, broad (default). Text up to 80 characters and 10 words
negative_keywordsarrayNoSame shape, added to the ad group
budgetobjectYes*{ amount, type }, daily (default) or lifetime. A lifetime budget needs schedule.start and schedule.end
biddingobjectNo{ strategy, target_cpa, max_cpc }. strategy: maximize_clicks (default, optional max_cpc ceiling), manual_cpc (needs max_cpc), maximize_conversions, target_cpa (needs target_cpa)
scheduleobjectNo{ start, end } ISO 8601, applied in the ad account’s time zone
targetingobjectNo{ locations: [ids], excluded_locations: [ids], location_targeting_type }. location_targeting_type: presence or presence_or_interest. languages is not accepted for Search
network_settingsobjectNo{ search_partners, display_network }, both default false
eu_political_advertisingbooleanNoDefault false
statusstringNoStatus of the ad and campaign, active (default) or paused. campaign_status and ad_set_status override per level
attach_toobjectNo{ campaign_id } adds a new ad group and ad to a campaign; { campaign_id, ad_set_id } adds only the ad
validate_onlybooleanNoGoogle validates the whole request and creates nothing

* Not with attach_to: no budget with a campaign, no keywords with an ad group.

Terminal window
curl -X POST "https://api.postproxy.dev/api/ads" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ad_account_id": "Gd3PqR7",
"campaign_name": "Running shoes",
"final_url": "https://example.com/shoes",
"headlines": ["Running Shoes", "Free Shipping", "Shop the Sale"],
"descriptions": ["Lightweight shoes for every runner.", "Order today, free returns."],
"keywords": [{ "text": "running shoes", "match_type": "phrase" }],
"budget": { "amount": 20 },
"bidding": { "strategy": "maximize_clicks", "max_cpc": 2 },
"targeting": { "locations": ["2840"] },
"status": "paused"
}'

POST /api/ads/campaigns creates a Search campaign alone (name, budget, and the campaign parameters above; paused by default). POST /api/ads/ad_sets creates an ad group in it: campaign_id, name, status, keywords, negative_keywords, bidding.max_cpc.

Campaign objects add campaign_type, bidding, network_settings, location_targeting_type and eu_political_advertising. Ads carry creative { headlines, descriptions, final_urls, path1, path2 } and review { status, reasons, policy_topics }.

POST /api/ads

With campaign_type: "performance_max". Creates the budget, campaign, assets and one asset group in one atomic call. A Performance Max campaign has no ad groups or ads; its asset group is an ad set with ad_set_type: "asset_group". The response is the campaign (kind: "campaign") plus asset_group_id (that ad set’s ID) and platform_asset_group_id. Images are fetched from your URLs (GIF, JPG or PNG, up to 5120 KB each).

ParameterTypeRequiredDescription
final_urlstringYesLanding page
business_namestringYesUp to 25 characters
headlinesstring[]Yes3 to 15, each up to 30 characters
long_headlinesstring[]Yes1 to 5, each up to 90 characters
descriptionsstring[]Yes2 to 5, each up to 90 characters
assets.marketing_imagesstring[]Yes1 to 20 landscape images (1.91:1, at least 600x314)
assets.square_marketing_imagesstring[]Yes1 to 20 square images (at least 300x300)
assets.logosstring[]Yes1 to 5 square logos (at least 128x128)
assets.portrait_marketing_imagesstring[]NoUp to 20 portrait images (4:5)
assets.landscape_logosstring[]NoUp to 5 wide logos (4:1)
assets.youtube_video_idstringNoA YouTube video ID
budgetobjectYesAs for Search
biddingobjectNostrategy: maximize_conversions (default), target_cpa (needs target_cpa), maximize_conversion_value, target_roas (needs target_roas, a ratio such as 3.5)
targeting.locations, targeting.excluded_locationsstring[]NoLocation IDs from Search targeting
ad_set_namestringNoName of the asset group
validate_onlybooleanNoGoogle checks the whole request and creates nothing

Not accepted: keywords, network_settings, attach_to. Google checks image proportions and refuses the whole call if one is off. The campaign can be paused, renamed, re-budgeted and re-bid.

Asset groups appear in GET /api/ads/ad_sets (filter with campaign_id), GET /api/ads/ad_sets/:id and the tree, with ad_set_type: "asset_group", a platform_id of the form asset_group~<id>, their own metrics and a creative: headlines, long_headlines, descriptions, business_name, images, youtube_video_ids, final_urls, link. Analytics, pause, resume and delete work as for any ad set.

PATCH /api/ads/ad_sets/:id on an asset group takes name, status and creative with any of final_url, business_name, headlines, long_headlines, descriptions and assets. Each field sent replaces all assets of that kind and must meet the counts and lengths of the create table; fields left out stay as they are. targeting and bid_amount return 501: a Performance Max campaign targets and bids at campaign level.

POST /api/ads

With campaign_type: "display". Creates the budget, campaign, ad group, image assets and a responsive display ad in one atomic call, and returns the ad.

ParameterTypeRequiredDescription
final_urlstringYesLanding page
business_namestringYesUp to 25 characters
headlinesstring[]Yes1 to 5, each up to 30 characters
long_headlinesstring[]YesExactly 1, up to 90 characters
descriptionsstring[]Yes1 to 5, each up to 90 characters
assets.marketing_imagesstring[]YesLandscape images (1.91:1, at least 600x314)
assets.square_marketing_imagesstring[]YesSquare images (at least 300x300); at most 15 with the landscape ones
assets.logos, assets.landscape_logosstring[]NoSquare (1:1) and wide (4:1) logos, at most 5 together
assets.youtube_video_idstringNoA YouTube video ID
budget, bidding, targeting, scheduleAs for Search
targeting.placementsstring[]NoWebsites the ads may show on, such as example.com or news.example.org/sport
targeting.topicsstring[]NoTopic IDs from search_targeting?type=topic
attach_toobjectNo{ campaign_id } or { ad_set_id } of an existing Display campaign or ad group

Not accepted: keywords, network_settings. An empty Display campaign and ad group can also be created with POST /api/ads/campaigns (campaign_type: "display") and POST /api/ads/ad_sets, which takes targeting.placements and targeting.topics too.

A Display ad group returns targeting { placements, topics: [{ id, name }] }. PATCH /api/ads/ad_sets/:id with targeting: { placements, topics } replaces the kinds it names and leaves the other alone; an empty list removes that kind.

GET /api/ads/keywords

POST /api/ads/keywords

PATCH /api/ads/keywords/:id

DELETE /api/ads/keywords/:id

All keyword endpoints take ad_account_id. Keywords and negative keywords also work for Pinterest; the other keyword endpoints are Google Ads only (501 elsewhere).

OperationParametersReturns
Listcampaign_id, ad_set_id, status (active, paused), from, to (default last 30 days){ data: [keyword], range }
Addad_set_id, keywords: [{ text, match_type, bid }], up to 200201 with { data: [{ id }] }
Updatestatus (active, paused) and / or bid (max CPC){ id, updated, status, bid }
Remove{ deleted, id }

A keyword row has id, text, match_type, status, bid, quality_score, campaign_id, platform_campaign_id, ad_set_id, platform_ad_set_id, review and metrics, with search_impression_share among the metrics. A keyword id is the network’s own, <ad group id>~<criterion id>: URL-encode it in paths.

Terminal window
curl -X POST "https://api.postproxy.dev/api/ads/keywords" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ad_account_id": "Gd3PqR7",
"ad_set_id": "s4HdN9Zv",
"keywords": [
{ "text": "running shoes", "match_type": "phrase" },
{ "text": "trail running shoes", "match_type": "exact", "bid": 1.2 }
]
}'

Response (201 Created):

{
"data": [
{ "id": "158834096621~301245790011" },
{ "id": "158834096621~301245790012" }
]
}

GET /api/ads/negative_keywords

POST /api/ads/negative_keywords

DELETE /api/ads/negative_keywords/:id

Pass campaign_id for campaign-level negatives or ad_set_id for ad-group-level ones. Add with keywords: [{ text, match_type }]. Rows are { id, level, text, match_type, campaign_id, ad_set_id }.

GET /api/ads/search_terms

What people searched for before seeing an ad, with metrics: top 1000 by impressions. Takes ad_account_id, campaign_id and / or ad_set_id, from, to. Each row: term, status, campaign_id, platform_campaign_id, ad_set_id, platform_ad_set_id, metrics.

POST /api/ads/generate_keyword_ideas

POST /api/ads/keyword_historical_metrics

Both create nothing. Ideas take ad_account_id, keywords (up to 20) and / or url, plus optional locations (IDs) and language (ID), and return up to 100 rows of text, avg_monthly_searches, competition, competition_index, low_bid, high_bid. Historical metrics take keywords and add monthly_searches: [{ year, month, searches }].

GET /api/ads/campaigns/:id/targeting

PATCH /api/ads/campaigns/:id/targeting

{
"locations": ["2840"],
"excluded_locations": [],
"languages": ["1000"],
"devices": [{ "device": "mobile", "bid_modifier": 1.2 }],
"location_targeting_type": "presence"
}

Each list you send replaces that list; lists you leave out stay. device: mobile, desktop, tablet, connected_tv. bid_modifier is 0 to 10; 1 is no change.

GET /api/ads/campaigns/:id/ad_schedule

PATCH /api/ads/campaigns/:id/ad_schedule

{ "schedule": [{ "day": "monday", "start": "09:00", "end": "17:30", "bid_modifier": 1.1 }] }

PATCH replaces the whole schedule; minutes must be 00, 15, 30 or 45. An empty list runs the campaign at all hours. GET returns { data: [{ day, start, end, bid_modifier }] }.


A Pinterest Ads profile (platform: "pinterest_ads") uses the same endpoints to promote Pins. What differs:

  • platform_post_id is the Pin ID. Every ad promotes a Pin, so ad_type is boost for all Pinterest ads. Create an ad saves a public Pin to the board you name and promotes it.
  • The budget lives on the campaign. budget.level is campaign and ad sets show no budget. Bid and targeting live on the ad set.
  • Ad accounts carry country, owner, permissions and timezone. usable is false when the connection can only read the account (it needs the Owner, Admin or Campaign Manager role).
  • metrics on an object are 90-day totals, not lifetime.
  • Analytics and insights go back 914 days. A range inside the last 90 days, at most 90 days long, is answered straight away. An older or longer range is built by Pinterest as a report and may return 429 with Retry-After: repeat the same request. Beyond 914 days the response is 422.
  • Breakdowns cover the last 90 days only (422 further back), one per request on Insights.
  • Delete archives. DELETE sets the object to archived, and parents created with the ad are archived once empty.
  • Not available (501): validate_only, budget changes addressed to an ad set or ad, creative edits, DSA recommendations, targeting browse.
  • Updates: campaign name, status, budget, schedule; ad set name, status, bid_amount, targeting; ad name, status.

POST /api/ads/boost_post

Parameters as in Boost a post, with these differences:

ParameterTypeRequiredDescription
platform_post_idstringInstead of post_idA Pin ID, for a Pin not published through Postproxy
goalstringNotraffic (default), awareness, video_views
budgetobjectYes, unless attach_to{ amount, type }, type daily (default) or lifetime; a lifetime budget needs schedule.end. Set on the campaign
bid_strategystringNolowest_cost (default), bid_cap or cost_cap; the last two need bid_amount and are not available for video_views
targeting.locationsobjectYesAny of countries (ISO codes), metros, regions (such as US-CA), zips; regions and zips cannot be combined
targeting.excluded_locationsobjectNoSame shape
targeting.gendersstringNoall (default), male, female
targeting.age_min, targeting.age_maxintegerNo18 to 65; 65 means 65 and over
targeting.interestsstring[]NoInterest IDs from Search targeting
targeting.languagesstring[]NoLocale codes from Search targeting, such as en-US
targeting.user_devicestring[]Noandroid_mobile, android_tablet, ipad, iphone, web, web_mobile
targeting.platform_targetingobjectNoRaw Pinterest targeting_spec keys, merged over the rest (audiences go here)
call_to_actionobjectNo{ type, link }: a button label such as SHOP_NOW or LEARN_MORE, and a destination URL that overrides the Pin’s link
platforms.pinterest_ads.placement_groupstringNoall (default), search, browse
platforms.pinterest_ads.auto_targetingbooleanNoPinterest’s expanded targeting. Default true

budget.level: "ad_set", special_ad_categories, tracking and the DSA fields are not accepted. With attach_to.campaign_id no budget is sent; with attach_to.ad_set_id no bid or targeting either.

Terminal window
curl -X POST "https://api.postproxy.dev/api/ads/boost_post" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ad_account_id": "Pn5KdW2",
"post_id": "abc123xyz",
"status": "paused",
"budget": { "amount": 25 },
"targeting": { "locations": { "countries": ["US"] }, "interests": ["935249274030"] }
}'

POST /api/ads takes the boost parameters (no post_id) plus board_id (required, the board the Pin is saved to, from placements), link (required), headline, body and one of:

  • media with one image URL;
  • media with one video URL (.mp4, .mov, .m4v), with platforms.pinterest_ads.thumbnail_url as the cover (the first frame is used without it). If Pinterest is still processing the video the response is 429 with Retry-After; repeat the same request;
  • carousel_cards: 2 to 5 cards { media, headline, description, link } with image URLs; a card without link uses the top-level one.

If Pinterest refuses the ad, the Pin is deleted and the campaign created by the call is archived.

POST /api/ads/campaigns: name and budget are required, goal defaults to traffic, status to paused. Add ads with attach_to: { campaign_id }; the ad’s goal must match the campaign’s.

POST /api/ads/ad_sets creates an ad group in a campaign: campaign_id, name and targeting.locations are required; status, bid_strategy, bid_amount, targeting and platforms.pinterest_ads.placement_group / auto_targeting work as on boost. No budget and no goal: the campaign’s are used.

The keyword endpoints work for Pinterest ad accounts too, with these differences:

  • GET /api/ads/keywords needs ad_set_id or campaign_id; rows are id, text, match_type, status, level, ad_set_id, platform_ad_set_id, without metrics. Use the keyword breakdown for performance.
  • POST /api/ads/keywords takes ad_set_id and keywords: [{ text, match_type }] (broad default, phrase, exact; up to 120 characters). No bid: Pinterest keywords use the ad set’s bid.
  • GET / POST /api/ads/negative_keywords take campaign_id or ad_set_id.
  • DELETE archives the keyword. PATCH returns 501.
  • Search terms, keyword ideas and historical metrics are Google Ads only.

A TikTok Ads profile (platform: "tiktok_ads") uses the same endpoints. What differs:

  • Budget, bid, schedule and targeting live on the ad set. A campaign can carry an optional overall budget.
  • Boosting is a Spark Ad: the ad runs an existing TikTok post. ad_type is boost for Spark Ads and standalone for ads built from an uploaded video.
  • Ads are video ads or image carousels. One or more image URLs make a carousel ad.
  • Not available (501): validate_only, archive, previews, schedule changes on a campaign, DSA recommendations, targeting browse.
  • Updates: campaign name, status, budget; ad set name, status, budget, bid_amount, targeting, schedule; ad name, status.
  • Breakdowns are one per request on Insights. Breakdown rows carry spend, impressions, clicks and conversions only.

GET /api/ads/ad_accounts/:ad_account_id/identities

The TikTok accounts and custom identities an ad can run as. Use id and type as platforms.tiktok_ads.identity_id and identity_type. Other networks return 501.

{
"data": [
{ "id": "7301234567890123456", "type": "TT_USER", "name": "acme" },
{ "id": "7309876543210987654", "type": "CUSTOMIZED_USER", "name": "Acme Store" }
]
}

POST /api/ads/boost_post

Parameters as in Boost a post, with these differences:

ParameterTypeRequiredDescription
platform_post_idstringInstead of post_idA TikTok post ID
goalstringNovideo_views (default), traffic, awareness, engagement (followers). traffic needs call_to_action.link
budgetobjectYes{ amount, type }, type daily (default) or lifetime; a lifetime budget needs schedule.end. level must be ad_set if sent
bid_strategystringNolowest_cost (default) or bid_cap with bid_amount
targeting.locationsarrayYesISO country codes and / or location IDs from Search targeting
targeting.gendersstringNoall (default), male, female
targeting.age_min, targeting.age_maxintegerNo13 to 100; mapped to TikTok’s age groups (13-17, 18-24, 25-34, 35-44, 45-54, 55+)
targeting.interestsstring[]NoInterest category IDs from Search targeting
targeting.languagesstring[]NoLanguage codes from Search targeting
targeting.user_osstring[]Noandroid, ios
targeting.platform_targetingobjectNoRaw TikTok ad group fields, merged over the rest
call_to_actionobjectNo{ type, link }, type such as LEARN_MORE or SHOP_NOW
platforms.tiktok_ads.identity_idstringNoThe TikTok identity that owns the post
platforms.tiktok_ads.identity_typestringNoTT_USER (default), BC_AUTH_TT or AUTH_CODE
platforms.tiktok_ads.auth_codestringNoA Spark Ads authorization code generated for the post in the TikTok app; replaces the identity
platforms.tiktok_ads.authorization_daysintegerNo7, 30 (default), 60, 180 or 365

TikTok needs to know which TikTok account owns the post. It is taken from auth_code, then identity_id, then the TikTok accounts linked to the ad account. If none of those settles it and the post was published through a TikTok Business profile on Postproxy, the post is authorized for ads automatically, for authorization_days. Otherwise the call returns 422 and lists the linked accounts.

POST /api/ads takes the boost parameters (no post_id; goal defaults to traffic) plus:

ParameterTypeRequiredDescription
mediastring[]YesOne video URL, or several image URLs for a carousel. A video and images cannot be mixed
carousel_cardsobject[]NoAlternative to media for a carousel: [{ media }], up to 35. Cards carry no text or link of their own
bodystringNoThe ad text, up to 100 characters
linkstringNoDestination URL
platforms.tiktok_ads.identity_idstringYesFrom List TikTok identities. identity_type defaults to CUSTOMIZED_USER
platforms.tiktok_ads.thumbnail_urlstringNoCover image. TikTok’s own cover of the video is used when it is left out
platforms.tiktok_ads.music_idstringWith a carouselThe track played with the carousel: a song_clip_id from TikTok trending music

POST /api/ads/campaigns: name (required), goal (default traffic), status (default paused), optional budget { amount, type } as the campaign’s overall budget.

POST /api/ads/ad_sets creates an ad group in a campaign: campaign_id, name, budget and targeting.locations are required; status, bid_strategy, bid_amount, schedule and targeting work as on boost. The campaign’s goal is used.


Subscribe through the Webhooks API. Events come from writes made through Postproxy and from changes found on the network.

EventWhen
ad.created, ad_set.created, campaign.createdCreated through Postproxy, or first seen on the network after the initial import
ad.updated, ad_set.updated, campaign.updatedName, budget, bid, schedule, targeting or creative changed. changes lists which
ad.status_changed, ad_set.status_changed, campaign.status_changedstatus changed. previous_status carries the old value
ad.approved, ad.rejectedReview outcome changed
ad.delivery_issuestatus became error
ad.deletedstatus became deleted
ad_account.status_changedAd account status changed, or the account is no longer reachable (removed). Carries previous_status
ad_account.syncedFirst import finished. Carries sync: { campaigns, ad_sets, ads }
ad_account.sync_failedA sync failed. Carries error: { category, message } with category token_invalid, permission_denied, rate_limited or sync_error
ad_account.spend_syncedOnce a day per ad account. Carries spend: { date, amount, currency } for the previous UTC day

The payload is the ad object without platform_data (ad, ad set and campaign events) or the ad account without platform_data (ad account events), plus the extra keys above. The first import of an ad account sends only ad_account.synced.


StatusWhen
400Invalid or missing parameter
403The ads connection lacks permission for the ad account or post
403Ad limit reached: the Free plan creates 2 ads in total through POST /api/ads and POST /api/ads/boost_post. Sandbox ads are not counted; reads, updates and ads created on the network are not limited
404Unknown profile, ad account, post or object
422The network rejected the request, the post cannot be boosted, or the ads profile needs reconnecting
429The network is rate limiting, or a report is still being built; retry after the Retry-After header
501The network has no equivalent for this operation or field
502The network could not be reached; retry in a moment
503The API is temporarily unavailable; retry after the Retry-After header

With several ads profiles connected and no ad_account_id or profile_id in the request, the call returns 400: pass profile_id. With no ads profile connected it returns 422.