Docs
Accounts

Connect an MT5 account

POST
/v1/accounts

Stores the account and encrypts its password. It does not log in: the account lands in created, and connects when you bring it online or when the first order arrives on a warm_on_demand account.

Reconnecting. If this login and server were connected before and then disconnected, the same account comes back — its id and history kept — with the new password, and the answer is 200 instead of 201. If they are still connected, the answer is 409 ACCOUNT_EXISTS with the account's id; to change its password, use POST /v1/accounts/{id}/password.

Authorization

apiKey
AuthorizationBearer <token>

Authorization: Bearer fx_live_<id>_<secret>.

A key is shown once, at creation. We cannot show it again or recover it for you. Keys carry a label (live or test) in the key itself, so each configuration is easy to tell apart. Both reach real brokers: test with a broker demo account.

Scopes are per key. A key without accounts:write can read accounts and nothing else.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/accounts" \  -H "Content-Type: application/json" \  -d '{    "login": "26177561",    "server": "VantageMarkets-Demo",    "password": "your-mt5-trading-password"  }'
{  "data": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "label": null,    "login": "string",    "server": "string",    "mode": "always_on",    "state": "created",    "stateDetail": null,    "stateChangedAt": "2019-08-24T14:15:22Z",    "problem": null,    "currency": null,    "leverage": null,    "marginMode": "netting",    "tradeAllowed": null,    "brokerName": null,    "environment": "demo",    "tradingDisabled": true,    "createdAt": "2019-08-24T14:15:22Z",    "balance": "10012.25000000",    "equity": "10012.25000000",    "margin": "10012.25000000",    "freeMargin": "10012.25000000",    "marginLevel": "10012.25000000",    "credit": "10012.25000000",    "profit": "10012.25000000",    "figuresObservedAt": null  }}

Balance, equity and margin GET

The account's money as its MetaTrader terminal reports it: balance, equity, margin, free margin, margin level, credit and open profit, as decimal strings in the account's currency. Without `fresh`, the last read: taken every 15 seconds while the account is online, with `observedAt` saying when. With `fresh=true`, the terminal is asked now — the account must be `ready` (409 `ACCOUNT_NOT_READY` otherwise, including while it is `executing` an order or `degraded`); a terminal still on an older worker answers 501 `CAPABILITY_UNAVAILABLE` instead, rare in practice. Callers within the same second share one read, and only a read that reaches the terminal is charged to the account's live budget (300 a minute + 50 across every caller; 429 `RATE_LIMITED` with `retry-after` past it).

Delete an account and its history DELETE

Removes the account for good: its terminal is stopped, its password erased, and the record deleted with its orders, deals and positions. **This cannot be undone.** To stop trading on an account but keep its history readable, disconnect it instead. Refused with `409` while an order is in flight (`ACCOUNT_EXECUTING`), while a multi-account order that includes it has not finished (`ACCOUNT_IN_WAVE`), and when our last look found open positions (`ACCOUNT_HAS_POSITIONS`): those stay open at the broker with their stops, but could no longer be shown or closed here. Close them first, or send `force=true` to delete anyway. Alert hooks stop sending to the account; a hook left with no accounts is switched off. This month's usage is unaffected. The same login and server can be connected again afterwards, as a new account.