GET List Accounts

abstract

Returns all active MT5 accounts — called on app startup to populate the account selector sidebar and the Accounts page.

🔒 Authentication

PropertyValue
MechanismNone
RequiredNo

🛠️ Technical Specification

Request

ParameterLocationTypeRequiredDescription
No parameters

Logic Flow

📦 Request Body

None.

📤 Responses

StatusWhenBody
200 OKSuccessAccountResponse[]
500 Internal Server ErrorDB unavailable{ "detail": "..." }

200 OK example:

[
  {
    "id": 42,
    "name": "Live Trading Account",
    "broker": "MetaQuotes",
    "login": 12345678,
    "server": "MetaQuotes-Demo",
    "is_live": false,
    "is_active": true,
    "allowed_symbols": ["EURUSD", "GBPUSD"],
    "max_lot_size": 0.1,
    "risk_pct": 0.01,
    "auto_trade_enabled": true,
    "paper_trade_enabled": false,
    "mt5_path": "",
    "account_type": "USD",
    "created_at": "2026-04-15T10:00:00Z"
  }
]

Note: password_encrypted is never included in AccountResponse. Use _to_response() helper in router.

Pydantic Schema: backend/api/routes/accounts.py :: AccountResponse

RolePath
Routerbackend/api/routes/accounts.py :: list_accounts()
DB TableDB - accounts
RoleLink
Related EndpointAPI-POST-v1-Accounts
Frontend PagePage - Accounts
StoreStore - TradingStore
DB SchemaDB - accounts