Ads API
Connect a Meta Ad Account and run the full advertising loop from Orbit: create click-to-chat campaigns, forward conversions back to Meta for closed-loop attribution, turn Meta Lead Ads into contacts, and activate CDP segments as hashed Custom Audiences. Base path:/api/v1/ads
Authentication: API key (X-API-Key) or session JWT. Every endpoint requires authentication.
Roles: read endpoints (connection status, campaign list/detail, audience list) are open to any authenticated role. Every write — connecting, disconnecting, campaign create/update/delete, Conversions API calls, Lead Ads ingestion, and audience create/sync/delete — requires the owner or admin role.
A single Meta Ad Account is stored per organization. Connect it first; the other endpoints return CHANNEL_UNAVAILABLE until a connection (and, for Conversions, a dataset ID) exists.
Connection
Connect via the hosted OAuth flow (/oauth/exchange, used by the in-app callback) or by posting an access token and ad account id directly (/connect).
Tokens are encrypted at rest. The
status response surfaces the selected ad account’s currency so budgets and spend render in the account’s own currency rather than defaulting to USD.
Campaigns
Click-to-chat campaigns drive WhatsApp, Messenger, or Instagram Direct conversations. New campaigns are created inPAUSED state so you can review them in Meta before they spend.
Conversions API
Forward business outcomes (lead, purchase, registration, appointment) from WhatsApp conversations that started on a click-to-WhatsApp ad back to Meta, closing the attribution loop. Email and phone are SHA-256 hashed before they leave Orbit — raw PII is never sent to Meta. Set adataset_id once; the test and live endpoints both read it.
A conversion must carry at least one identifier in
user_data — phone, email, external_id, or ctwa_clid — for Meta to match it.
Lead Ads ingestion
Turn a Metaleadgen webhook batch into tenant contacts. Each lead’s instant-form answers are fetched from the Graph API and upserted through the same dedup, compliance, and required-field machinery as a CSV import. Leads with no email and no phone are skipped; one failed fetch never drops the rest of the batch.
The response reports
received, fetched, fetch_failures, skipped_no_contact, created, updated, and duplicates.
Custom Audiences
Activate a first-party CDP segment to Meta as a hashed customer-list Custom Audience for targeting or suppression, then keep it in sync as the segment recomputes. Membership is SHA-256 hashed before upload.
A sync resolves up to 100,000 members per call; larger segments are truncated and the response sets
truncated: true.
Example — check connection status
See also
- CDP API — build the segments you activate as Custom Audiences
- Contacts API — where ingested Lead Ads land
- Channels → WhatsApp guide — click-to-WhatsApp setup and templates