Accounts API
Manage connected brokerage accounts.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/accounts | List all accounts |
| GET | /api/v1/accounts/:accountId | Get account details |
| GET | /api/v1/accounts/:accountId/summary | Get account summary |
| POST | /api/v1/accounts/sync | Sync all accounts |
| POST | /api/v1/accounts/sync/:brokerId | Sync accounts for a broker |
| POST | /api/v1/accounts/:accountId/sync | Sync a single account |
| PUT | /api/v1/accounts/:accountId/primary | Set primary account |
| POST | /api/v1/accounts/mode | Switch trading mode |
List Accounts
GET /api/v1/accounts
Authorization: Bearer <access_token>
Response
{
"accounts": [
{
"id": "uuid",
"brokerId": "uuid",
"brokerAccountId": "ABC123456",
"name": "My Trading Account",
"type": "MARGIN",
"currency": "USD",
"equity": 50000.00,
"cashBalance": 25000.00,
"buyingPower": 100000.00,
"isActive": true,
"isDemo": false,
"isPrimary": true,
"lastSyncedAt": "2026-02-25T10:30:00Z"
}
]
}
Get Account Details
GET /api/v1/accounts/:accountId
Authorization: Bearer <access_token>
Response
{
"id": "uuid",
"brokerId": "uuid",
"brokerAccountId": "ABC123456",
"name": "My Trading Account",
"type": "MARGIN",
"currency": "USD",
"equity": 50000.00,
"cashBalance": 25000.00,
"buyingPower": 100000.00,
"dayTradingBuyingPower": 200000.00,
"marketValue": 25000.00,
"unrealisedPnl": 1250.00,
"realisedPnl": 3500.00,
"isActive": true,
"isDemo": false,
"isPrimary": true,
"lastSyncedAt": "2026-02-25T10:30:00Z",
"broker": {
"id": "uuid",
"brokerType": "TRADESTATION",
"status": "CONNECTED"
}
}
Sync Account
Manually trigger account data synchronisation.
POST /api/v1/accounts/:accountId/sync
Authorization: Bearer <access_token>
Response
{
"success": true,
"message": "Account sync initiated",
"syncedAt": "2026-02-25T10:35:00Z"
}
Switch Trading Mode
Switch between Paper and Live trading modes.
POST /api/v1/accounts/mode
Authorization: Bearer <access_token>
Content-Type: application/json
{
"mode": "PAPER"
}
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | Yes | PAPER or LIVE |
Response
{
"success": true,
"mode": "PAPER",
"message": "Switched to paper trading mode"
}
Account Types
| Type | Description |
|---|---|
MARGIN | Margin account with leverage |
CASH | Cash-only account |
IRA | Individual Retirement Account |
Error Responses
Account Not Found
{
"error": "ACCOUNT_NOT_FOUND",
"message": "Account with ID xyz not found"
}
Sync Failed
{
"error": "SYNC_FAILED",
"message": "Failed to sync account: broker connection error"
}