Ads
Facebook advertising, on the same connection as Pages. These are platform-specific routes rather than a normalized surface: campaign structure has no equivalent on the other providers Adeli covers.
Every endpoint needs a Facebook connection whose authorization includes the ads
permissions. A connection made before those were requested keeps working for
Pages and answers 403 ads_permission_required here, with the missing scopes in
error.details.missingScopes; the fix is another authorization, not a repair.
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.
When Meta throttles a request, the response is 429 rate_limited with a
Retry-After header, error.details.retryAfterSeconds (Meta's own estimate
when it gives one, otherwise a minute) and error.details.limit: app when the
app's hourly call budget for this connection is spent, ad_account when that
ad account's own budget is.
When Meta refuses a request and explains why, the response is 422 provider_rejected with Meta's explanation in error.message — for example
that a Business portfolio has reached its limit of ad accounts.
Endpoints
/api/v1/ads/accountsEvery ad account the Facebook 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, and ads with performance rolled up at every level.GETDaily insights/api/v1/ads/insightsOne point per day for an ad account, campaign, ad set, or ad.POSTCreate campaign/api/v1/ads/campaignsPromote a published Page post as a paused campaign.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 an ad or ad set.GETLead forms and leads/api/v1/ads/leadsA Page's lead forms, or one form's submissions.