Reference: Meta Marketing API + System User tokens
OAuth scopes
ads:readads:managepages:readWebhooks
ads.campaign.updatedads.insights.ready- 1
1. Link Business Portfolio
In /developers/dashboard → your app → Business settings, connect a Business Portfolio with ad accounts.
INTERNAL platform apps can use client_credentials without a portfolio; external apps require portfolio link.
- 2
2. Issue system user token
Exchange client_id + client_secret for a long-lived system user token (server-side only).
POST https://aura.aisastra.com/api/oauth/token Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &client_id=YOUR_APP_ID &client_secret=YOUR_CLIENT_SECRET
- 3
3. Verify provisioning
Health endpoint confirms SYSTEM_USER token is active in production.
GET https://aura.aisastra.com/api/v1/platform/system-user/health
- 4
4. List ad accounts
Use the system user Bearer token for Marketing API reads.
GET https://aura.aisastra.com/api/v1/graph?node=me/ad_accounts Authorization: Bearer SYSTEM_USER_TOKEN
- 5
5. Create campaign
Mutations require ads:manage scope on the system user token.
POST https://aura.aisastra.com/api/v1/graph Authorization: Bearer SYSTEM_USER_TOKEN Content-Type: application/json { "node": "ad_account/AD_ACCOUNT_ID/campaigns", "name": "Agency Q4 Push", "objective": "OUTCOME_TRAFFIC", "dailyBudget": 5000 } - 6
6. Subscribe to webhooks
Receive campaign status changes at your HTTPS endpoint with HMAC verification.