{
  "info": {
    "_postman_id": "f5875d18-9ee5-40b2-b5cb-0d954226b43d",
    "name": "PORTIQA Portfolio Analysis API",
    "description": "Authenticated examples for POST /evaluate. Set api_key locally; this collection contains no credentials.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {"key": "token", "value": "{{api_key}}", "type": "string"}
    ]
  },
  "variable": [
    {"key": "base_url", "value": "https://portiqa.ai", "type": "string"},
    {"key": "api_key", "value": "", "type": "string"}
  ],
  "item": [
    {
      "name": "Evaluate portfolio",
      "event": [
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              "pm.test('HTTP 200', function () { pm.response.to.have.status(200); });",
              "pm.test('Response contains an engine version', function () {",
              "  const body = pm.response.json();",
              "  pm.expect(body.ok).to.eql(true);",
              "  pm.expect(body.evaluation.engine_version).to.be.a('string');",
              "});"
            ]
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {"key": "Content-Type", "value": "application/json", "type": "text"},
          {"key": "Accept", "value": "application/json", "type": "text"}
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"risk_level\": \"medium\",\n  \"cash_balance\": 5000,\n  \"positions\": [\n    {\"ticker\": \"AAPL\", \"market_value\": 25000},\n    {\"ticker\": \"MSFT\", \"market_value\": 22000},\n    {\"ticker\": \"NVDA\", \"market_value\": 8000}\n  ]\n}",
          "options": {"raw": {"language": "json"}}
        },
        "url": {
          "raw": "{{base_url}}/evaluate",
          "host": ["{{base_url}}"],
          "path": ["evaluate"]
        },
        "description": "Returns a versioned portfolio evaluation with component scores, coverage, diagnostics, and suggestions."
      },
      "response": []
    }
  ]
}
