GET
/
savings
/
dashboard
curl --request GET \
  --url https://api.magebank.ai/savings/dashboard \
  --header 'x-api-key: <x-api-key>'
{
  "totalSavings": 1500.75,
  "interestRate": 5,
  "totalInvested": 1000,
  "yearProjection": 1050,
  "agents": [
    {
      "agent": "Payment Assistant",
      "investment_id": "inv_k77NTwxp2Ym3JCmVsKtXQA",
      "totalBalance": 1200.5,
      "investedAmount": 1000,
      "currentValue": 1200.5,
      "interest": 200.5,
      "current": 1000,
      "daysInvested": 365
    },
    {
      "agent": "Marketing Budget",
      "investment_id": "inv_j88MTaxp3Zm3KDnWtLuPpB",
      "totalBalance": 300.25,
      "investedAmount": 300,
      "currentValue": 300.25,
      "interest": 0.25,
      "current": 500,
      "daysInvested": 2
    }
  ]
}

Portfolio Overview: View your entire savings portfolio with real-time calculations of interest earned and projected growth.

Request Headers

x-api-key
string
required

Your API key for authentication

Response

totalSavings
number

Total current value of all investments including interest

interestRate
number

Current interest rate applied to investments

totalInvested
number

Total principal amount invested by the user

yearProjection
number

Projected value of investments after one year at current rate

agents
array
{
  "totalSavings": 1500.75,
  "interestRate": 5,
  "totalInvested": 1000,
  "yearProjection": 1050,
  "agents": [
    {
      "agent": "Payment Assistant",
      "investment_id": "inv_k77NTwxp2Ym3JCmVsKtXQA",
      "totalBalance": 1200.5,
      "investedAmount": 1000,
      "currentValue": 1200.5,
      "interest": 200.5,
      "current": 1000,
      "daysInvested": 365
    },
    {
      "agent": "Marketing Budget",
      "investment_id": "inv_j88MTaxp3Zm3KDnWtLuPpB",
      "totalBalance": 300.25,
      "investedAmount": 300,
      "currentValue": 300.25,
      "interest": 0.25,
      "current": 500,
      "daysInvested": 2
    }
  ]
}

Status Codes

Status CodeDescription
200Savings dashboard data retrieved successfully
401Unauthorized - Invalid or missing API key
500Internal Server Error

Real-time Calculations: Interest calculations are performed in real-time based on the current interest rate and the exact duration of each investment.

Active Investments: Only active investments are included in the dashboard. Completed or cancelled investments will not appear.

Currency: All monetary values are in USDC by default, and the interest rate is expressed as an annual percentage yield (APY).