Skip to main content

Accounts API

Manage connected brokerage accounts.

Endpoints

MethodEndpointDescription
GET/api/v1/accountsList all accounts
GET/api/v1/accounts/:accountIdGet account details
GET/api/v1/accounts/:accountId/summaryGet account summary
POST/api/v1/accounts/syncSync all accounts
POST/api/v1/accounts/sync/:brokerIdSync accounts for a broker
POST/api/v1/accounts/:accountId/syncSync a single account
PUT/api/v1/accounts/:accountId/primarySet primary account
POST/api/v1/accounts/modeSwitch 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

FieldTypeRequiredDescription
modestringYesPAPER or LIVE

Response

{
"success": true,
"mode": "PAPER",
"message": "Switched to paper trading mode"
}

Account Types

TypeDescription
MARGINMargin account with leverage
CASHCash-only account
IRAIndividual 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"
}