Get Savings Dashboard
curl --request GET \
--url https://api.magebank.ai/savings/dashboard \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/savings/dashboard"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.magebank.ai/savings/dashboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magebank.ai/savings/dashboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.magebank.ai/savings/dashboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.magebank.ai/savings/dashboard")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/savings/dashboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"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
}
]
}
{
"error": "Invalid or missing API key"
}
{
"error": "Internal Server Error"
}
Savings
Get Savings Dashboard
Get a comprehensive overview of the user’s savings portfolio
GET
/
savings
/
dashboard
Get Savings Dashboard
curl --request GET \
--url https://api.magebank.ai/savings/dashboard \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/savings/dashboard"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.magebank.ai/savings/dashboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magebank.ai/savings/dashboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.magebank.ai/savings/dashboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.magebank.ai/savings/dashboard")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/savings/dashboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"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
}
]
}
{
"error": "Invalid or missing API key"
}
{
"error": "Internal Server Error"
}
Portfolio Overview: View your entire savings portfolio with real-time calculations of interest earned and projected growth.
Request Headers
string
required
Your API key for authentication
Response
number
Total current value of all investments including interest
number
Current interest rate applied to investments
number
Total principal amount invested by the user
number
Projected value of investments after one year at current rate
array
Show Agent Investment Details
Show Agent Investment Details
string
Name of the agent
string
Investment ID in short format
number
Total balance including investment value
number
Principal amount invested
number
Current value with interest
number
Interest earned to date
number
Current balance in agent’s account
number
Days the investment has been active
{
"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
}
]
}
{
"error": "Invalid or missing API key"
}
{
"error": "Internal Server Error"
}
Status Codes
| Status Code | Description |
|---|---|
| 200 | Savings dashboard data retrieved successfully |
| 401 | Unauthorized - Invalid or missing API key |
| 500 | Internal 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).