API v1 (legacy) · MT5 · 10 operations ·
base URL https://cloud.mywebapi.com ·
OpenAPI v1 (JSON) ·
Redoc
Every call needs Authorization: Bearer $TOKEN — an OAuth 2.0 client-credentials token (scope
webapi). The token server belongs to the environment: for the Sandbox call
https://pre.mywebapi.com and take the token from
https://pre.auth.cplugin.net/connect/token; for Production take it from
https://auth.cplugin.net/connect/token. Clients and tokens of the two are separate — a token
from one answers 401 on the other.
$TRADE_PLATFORM_ID is the id of a trade platform registered in Toolbox.
A failure is an HTTP error code, with the X-Request-Outcome header where it applies —
see Errors.
In case no login is specified for a record (is equal to 0), the server will automatically allocate a login from the available range and will assign it to the user record. In case there are no more available ranges of logins, the MT_RET_USR_LOGIN_EXHAUSTED error is returned.
The following parameters must be filled in the user record you are adding: Group and Leverage, as well as FirstName or LastName.
When calling the method, a check is made whether the entry already exists.If the account already exists, the MT_RET_USR_LOGIN_EXIST error is returned.A key field for comparison is the user login Login().
A user can be added on a trade server only from the applications that run in the same trade server.For all other applications the response code MT_RET_USR_LOGIN_PROHIBITED will be returned.
Before adding, the correctness of the record is checked. If the record is incorrect, the error code MT_RET_ERR_PARAMS is returned.
If any of passwords (Password and PasswordInvestor) is null or empty, both of them will be generated. We will generate passwords and create the user on the trade server. If MT5 does not like our password, we will try again with new pair, maximum of 10 times, then stop with error.
Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id
login
path
integer (int64)
yes
User identifier
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/MT5/{tradePlatform}/UserAccountGet/{login}
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id
login
path
integer (int64)
yes
User identifier
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id
logins
query
integer (int64)[]
no
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id
login
path
integer (int64)
yes
User identifier
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/MT5/{tradePlatform}/UserGetByGroup/{mask}
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id
mask
path
string
yes
Groups for which accounts are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using characters "*" (any value) and "!" (exception). For example: "demo*,!demoforex" - all groups with the names beginning with 'demo', except for the group demoforex
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/MT5/{tradePlatform}/UserAccountRequest/{login}
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id
login
path
integer (int64)
yes
User identifier
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
POST /api/MT5/{tradePlatform}/UserPasswordCheck/{login}/{type}
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
string (application/json) — Value of password to be checked
POST /api/MT5/{tradePlatform}/UserPasswordChange/{login}/{type}
Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
How long to wait for the trade server, in seconds (1–300). Default for this operation: 15 s (change). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
string (application/json) — Value of password to be changed
Get and set the account status as per the minimum amount of funds on the account required to maintain trading positions.
soTime
string (date-time), nullable
Get and set the time when the Margin Call or Stop Out level was reached.
soLevel
number (double), nullable
Get and set the margin level of an account at the time of reaching the Stop Out level.
soEquity
number (double), nullable
Get and set the account equity at the time of reaching the Stop Out level.
soMargin
number (double), nullable
Get and set the margin amount on an account at the time of reaching the Stop Out level.
blockedCommission
number (double), nullable
Get and set the amount of the standard commission locked on the account, which has been accumulated during the day/month.
blockedProfit
number (double), nullable
Get and set the amount of intraday profit locked on the account.
marginInitial
number (double), nullable
Get and set the current size of the initial margin of positions on a trading account.
marginMaintenance
number (double), nullable
Get and set the current size of the maintenance margin of positions on a trading account.
assets
number (double), nullable
Get and set the current total amount of assets on a trading account.
liabilities
number (double), nullable
Get and set the current total amount of liabilities on a trading account.
UsersPasswords
Password slot of an account. The trade server has these three slots only: the master (Main), the investor and the API password. Trader is not a slot of the platform and is not accepted by the API.
Values: Main, Investor, API
UsersRights
User rights Default = Enabled | Password | Trailing | Expert | Reports Flags: names of the set bits joined by ", " ("Enabled, Password"), "None" when none is set; a set bit without a name is "Bit<n>" (bit number). Bits: Enabled = 0x1, Password = 0x2, TradeDisabled = 0x4, Investor = 0x8, Confirmed = 0x10, Trailing = 0x20, Expert = 0x40, Obsolete = 0x80, Reports = 0x100, Readonly = 0x200, ResetPass = 0x400, OTPEnabled = 0x800, UNKNOWN1000 = 0x1000, SponsoredHosting = 0x2000, APIEnabled = 0x4000, PushNotification = 0x8000, Technical = 0x10000, ExcludeReports = 0x20000, UNKNOWN40000 = 0x40000, UNKNOWN80000 = 0x80000. Accepted on input, never written: Default = Enabled, Password, Trailing, Expert, Reports; All = Enabled, Password, TradeDisabled, Investor, Confirmed, Trailing, Expert, Obsolete, Reports, Readonly, ResetPass, OTPEnabled, SponsoredHosting, APIEnabled, PushNotification, Technical, ExcludeReports.