{
  "ok": true,
  "data": {
    "openapi": "3.0.0",
    "info": {
      "title": "Sovi.AI UA Command Center Open Data API",
      "version": "1.0.0",
      "description": "Programmatic REST API for reading marketing, attribution, and growth analytics data."
    },
    "authentication": {
      "type": "apiKey",
      "header": "Authorization: Bearer <your_api_key> or X-API-Key: <your_api_key>",
      "query_param": "?api_key=<your_api_key>",
      "prefix": "pci_ak_"
    },
    "base_url": "https://mysovi.ai/apps/ua-command-center/api",
    "endpoints": [
      {
        "path": "/api/v1/data/raw-metrics",
        "method": "GET",
        "description": "Direct access to daily metrics table with date, channel, country, spend, conversions, and installs.",
        "parameters": [
          "start_date",
          "end_date",
          "channel",
          "country",
          "page",
          "limit",
          "format=json|csv"
        ]
      },
      {
        "path": "/api/v1/data/export",
        "method": "GET",
        "description": "Universal CSV / JSON dataset export.",
        "parameters": [
          "dataset (raw_metrics|channels|countries|campaigns|creatives|attribution|daily_report)",
          "format (csv|json)",
          "start_date",
          "end_date"
        ]
      },
      {
        "path": "/api/cockpit",
        "method": "GET",
        "description": "Executive Cockpit overview KPI summary and channel aggregates.",
        "parameters": [
          "start_date",
          "end_date",
          "channel",
          "country"
        ]
      },
      {
        "path": "/api/daily-report",
        "method": "GET",
        "description": "UA daily report bundle with country and platform breakdowns.",
        "parameters": [
          "start_date",
          "end_date",
          "channel",
          "country",
          "business_line"
        ]
      },
      {
        "path": "/api/ua/channels",
        "method": "GET",
        "description": "Channel performance with iOS, Android, and Web spend splits.",
        "parameters": [
          "start_date",
          "end_date"
        ]
      },
      {
        "path": "/api/ua/countries",
        "method": "GET",
        "description": "Country performance metrics and rank list.",
        "parameters": [
          "start_date",
          "end_date",
          "channel"
        ]
      },
      {
        "path": "/api/ua/campaigns",
        "method": "GET",
        "description": "Campaign-level spend, clicks, installs, and CPI.",
        "parameters": [
          "start_date",
          "end_date",
          "channel"
        ]
      },
      {
        "path": "/api/ua/creatives",
        "method": "GET",
        "description": "Ad creative performance.",
        "parameters": [
          "start_date",
          "end_date",
          "channel"
        ]
      },
      {
        "path": "/api/attribution/summary",
        "method": "GET",
        "description": "Attribution summary metrics and channel coverage.",
        "parameters": [
          "start_date",
          "end_date"
        ]
      },
      {
        "path": "/api/monetization/dashboard",
        "method": "GET",
        "description": "Monetization overview, subscription breakdown, and revenue trends.",
        "parameters": [
          "start_date",
          "end_date"
        ]
      },
      {
        "path": "/api/ltv/overview",
        "method": "GET",
        "description": "LTV & ROAS cohort overview and payback periods.",
        "parameters": [
          "start_date",
          "end_date"
        ]
      }
    ],
    "examples": {
      "curl": "curl -H \"Authorization: Bearer pci_ak_your_key_here\" \"https://mysovi.ai/apps/ua-command-center/api/v1/data/raw-metrics?start_date=2026-08-01&end_date=2026-08-31\"",
      "curl_csv": "curl -H \"X-API-Key: pci_ak_your_key_here\" \"https://mysovi.ai/apps/ua-command-center/api/v1/data/export?dataset=channels&format=csv\" -o channels.csv",
      "python": "import requests\n\nheaders = {'Authorization': 'Bearer pci_ak_your_key_here'}\nresp = requests.get('https://mysovi.ai/apps/ua-command-center/api/cockpit?start_date=2026-08-01&end_date=2026-08-31', headers=headers)\ndata = resp.json()['data']\nprint(data['kpis'])",
      "nodejs": "const res = await fetch('https://mysovi.ai/apps/ua-command-center/api/v1/data/raw-metrics?format=json', {\n  headers: { 'Authorization': 'Bearer pci_ak_your_key_here' }\n});\nconst json = await res.json();\nconsole.log(json.data);"
    }
  },
  "error": null
}