POST
/
agents
/
deposit
curl --request POST \
  --url https://api.magebank.ai/agents/deposit \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '{
  "userid": "<string>",
  "agentid": "<string>",
  "amount": 123,
  "currency": "<string>"
}'
{
  "success": true,
  "txHash": "0x123...abc",
  "message": "Successfully deposited 50 USDC to agent",
  "updatedBalance": "150"
}

Blockchain Transaction: This endpoint transfers funds from a user’s wallet to an agent’s wallet through an on-chain transaction.

Request Headers

x-api-key
string
required

Your API key for authentication

Request Body

userid
string
required

ID of the user initiating the deposit

agentid
string
required

ID of the agent receiving the deposit

amount
number
required

Amount to deposit

currency
string
default:"USDC"

Currency type to deposit (defaults to USDC)

Response

success
boolean

Whether the deposit was successful

txHash
string

Transaction hash on the blockchain

message
string

Information about the deposit

updatedBalance
string

New balance of the agent after the deposit

{
  "success": true,
  "txHash": "0x123...abc",
  "message": "Successfully deposited 50 USDC to agent",
  "updatedBalance": "150"
}

Status Codes

Status CodeDescription
200Funds deposited successfully
400Bad Request - Invalid or missing parameters
404Not Found - Agent or user not found
500Internal Server Error - Transaction failed

Wallet Requirements: The user must have sufficient funds in their wallet and the wallet must be accessible for the deposit to succeed.

Transaction Time: Blockchain transactions may take a few moments to be confirmed. The response is sent after confirmation.