GET
/
savings
/
myinvestments
curl --request GET \
  --url https://api.magebank.ai/savings/myinvestments \
  --header 'x-api-key: <x-api-key>'
{
  "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
    }
  ]
}

Active Investments: Retrieve a comprehensive list of all active investments across all your agents with real-time value calculations.

Request Headers

x-api-key
string
required

Your API key for authentication

Response

agents
array
{
  "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
200List of active investments retrieved successfully
401Unauthorized - Invalid or missing API key
500Internal Server Error

Active Only: This endpoint returns only active investments; completed or cancelled investments are not included.

Real-time Calculations: Interest values are calculated in real-time based on the current platform interest rate and exact investment duration.

Total Balance: The totalBalance for each agent includes both the investment value and the regular wallet balance.