List User Agents
curl --request GET \
--url https://api.magebank.ai/agents/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/agents/{id}"
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/agents/{id}', 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/agents/{id}",
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/agents/{id}"
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/agents/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/agents/{id}")
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[
{
"id": "agent_k77NTwxp2Ym3JCmVsKtXQA",
"name": "Payment Assistant",
"description": "Handles payment processing for customer support",
"status": "active",
"walletAddress": {
"addressId": "0x9d20dE668c8F9fb431cf6D6BBA48ee60Fe8E2BAB",
"networkId": "base-sepolia"
},
"balance": "100",
"currency": "USDC",
"paymentRules": {
"dailyLimit": 1000,
"transactionLimit": 100,
"requireApprovalAboveAmount": 50
},
"tags": ["customer-support", "payments"],
"created": "2025-04-15T11:00:08Z"
},
{
"id": "agent_bRSEFnMRD1fvkMM39hzPdM",
"name": "Marketing Budget",
"description": "Manages marketing expenses",
"status": "active",
"walletAddress": {
"addressId": "0x8c30dE668c8F9fb431cf6D6BBA48ee60Fe8E1CAB",
"networkId": "base-sepolia"
},
"balance": "500",
"currency": "USDC",
"paymentRules": {
"dailyLimit": 2000,
"transactionLimit": 200
},
"tags": ["marketing", "subscriptions"]
}
]
{
"error": "Internal server error"
}
Agents
List User Agents
Fetch all agents for a user
GET
/
agents
/
{id}
List User Agents
curl --request GET \
--url https://api.magebank.ai/agents/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/agents/{id}"
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/agents/{id}', 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/agents/{id}",
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/agents/{id}"
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/agents/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/agents/{id}")
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[
{
"id": "agent_k77NTwxp2Ym3JCmVsKtXQA",
"name": "Payment Assistant",
"description": "Handles payment processing for customer support",
"status": "active",
"walletAddress": {
"addressId": "0x9d20dE668c8F9fb431cf6D6BBA48ee60Fe8E2BAB",
"networkId": "base-sepolia"
},
"balance": "100",
"currency": "USDC",
"paymentRules": {
"dailyLimit": 1000,
"transactionLimit": 100,
"requireApprovalAboveAmount": 50
},
"tags": ["customer-support", "payments"],
"created": "2025-04-15T11:00:08Z"
},
{
"id": "agent_bRSEFnMRD1fvkMM39hzPdM",
"name": "Marketing Budget",
"description": "Manages marketing expenses",
"status": "active",
"walletAddress": {
"addressId": "0x8c30dE668c8F9fb431cf6D6BBA48ee60Fe8E1CAB",
"networkId": "base-sepolia"
},
"balance": "500",
"currency": "USDC",
"paymentRules": {
"dailyLimit": 2000,
"transactionLimit": 200
},
"tags": ["marketing", "subscriptions"]
}
]
{
"error": "Internal server error"
}
User Agents: Returns an array of agents assigned to the user based on the provided user ID.
Path Parameters
string
required
User ID in the format
user_xxxRequest Headers
string
required
Your API key for authentication
Response
Returns an array of agent objects, each containing:string
Unique agent identifier
string
Name of the agent
string
Purpose and functionality of the agent
string
Current status of the agent (active, inactive, paused)
string
Current balance of the agent
string
Currency type used
object
array
Categories or labels assigned to the agent
string
Timestamp when the agent was created
[
{
"id": "agent_k77NTwxp2Ym3JCmVsKtXQA",
"name": "Payment Assistant",
"description": "Handles payment processing for customer support",
"status": "active",
"walletAddress": {
"addressId": "0x9d20dE668c8F9fb431cf6D6BBA48ee60Fe8E2BAB",
"networkId": "base-sepolia"
},
"balance": "100",
"currency": "USDC",
"paymentRules": {
"dailyLimit": 1000,
"transactionLimit": 100,
"requireApprovalAboveAmount": 50
},
"tags": ["customer-support", "payments"],
"created": "2025-04-15T11:00:08Z"
},
{
"id": "agent_bRSEFnMRD1fvkMM39hzPdM",
"name": "Marketing Budget",
"description": "Manages marketing expenses",
"status": "active",
"walletAddress": {
"addressId": "0x8c30dE668c8F9fb431cf6D6BBA48ee60Fe8E1CAB",
"networkId": "base-sepolia"
},
"balance": "500",
"currency": "USDC",
"paymentRules": {
"dailyLimit": 2000,
"transactionLimit": 200
},
"tags": ["marketing", "subscriptions"]
}
]
{
"error": "Internal server error"
}
Status Codes
| Status Code | Description |
|---|---|
| 200 | List of agents successfully retrieved (may be empty) |
| 500 | Internal Server Error |
Empty Response: If the user has no agents, an empty array will be returned with a 200 status code.