Ads
Ads runs on a profile's Meta Ads account, which is connected separately from
its Facebook Page: connect with platform: "meta_ads", then
pass that account's accountId (or the profileId) to these endpoints. A
Facebook Pages accountId is not accepted and returns 404 account_not_found.
The same endpoints serve Meta Ads, TikTok Ads and LinkedIn Ads.
accountId names the ads connection, a meta_ads, tiktok_ads or
linkedin_ads account, and through it the network. With only profileId,
Adeli uses the profile's single ads connection; when a profile has more than
one, pass accountId or platform (meta_ads, tiktok_ads or
linkedin_ads), or the request fails with 400 ambiguous_account. Responses
carry the network in platform. Meta ad account ids look like act_<digits>;
TikTok advertiser ids are digits only. TikTok calls ad sets ad groups; they
are returned in the same adSets field.
Some endpoints exist on some networks only and answer 400 unsupported_for_platform on the others: businesses, ad account details and
settings, lead forms, campaign updates, ad set and ad deletion, reach
estimates and Instagram accounts are Meta only; ad identities are TikTok only.
Meta Ads campaigns
Create campaign builds a Meta campaign from an
objective (traffic, engagement, awareness, video views, leads, conversions or
app installs), a daily or lifetime budget, a schedule, a bid strategy,
targeting found with Targeting options and sized
with Estimate reach, and a new image, video or
carousel ad, or it boosts a Page or Instagram post. validateOnly: true has
Meta check it without creating anything. Everything is created paused; only
Update ad status spends. After launch,
Update ad group changes an ad set's budget,
bid, schedule and targeting, Update campaign a
campaign's budget, bid strategy and spend cap, and single ad sets and ads can be
deleted. Insights break results down by age,
gender, place and placement, with actions, values, ROAS and cost per result.
LinkedIn Ads
LinkedIn Ads is its own connection, separate from the LinkedIn account used for
posting: connect it with platform: "linkedin_ads" on
Start a connection. It asks for r_basicprofile, r_ads,
rw_ads, r_ads_reporting, and r_organization_social, and reaches every ad
account the member has a role on. A member whose role on an account is Viewer
can read it but not change it (403 ad_account_read_only).
LinkedIn's levels map onto the same fields: campaigns are campaign groups,
adSets are campaigns (which hold the budget and targeting), and ads are
creatives. Pass level (campaign, ad_group, ad) when changing a status.
Create a campaign sponsors an existing post by
the ad account's own Page and creates every object as a draft: nothing
spends until Update ad status activates the
campaign group, which activates its campaign and ad with it. LinkedIn then
reviews the ad. Audience breakdowns are professional demographics (job
function, seniority, industry, company size, country), reported up to a day
late.
TikTok Ads
TikTok Ads is its own connection, separate from the TikTok account used for
posting: connect it with platform: "tiktok_ads" on
Start a connection. It authorizes an advertiser through the
TikTok for Business Marketing API and reaches every ad account the authorizing
user grants. Campaigns are created with every object disabled: nothing
spends until Update ad status activates the ad.
TikTok reports ad metrics with a delay of a few hours.
A Meta Ads account asks for ads_management, business_management,
pages_manage_ads, leads_retrieval, pages_show_list, and
pages_read_engagement. It uses ads_management for reads and management and does not
request ads_read, which ads_management already covers. After authorizing,
the person chooses the Page ads are created from; it can be the same Page as
the profile's Facebook account or a different one, and ads are published as
that Page. An ad can also run as an Instagram account connected to the ad
account; Adeli finds those with the Ads permissions, and if Meta asks for
instagram_basic to use one the response is 403 permission_required naming
it, since the Meta Ads connection does not request it today. Meta's Marketing API access tier and the user's ad-account role
still apply in addition to these OAuth grants.
A Meta Ads account is billed as its own connected account, separately from the profile's Facebook Page.
Campaign and metric reads are live. Adeli stores no campaign structure and no metrics, so every figure is as fresh as that response. The one exception is the list of ad accounts, which is reused for up to 15 minutes.
Meta or TikTok throttling returns 429 rate_limited with
a Retry-After header and structured limit details. A provider refusal returns
422 provider_rejected with a safe explanation.
Endpoints
/api/v1/ads/accountsEvery Meta ad account or TikTok advertiser the ads connection can reach.POSTCreate ad account/api/v1/ads/accountsCreate an ad account in a Business portfolio.GETList businesses/api/v1/ads/businessesThe Business portfolios an ad account can be created in.GETGet ad account/api/v1/ads/accounts/{adAccountId}One ad account with its status, spend, and spending limit.PATCHUpdate ad account/api/v1/ads/accounts/{adAccountId}Rename an ad account or set its spending limit.GETCampaign tree/api/v1/ads/treeCampaigns, ad sets (TikTok ad groups), and ads with performance at every level.GETDaily insights/api/v1/ads/insightsDaily performance, or a breakdown by age, gender, place or placement, with results, ROAS and cost per result.POSTCreate campaign/api/v1/ads/campaignsA paused Meta campaign with any objective, targeting and a new or boosted creative, or a paused TikTok or LinkedIn campaign.PATCHUpdate campaign/api/v1/ads/campaigns/{campaignId}Change a Meta campaign's name, budget, bid strategy or spend cap.DELETEDelete campaign/api/v1/ads/campaigns/{campaignId}Delete a campaign with its ad sets and ads.PUTUpdate ad status/api/v1/ads/statusActivate, pause, or resume a campaign, ad set (ad group), or ad.GETLead forms and leads/api/v1/ads/leadsA Page's lead forms, or one form's submissions.PATCHUpdate ad group/api/v1/ads/ad-groups/{adGroupId}Change a Meta ad set's budget, bid, dates or targeting, or a TikTok ad group's or LinkedIn campaign's budget, end date or name.DELETEDelete ad set/api/v1/ads/ad-groups/{adGroupId}Delete one Meta ad set with its ads.DELETEDelete ad/api/v1/ads/ads/{adId}Delete one Meta ad.GETTargeting options/api/v1/ads/targetingSearch Meta interests, behaviors, demographics, locations and languages, or list TikTok and LinkedIn options.POSTEstimate reach/api/v1/ads/reach-estimateHow many people a Meta targeting spec reaches.GETInstagram accounts/api/v1/ads/instagram-accountsThe Instagram accounts a Meta ad account can run ads as.GETList ad identities/api/v1/ads/identitiesThe brand identities a TikTok ad can run as.POSTCreate ad identity/api/v1/ads/identitiesA TikTok brand identity from a name and avatar.Ads and lead permissions
Server operations remain capability-gated. Reads require ads_management and
business_management; management also requires pages_manage_ads; lead
retrieval requires leads_retrieval. A healthy credential without the required
permission/resource returns 403 permission_required; credential expiry
remains a separate error.