cTrader APIManaging accounts

For AI agents: this page is also available as Markdown at /docs/ctrader/accounts.md. The index of every docs page is /docs/llms.txt.

cTrader Account Management API

Link a cTrader account once with cTrader sign-in on the dashboard, then list and remove accounts programmatically with the account-management API. Every linked account gets the account_id you'll use across every per-account REST and WebSocket route.

How linking works on cTrader

  • cTrader sign-in, not a password. You sign in with your cTrader ID at Spotware and allow FxSocket access; FxSocket stores the grant, never your password. One sign-in can link several of your trading accounts, one at a time from the account picker.
  • Which accounts. Any cTrader account you can sign in to can be linked: demo or live, hedging or netting. The picker greys out only accounts cTrader itself reports as inactive.
  • Revoking access. Removing FxSocket from the apps in your cTrader ID settings stops every account of that sign-in. The dashboard then marks them and offers Sign in with cTrader to reconnect them.
  • No terminal to provision. A linked account is served by FxSocket's cTrader bridge on Spotware's Open API, so it is connected within seconds instead of the minutes a MetaTrader terminal needs to start.

List and remove cTrader accounts programmatically. These endpoints live under a different base URL (https://api.fxsocket.com/v1) and use the same X-API-Key authentication. Linking is the one step that happens on the dashboard: on the Accounts page choose Add account, then cTrader, sign in with your cTrader ID and pick the trading account. FxSocket never sees your cTrader password. Once the account reads "connected" you can drive it through the per-account REST and WebSocket API documented below. Any cTrader account you can sign in to can be linked: demo or live, hedging or netting.

GET /v1/accounts

List every account linked to your API key, cTrader, MT4 and MT5 alike. platform tells them apart.

Example request
curl -H "X-API-Key: fxs_live_..." \
  https://api.fxsocket.com/v1/accounts
Response
[{
  "id": "3f6c2a1e-8d4b-4c7a-9e21-5b0d7a9c4e18",
  "nickname": "cTrader demo",
  "platform": "ctrader",
  "server": "Spotware (demo)",
  "login": 4123456,
  "status": "connected",
  "error": "",
  "suspended": false,
  "rest_url": "https://api.fxsocket.com/ctrader/3f6c2a1e-8d4b-4c7a-9e21-5b0d7a9c4e18",
  "ws_url": "wss://api.fxsocket.com/ctrader/3f6c2a1e-8d4b-4c7a-9e21-5b0d7a9c4e18/ws",
  "created_at": "2026-11-10T22:35:27Z"
}]
POST /v1/accounts

Not for cTrader. This route links MT4 and MT5 accounts with a password; a cTrader account is linked with cTrader sign-in on the dashboard instead, so platform "ctrader" is refused with 400 and nothing is created. The official SDKs refuse it before sending.

Request body
{
  "platform": "ctrader",
  "server": "Spotware",
  "login": 4123456,
  "password": "..."
}
400 response
{
  "platform": [
    "cTrader accounts are linked with cTrader sign-in, not a password: on the Accounts page of the FxSocket dashboard, choose Add account, then cTrader."
  ]
}
GET /v1/accounts/{account_id}

Fetch a single account by id, for example to check status after linking.

Example request
curl -H "X-API-Key: fxs_live_..." \
  https://api.fxsocket.com/v1/accounts/{account_id}
Response
{
  "id": "3f6c2a1e-8d4b-4c7a-9e21-5b0d7a9c4e18",
  "nickname": "cTrader demo",
  "platform": "ctrader",
  "server": "Spotware (demo)",
  "login": 4123456,
  "status": "connected",
  "error": "",
  "suspended": false,
  "rest_url": "https://api.fxsocket.com/ctrader/3f6c2a1e-8d4b-4c7a-9e21-5b0d7a9c4e18",
  "ws_url": "wss://api.fxsocket.com/ctrader/3f6c2a1e-8d4b-4c7a-9e21-5b0d7a9c4e18/ws",
  "created_at": "2026-11-10T22:35:27Z"
}
DELETE /v1/accounts/{account_id}

Unlink an account: the bridge lets go of it at once, the account is removed, and its slot on your plan is free again. When it was the last account of that cTrader sign-in, FxSocket also deletes the stored sign-in. Returns 204 No Content with an empty body.

Example request
curl -X DELETE \
  -H "X-API-Key: fxs_live_..." \
  https://api.fxsocket.com/v1/accounts/{account_id}
Response
204 No Content

status is the account's overall health: "connecting" right after linking (usually a few seconds), "connected" once the bridge has signed in to the trading account and serves data, "error" if that failed (see the error field), and "disconnected" otherwise. suspended is true while billing has paused the account for an unpaid seat: it then reads "disconnected", error says why, and it stays down until it is paid for and reconnected from the dashboard. If you revoke FxSocket's access in your cTrader ID settings, the account stops trading and the dashboard asks you to sign in with cTrader again. rest_url and ws_url are the account's base URLs for the routes below. The id is the {account_id} used in every per-account route.