API reference
Agents
Agent wallets, funding, policy and events.
POST
/v1/agentsSession or account keyCreate an agent. Returns the agent and its first agent key (shown once).
Body
{ "name": "research-bot" }Response
{ "agent": { "id": "agt_…", "name": "research-bot", "balance": 0, "spent_today": 0, "policy": { … } }, "key": { "id": "key_…", "key": "rp_sk_…", "prefix": "rp_sk_…" } }curl
curl -X POST https://dapp.railpay.app/v1/agents \
-H "Authorization: Bearer $RAILPAY_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "research-bot" }'GET
/v1/agentsSession or account keyYour agents with balance, today's spend and policy.
curl
curl https://dapp.railpay.app/v1/agents \
-H "Authorization: Bearer $RAILPAY_KEY"GET
/v1/agents/:idSession or account keyOne agent.
curl
curl https://dapp.railpay.app/v1/agents/<id> \
-H "Authorization: Bearer $RAILPAY_KEY"POST
/v1/agents/:id/fundSession or account keyMove SUSD from your account to the agent.
Body
{ "amount": "5" }curl
curl -X POST https://dapp.railpay.app/v1/agents/<id>/fund \
-H "Authorization: Bearer $RAILPAY_KEY" \
-H "Content-Type: application/json" \
-d '{ "amount": "5" }'POST
/v1/agents/:id/withdrawSession or account keyMove SUSD from the agent back to your account.
Body
{ "amount": "5" }curl
curl -X POST https://dapp.railpay.app/v1/agents/<id>/withdraw \
-H "Authorization: Bearer $RAILPAY_KEY" \
-H "Content-Type: application/json" \
-d '{ "amount": "5" }'PATCH
/v1/agents/:id/policySession or account keyUpdate the policy.
Body
{ "per_request_max": "0.05", "daily_cap": "5", "allowed_hosts": ["dapp.railpay.app"], "allow_a2a": false, "paused": false }curl
curl -X PATCH https://dapp.railpay.app/v1/agents/<id>/policy \
-H "Authorization: Bearer $RAILPAY_KEY" \
-H "Content-Type: application/json" \
-d '{ "per_request_max": "0.05", "daily_cap": "5", "allowed_hosts": ["dapp.railpay.app"], "allow_a2a": false, "paused": false }'GET
/v1/agents/:id/eventsSession or account keyPaid and blocked attempts with reasons.
curl
curl https://dapp.railpay.app/v1/agents/<id>/events \
-H "Authorization: Bearer $RAILPAY_KEY"