|API Docs

API Documentation

Complete reference for the MK Allocate REST API

Scenarios
Historical crisis scenarios and stress testing
GET/api/v1/scenarios

List all historical crisis scenarios

Query Parameters

NameTypeRequiredDescription
severitystringNoFilter by severity: extreme, severe, moderate

Response

{ count, scenarios: [{ id, name, period, duration, severity, recoveryMonths }] }

Example

Response
{
  "count": 6,
  "scenarios": [
    {
      "id": "2008-financial-crisis",
      "name": "2008 Financial Crisis",
      "period": "Sep 2008 - Mar 2009",
      "severity": "extreme",
      "recoveryMonths": 51
    }
  ]
}
GET/api/v1/scenarios/:id

Get detailed scenario data including asset class returns

Response

{ id, name, period, duration, severity, description, returns, recoveryMonths, spxDrawdown }
POST/api/v1/scenarios/stress-test

Run stress test on a portfolio allocation

Request Body

FieldTypeRequiredDescription
allocationarrayYesArray of { name, weight } objects
scenarioIdstringNoSpecific scenario ID (tests all if omitted)
portfolioValuenumberNoPortfolio value (default: 1000000)

Response

{ portfolioValue, allocation, results, worstCase, bestCase }

Example

Request
{
  "allocation": [
    { "name": "US Equities", "weight": 60 },
    { "name": "US Bonds", "weight": 40 }
  ],
  "portfolioValue": 1000000
}
Response
{
  "portfolioValue": 1000000,
  "results": [
    {
      "scenario": { "id": "2008-financial-crisis", "name": "2008 Financial Crisis" },
      "impact": { "totalReturn": -24.12, "dollarLoss": -241200, "endValue": 758800 }
    }
  ],
  "worstCase": { ... },
  "bestCase": { ... }
}