- Platforms:
meta,google,tiktok. - Connecting/syncing needs
ads:write; reading insights/dashboard needsanalytics:read. - Feed these numbers back into the Playbook to decide scale/pause/restock.
Recipes
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
# 1. start OAuth — returns a URL for a human to authorize
curl -s -X POST https://api.platformdtc.com/api/v1/agent/v1/ads/meta/connect \
-H "X-Agent-Key: sq_agt_xxx" -H "Content-Type: application/json" -d '{}' \
| jq -r '.data.auth_url'
# open auth_url in a browser, authorize, done.
# 2. list connected accounts
curl -s https://api.platformdtc.com/api/v1/agent/v1/ads/accounts \
-H "X-Agent-Key: sq_agt_xxx" | jq '.data'
# 3. trigger a data sync (async)
JOB=$(curl -s -X POST https://api.platformdtc.com/api/v1/agent/v1/ads/meta/sync \
-H "X-Agent-Key: sq_agt_xxx" -H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" -d '{}' | jq -r '.data.job_id')
# 4. read KPIs (revenue, orders, ad spend, ROAS, profit)
curl -s "https://api.platformdtc.com/api/v1/agent/v1/analytics/dashboard?range=7D" \
-H "X-Agent-Key: sq_agt_xxx" | jq '.data.main_metrics'
# 5. per-account ad performance
curl -s "https://api.platformdtc.com/api/v1/agent/v1/ads/insights?platform=meta&range=7D" \
-H "X-Agent-Key: sq_agt_xxx" | jq '.data'
meta, google, tiktok.ads:write; reading insights/dashboard needs analytics:read.