Skip to main content

Dashboard

The dashboard endpoint returns everything needed to render an agent management UI in a single request. Instead of making 4–5 separate calls for balance, spend, policies, transactions, and approvals, you get it all aggregated. Base path: GET /dashboard/:agentId
Auth: Agent JWT or tenant-level key

Get Agent Dashboard

GET /dashboard/:agentId
curl https://api.steward.fi/dashboard/trading-bot-1 \
  -H "Authorization: Bearer <agent-jwt>"
# or with tenant key:
  -H "X-Steward-Key: your-tenant-key"
Response:
{
  "ok": true,
  "data": {
    "agent": {
      "id": "trading-bot-1",
      "tenantId": "my-platform",
      "name": "Trading Bot Alpha",
      "walletAddress": "0x742d35Cc6634C0532925a3b8D4C9C4Ae2aBF7B5",
      "createdAt": "2026-03-01T00:00:00Z"
    },
    "balances": {
      "evm": {
        "native": "1500000000000000000",
        "nativeFormatted": "1.500000",
        "chainId": 8453,
        "symbol": "ETH"
      }
    },
    "spend": {
      "today": "50000000000000000",
      "thisWeek": "350000000000000000",
      "thisMonth": "1200000000000000000",
      "todayFormatted": "0.050000",
      "thisWeekFormatted": "0.350000",
      "thisMonthFormatted": "1.200000"
    },
    "policies": [
      {
        "id": "spend-cap",
        "type": "spending-limit",
        "enabled": true,
        "config": {
          "maxPerTx": "100000000000000000",
          "maxPerDay": "500000000000000000",
          "maxPerWeek": "2000000000000000000"
        }
      },
      {
        "id": "auto-threshold",
        "type": "auto-approve-threshold",
        "enabled": true,
        "config": {
          "threshold": "10000000000000000"
        }
      }
    ],
    "pendingApprovals": 2,
    "recentTransactions": [
      {
        "id": "tx_abc...",
        "agentId": "trading-bot-1",
        "toAddress": "0xUniswapRouter...",
        "value": "10000000000000000",
        "status": "signed",
        "chainId": 8453,
        "txHash": "0xdeadbeef...",
        "createdAt": "2026-03-27T12:00:00Z"
      }
    ]
  }
}

Response Fields

agent

Agent identity from the Steward database — ID, tenant, name, and wallet address.

balances

Current on-chain balances. Currently returns evm (native ETH/gas token). The balance is fetched live from the configured RPC.
"balances": {
  "evm": {
    "native": "1500000000000000000",   // wei
    "nativeFormatted": "1.500000",     // ETH, 6 decimal places
    "chainId": 8453,
    "symbol": "ETH"
  }
}
If the balance cannot be fetched (e.g., RPC unavailable), evm is null and the rest of the response is still returned.

spend

Current spend totals across all time ranges — today, this week, this month. Values are in wei (as strings) plus pre-formatted ETH strings. Includes only signed, broadcast, and confirmed transactions.

policies

The agent’s full current policy set, same format as GET /agents/:id/policies.

pendingApprovals

Count of pending approval queue items for this agent. Use this to show a badge count in your UI without fetching the full approval list.

recentTransactions

Last 5 transactions for the agent, most recent first. Each includes: ID, to address, value, status, chain ID, tx hash (if signed), and timestamp.

Performance

The dashboard endpoint runs all queries in parallel (Promise.all) — balance fetch, policy lookup, spend stats, recent transactions, and pending approval count all resolve concurrently. Typical latency is ~50–100ms.

Using with React

The @stwd/react components each use their own focused hooks, but you can prefetch dashboard data and hydrate them:
import { useSteward } from "@stwd/react";

function AgentPage({ agentId }) {
  const [dashboard, setDashboard] = useState(null);
  const { client } = useSteward();

  useEffect(() => {
    client.get(`/dashboard/${agentId}`).then(setDashboard);
  }, [agentId]);

  // pass to components or render manually
}
Or just let each component fetch its own data — the API is lightweight and the endpoints are fast.