Skip to main content

API Endpoints (Selected)

Base URL: Backend host (e.g., Cloud Run) — set in frontend as NEXT_PUBLIC_API_URL.

  • GET /auth/url — Get OAuth authorization URL
  • GET /auth/connect — Start OAuth flow
  • GET /auth/available-accounts?accessToken=... — List accounts accessible by the OAuth token
  • GET/POST /auth/callback — OAuth callback handler
  • GET /connection-status — Connection state (requires tenant)
  • POST /accounts/create — Create account from OAuth (requires tenant)
  • DELETE /accounts — Remove all Google Ads accounts for org (requires tenant)

Meta Ads (/api/meta-ads)

  • GET /auth/available-accounts
  • GET /auth/connect
  • GET /connection-status

TikTok Ads (/api/tiktok-ads)

  • GET /auth/available-accounts
  • GET /auth/connect
  • GET /connection-status

Notes:

  • Protected routes require Authorization Bearer and x-organization-id header.
  • See definitions in backend/src/routes/*.ts and controllers in backend/src/controllers/*.ts.