CPlugin

MT5 :: Users

API v1 (stable) · 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 from https://auth.cplugin.net/connect/token (scope webapi). $TRADE_PLATFORM_ID is the id of a trade platform registered in Toolbox.

Operations

Add user

POST /api/MT5/{tradePlatform}/UserAdd

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: IMTUser::Group and IMTUser::Leverage, as well as IMTUser::FirstName or IMTUser::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 IMTUser::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 call manager api method to create user. 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

NameInTypeRequiredDescription
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.

Request body

MT5UserAdd (application/json) — User to create

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserAdd" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "group": "", "leverage": 0, "password": "", "passwordInvestor": "", "login": 0, "certSerialNumber": 0 }'

Request User

GET /api/MT5/{tradePlatform}/UserRequest/{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

NameInTypeRequiredDescription
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.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserRequest/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Get Account (pumping)

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

NameInTypeRequiredDescription
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.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserAccountGet/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Accounts by the list of logins (pumping)

GET /api/MT5/{tradePlatform}/UserGetByLogins

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

NameInTypeRequiredDescription
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: 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.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserGetByLogins" \
  -H "Authorization: Bearer $TOKEN"

Get User (pumping)

GET /api/MT5/{tradePlatform}/UserGet/{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

NameInTypeRequiredDescription
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.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserGet/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

User get by Group (pumping)

GET /api/MT5/{tradePlatform}/UserGetByGroup/{mask}

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

NameInTypeRequiredDescription
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: 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.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserGetByGroup/$MASK" \
  -H "Authorization: Bearer $TOKEN"

Request Account

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

NameInTypeRequiredDescription
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.

Responses

Example

curl "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserAccountRequest/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Update User

POST /api/MT5/{tradePlatform}/UserUpdate

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

NameInTypeRequiredDescription
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.

Request body

MT5User (application/json) — User to be updated

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserUpdate" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "group": "", "leverage": 0, "login": 0, "certSerialNumber": 0, "rights": "", "registration": "2026-01-01T00:00:00Z" }'

Password - check

POST /api/MT5/{tradePlatform}/UserPasswordCheck/{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.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id
login path integer (int64) yes User's login
type path UsersPasswords yes Type of password to be checked
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.

Request body

string (application/json) — Value of password to be checked

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserPasswordCheck/$LOGIN/$TYPE" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '""'

Password - change

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.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id
login path integer (int64) yes User's login
type path UsersPasswords yes Type of password to be changed
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.

Request body

string (application/json) — Value of password to be changed

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/MT5/$TRADE_PLATFORM_ID/UserPasswordChange/$LOGIN/$TYPE" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '""'

Schemas

Types the operations above take and return, with their first-level properties; * marks a required one. The full graph is in the OpenAPI specification.

MT5UserAdd

PropertyTypeDescription
password string, nullable [optional] Custom Password, or it will be generated
passwordInvestor string, nullable [optional] Custom Investor's password, or it will be generated
login integer (int64), nullable login
group * string group
certSerialNumber integer (int64), nullable certificate serial number
rights UsersRights UsersRights
registration string (date-time), nullable registration datetime (filled by MT5)
lastAccess string (date-time), nullable
lastIP string, nullable Has No Setter In ManagerAPI, so all you can is to read this value.
name string, nullable name
company string, nullable company
account string, nullable external system account (exchange, ECN, etc)
country string, nullable country
language integer (int32), nullable client language (WinAPI LANGID)
city string, nullable city
state string, nullable state
zipCode string, nullable ZIP code
address string, nullable
phone string, nullable
eMail string, nullable
id string, nullable
status string, nullable
comment string, nullable
color integer (int32), nullable
phonePassword string, nullable
leverage * integer (int32)
agent integer (int64), nullable
balance number (double), nullable
credit number (double), nullable
interestRate number (double), nullable
commissionDaily number (double), nullable
commissionMonthly number (double), nullable
commissionAgentDaily number (double), nullable
commissionAgentMonthly number (double), nullable
balancePrevDay number (double), nullable
balancePrevMonth number (double), nullable
equityPrevDay number (double), nullable
equityPrevMonth number (double), nullable
lastPassChange string (date-time), nullable
mqid string, nullable
leadCampaign string, nullable
leadSource string, nullable
clientID integer (int64), nullable
firstName string, nullable
lastName string, nullable
middleName string, nullable
otpSecret string, nullable

MT5User

PropertyTypeDescription
login integer (int64), nullable login
group * string group
certSerialNumber integer (int64), nullable certificate serial number
rights UsersRights UsersRights
registration string (date-time), nullable registration datetime (filled by MT5)
lastAccess string (date-time), nullable
lastIP string, nullable Has No Setter In ManagerAPI, so all you can is to read this value.
name string, nullable name
company string, nullable company
account string, nullable external system account (exchange, ECN, etc)
country string, nullable country
language integer (int32), nullable client language (WinAPI LANGID)
city string, nullable city
state string, nullable state
zipCode string, nullable ZIP code
address string, nullable
phone string, nullable
eMail string, nullable
id string, nullable
status string, nullable
comment string, nullable
color integer (int32), nullable
phonePassword string, nullable
leverage * integer (int32)
agent integer (int64), nullable
balance number (double), nullable
credit number (double), nullable
interestRate number (double), nullable
commissionDaily number (double), nullable
commissionMonthly number (double), nullable
commissionAgentDaily number (double), nullable
commissionAgentMonthly number (double), nullable
balancePrevDay number (double), nullable
balancePrevMonth number (double), nullable
equityPrevDay number (double), nullable
equityPrevMonth number (double), nullable
lastPassChange string (date-time), nullable
mqid string, nullable
leadCampaign string, nullable
leadSource string, nullable
clientID integer (int64), nullable
firstName string, nullable
lastName string, nullable
middleName string, nullable
otpSecret string, nullable

MT5Error

PropertyTypeDescription
errorDescription string, nullable MT5 ManagerAPI response code description.
errorCode MT5Result MT5 ManagerAPI response code
errorType MT5ResultType type of error described here
requestId string (uuid) Unique request tracking ID

MT5Account

PropertyTypeDescription
login * integer (int64) Get and set the login of the client, to whom the trading account belongs.
currencyDigits integer (int32), nullable Get and set the number of decimal places in the account deposit currency.
balance number (double), nullable Get and set the balance of a trading account.
credit number (double), nullable Get and set the current amount of credit given to an account.
margin number (double), nullable Get and set the current value of the account margin.
marginFree number (double), nullable Get and set the free margin of an account.
marginLevel number (double), nullable Get and set the margin level as a percentage.
marginLeverage integer (int32), nullable Get and set the margin leverage.
profit number (double), nullable Get and set the size of the current profit for all open positions.
storage number (double), nullable Get and set the current size of swaps charged for open positions on the account.
floating number (double), nullable Get and set the size of floating profit/loss of open positions on the account.
equity number (double), nullable Get and set account equity.
soActivation SoActivation 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

Values: Main, Investor, API, Trader

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.

MT5Result

Values: Ok, OkNone, Error, ErrParams, ErrData, ErrDisk, ErrMem, ErrNetwork, ErrPermissions, ErrTimeout, ErrConnection, ErrNoService, ErrFrequent, ErrNotfound, ErrPartial, ErrShutdown, ErrCancel, ErrDuplicate, AuthClientInvalid, AuthAccountInvalid, AuthAccountDisabled, AuthAdvanced, AuthCertificate, AuthCertificateBad, AuthNotConfirmed, AuthServerInternal, AuthServerBad, AuthUpdateOnly, AuthClientOld, AuthManagerNoConfig, AuthManagerIPBlock, AuthGroupInvalid, AuthCaDisabled, AuthInvalidID, AuthInvalidIp, AuthInvalidType, AuthServerBusy, AuthServerCert, AuthAccountUnknown, AuthServerOld, AuthServerLimit, AuthMobileDisabled, AuthManagerType, AuthDemoDisabled, AuthResetPassword, AuthOTPInvalid, AuthOTPNeedSecret, AuthMigrationMT4, AuthMigrationMT5, AuthInvalidVerify, AuthVerifyBadEmail, AuthVerifyBadPhone, AuthAPIDisabled, CfgLastAdmin, CfgLastAdminGroup, CfgNotEmpty, CfgInvalidRange, CfgNotManagerLogin, CfgBuiltin, CfgDuplicate, CfgLimitReached, CfgNoAccessToMain, CfgDealerIDExist, CfgBindAddressExist, CfgWorkingTrade, CfgGatewayNameExist, CfgSwitchToBackup, CfgNoBackupModule, CfgNoTradeModule, CfgNoHistoryModule, CfgAnotherSwitch, CfgNoLicenseFile, CfgGatewayLoginExist, CfgInvalidCompany, UsrLastAdmin, UsrLoginExhausted, UsrLoginProhibited, UsrLoginExist, UsrSuicide, UsrInvalidPassword, UsrLimitReached, UsrHasTrades, UsrDifferentServers, UsrDifferentCurrency, UsrImportBalance, UsrImportGroup, UsrAccountExist, UsrImportAccount, UsrImportPositions, UsrImportOrders, UsrImportDeals, UsrImportHistory, UsrAPILimitReached, TradeLimitReached, TradeOrderExist, TradeOrderExhausted, TradeDealExhausted, TradeMaxMoney, TradeDealExist, TradeOrderProhibited, TradeDealProhibited, TradeSplitVolume, ReportSnapshot, ReportNotSupported, ReportNodata, ReportTemplateBad, ReportTemplateEnd, ReportInvalidRow, ReportLimitRepeat, ReportLimitReport, HstSymbolNotfound, RequestInWay, RequestAccepted, RequestProcess, RequestRequote, RequestPrices, RequestReject, RequestCancel, RequestPlaced, RequestDone, RequestDonePartial, RequestError, RequestTimeout, RequestInvalid, RequestInvalidVolume, RequestInvalidPrice, RequestInvalidStops, RequestTradeDisabled, RequestMarketClosed, RequestNoMoney, RequestPriceChanged, RequestPriceOff, RequestInvalidExp, RequestOrderChanged, RequestTooMany, RequestNoChanges, RequestAtDisabledServer, RequestAtDisabledClient, RequestLocked, RequestFrozen, RequestInvalidFill, RequestConnection, RequestOnlyReal, RequestLimitOrders, RequestLimitVolume, RequestInvalidOrder, RequestPositionClosed, RequestExecutionSkipped, RequestInvalidCloseVolume, RequestCloseOrderExist, RequestLimitPositions, RequestRejectCancel, RequestLongOnly, RequestShortOnly, RequestCloseOnly, RequestProhibitedByFifo, RequestHedgeProhibited, RequestReturn, RequestDoneCancel, RequestRequoteReturn, ErrNotImplement, ErrNotMain, ErrNotSupported, ErrDeadlock, ErrLocked, MessengerInvalidPhone, MessengerNotMobile, SubsNotFound, SubsNotFoundCfg, SubsNotFoundUser, SubsDisabled, SubsPermissionUser, SubsPermissionSubscribe, SubsPermissionUnsubscribe, SubsRealOnly, SubsPaymentMethod, PayRealOnly, PayInvalidAmount, PayNotAllowedDeposit, PayNotAllowedWithdrawal, PayNotAllowedGroup, PayNotAllowedCountry, PayDeclineByRules, PayDeclineByAml, PayLimitDepositMin, PayLimitDepositMax, PayLimitWithdrawalMin, PayLimitWithdrawalMax, PayProviderPayment, PayProviderStatus, PayConversion, PayNotWaiting, PayVerification, PayInvoice, PayInvalidCurrency, PayLimitReached, PayProviderRefund, PayDeclineByCardholderName

MT5ResultType

type of error described here

Values: HTTP, MT4API, MT5API

SoActivation

Values: None, MarginCall, StopOut