Accounts
Connect, inspect and disconnect MetaTrader accounts. Each connected account then gets its own trading API, documented separately.
List trading accounts
Every trading account on the team, newest first — on API v2 and on the Legacy API. Accounts on API v2 also carry the links to their own API, Swagger page and WebSocket tester.
Your team's API key, from dashboard Settings. The same key authenticates each account's own trading API.
In: header
Response Body
curl -X GET "https://api.api2trade.com/v2/accounts"[
{
"id": "string",
"accountNumber": "string",
"accountServerHost": "string",
"name": "string",
"status": "string",
"type": "string",
"statusMessage": "string",
"createdAt": "string",
"updatedAt": "string",
"provisioner": "string",
"terminalStatus": "string",
"terminalLastError": "string",
"suspended": true,
"suspendedAt": "string",
"apiBaseUrl": "string",
"swaggerUrl": "string",
"wsTesterUrl": "string"
}
]Connect a new trading account
Sets up a dedicated connection for the credentials given. Returns straight away with terminalStatus: provisioning — logging in to the broker takes a few minutes. Poll the account until terminalStatus is ready, or error with the reason in terminalLastError.
The server name must match your broker's exactly, as written in the account details email.
Your team's API key, from dashboard Settings. The same key authenticates each account's own trading API.
In: header
^[0-9]+$1 <= length <= 64^[^\u0000-\u001f\u007f]+$1 <= length <= 100Metatrader 4- Metatrader 4Metatrader 5- Metatrader 5
"Metatrader 4" | "Metatrader 5"1 <= length^[^\u0000-\u001f\u007f]+$1 <= length <= 255Response Body
curl -X POST "https://api.api2trade.com/v2/accounts" \ -H "Content-Type: application/json" \ -d '{ "accountNumber": "1082118", "name": "Demo one", "type": "Metatrader 5", "accountPassword": "••••••••", "accountServerHost": "VTMarkets-Demo" }'{
"id": "string",
"accountNumber": "string",
"accountServerHost": "string",
"name": "string",
"status": "string",
"type": "string",
"statusMessage": "string",
"createdAt": "string",
"updatedAt": "string",
"provisioner": "string",
"terminalStatus": "string",
"terminalLastError": "string",
"suspended": true,
"suspendedAt": "string",
"apiBaseUrl": "string",
"swaggerUrl": "string",
"wsTesterUrl": "string"
}{
"error": "string",
"message": "string"
}{
"error": "string",
"message": "string"
}{
"error": "string",
"message": "string"
}{
"error": "string",
"message": "string"
}Fetch one trading account
Your team's API key, from dashboard Settings. The same key authenticates each account's own trading API.
In: header
Path Parameters
uuidResponse Body
curl -X GET "https://api.api2trade.com/v2/accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"id": "string",
"accountNumber": "string",
"accountServerHost": "string",
"name": "string",
"status": "string",
"type": "string",
"statusMessage": "string",
"createdAt": "string",
"updatedAt": "string",
"provisioner": "string",
"terminalStatus": "string",
"terminalLastError": "string",
"suspended": true,
"suspendedAt": "string",
"apiBaseUrl": "string",
"swaggerUrl": "string",
"wsTesterUrl": "string"
}{
"error": "string",
"message": "string"
}Disconnect and remove a trading account
Disconnects the account and deletes it. This frees the slot immediately. It cannot be undone — reconnecting means providing the credentials again.
Your team's API key, from dashboard Settings. The same key authenticates each account's own trading API.
In: header
Path Parameters
uuidResponse Body
curl -X DELETE "https://api.api2trade.com/v2/accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08"{
"error": "string",
"message": "string"
}