CPlugin

MT5 v2 :: Users

API v2 (current) · MT5 · 36 operations · base URL https://cloud.mywebapi.com · OpenAPI v2 (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 failed operation is also answered with HTTP 200: check error before using data. Access and transport failures use HTTP codes — see Errors.

Operations

Get a user by login

GET /api/v2/MT5/{tradePlatform}/UserGet/{login}

Returns the user record as held by the local cached copy. The data is as fresh as the last update delivered by the server, so it can lag behind a direct server request. The call only reads and changes nothing. It requires the live connection of users; without it the platform answers with an error.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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/v2/MT5/$TRADE_PLATFORM_ID/UserGet/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Partially update a user

PATCH /api/v2/MT5/{tradePlatform}/UserRecord/{login}

Send only the fields you want to change; omitted fields keep their current values and are not written back. An object with no fields, a field that is not part of the update record, an explicit null and a value of the wrong type are refused as validation errors — a mistyped key never becomes a silent no-op. Returns the updated record.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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

object (application/json, required) — Object with only the fields to change; unknown fields and nulls are refused.

Responses

Example

curl -X PATCH "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/UserRecord/$LOGIN" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Update a user record

POST /api/v2/MT5/{tradePlatform}/UserUpdate

Changes the account named by the login query parameter. Only the fields present in the body are written: the record is read from the trade server, the body is applied over it, and the merged record is written back. A field left out keeps its server value; for the string fields, omitting the key keeps the value while sending "" clears it. A body without any field is rejected. The body must be the user update object — a full user record is not accepted.

The login identifies the record and is not part of the body; it is never changed by this call. An unknown login is answered with the trade server's error code. An unknown value of an enum field is answered as a validation error. The response is the updated record.

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 identifier (GUID).
login query integer (int64) no User login (account number) of the record to update.
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

MT5UserUpdate (application/json) — Fields to change; omitted fields keep their current value.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/UserUpdate" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "group": "", "name": "", "company": "", "country": "", "city": "", "state": "" }'

Create a user account

POST /api/v2/MT5/{tradePlatform}/UserAdd

Creates a trading account on the trade server. Every field of the record is optional: a field left out is not written to the new account, so it keeps the value the platform starts it with — and that value is None for rights, so an account created without rights cannot log in until the flag is granted. Send rights (at least Enabled) to make the account usable.

A real trade server also refuses creation without a leverage (MT_RET_ERR_PARAMS): send leverage together with the group.

When the login field is absent or zero the server allocates one from the available range; when no logins are left the call fails with the platform error MT_RET_USR_LOGIN_EXHAUSTED. The group must be set, as well as the first or the last name of the account holder; otherwise the call fails with MT_RET_ERR_PARAMS. Adding an account whose login already exists fails with MT_RET_USR_LOGIN_EXIST.

Passwords are checked against the group policy. When either the master or the investor password is absent, both are regenerated to the group minimum length; a password the policy refuses is replaced with a fresh pair and the creation is repeated up to ten times. A failure of any other kind ends the call at once — a retry after a timeout could create a second account, since the first attempt may have succeeded unseen. The response carries the record as stored by the server, including the allocated login. The generated passwords are returned once, with passwordsAvailable set; passwords you supplied yourself are not echoed back. A repeated call that is answered from the idempotent cache never contains a password and reports passwordsAvailable: false.

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 identifier (GUID).
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

MT5UserAddRequest (application/json) — User record to create.

Responses

Example

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

Read a user from the trade server

GET /api/v2/MT5/{tradePlatform}/UserRequest/{login}

Fetches the current user record of the given login directly from the trade server database. Unlike the cached read, this call reflects changes made on the server side immediately. The call only reads and changes nothing. A login that does not exist is answered with the platform error MT_RET_USR_LOGIN_NOT_FOUND.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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/v2/MT5/$TRADE_PLATFORM_ID/UserRequest/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Read the account state from the cached copy

GET /api/v2/MT5/{tradePlatform}/UserAccountGet/{login}

Returns the trading state of the account — balance, credit, margin, equity and stop-out values — as held by the local cached copy. The data is as fresh as the last update delivered by the server, so it can lag behind a direct server request. The call only reads and changes nothing. It requires the live connection of users, orders and positions; without it the platform answers with an error.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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/v2/MT5/$TRADE_PLATFORM_ID/UserAccountGet/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Read several users from the cached copy by logins

GET /api/v2/MT5/{tradePlatform}/UserGetByLogins

Returns the cached records of the requested logins in one call, which is cheaper than reading them one by one. Logins that the cache does not hold are absent from the result. The call only reads and changes nothing. It requires the live connection of users.

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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
logins query integer (int64)[] no Logins to read.
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.

Responses

Example

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

Read users of a group mask from the cached copy

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

Returns the cached records of all accounts that match the group mask. The mask accepts one group, several groups separated by commas, and the * (any value) and ! (exception) characters, for example demo*,!demoforex. The call only reads and changes nothing. It requires the live connection of users.

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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
mask path string yes Group, comma-separated groups or a group mask.
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.

Responses

Example

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

Read the account state from the trade server

GET /api/v2/MT5/{tradePlatform}/UserAccountRequest/{login}

Returns the trading state of the account — balance, credit, margin, equity and stop-out values — requested directly from the trade server instead of the local cache. The call only reads and changes nothing. It requires the live connection of users, orders and positions; without it the platform answers with an error.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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/v2/MT5/$TRADE_PLATFORM_ID/UserAccountRequest/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Check a user password

POST /api/v2/MT5/{tradePlatform}/UserPasswordCheck/{login}/{type}

Verifies the submitted value against the stored password of the given slot — Main, Investor or API. Trader is not a slot of the platform and is refused. The call only compares values and changes nothing. It answers true when the password matches and false when it does not, so a wrong password is not an error.

Because the answer tells whether a guessed password is right, the call is protected against being used as a password oracle: it requires the right to change user records (not a read-only key), and after five wrong values for the same platform and account within fifteen minutes further checks are refused with the Busy error until the window passes.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
type path UsersPasswords yes Password slot to check: Main, Investor or API.
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.

Request body

string (application/json) — Password value to check.

Responses

Example

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

Change a user password

POST /api/v2/MT5/{tradePlatform}/UserPasswordChange/{login}/{type}

Replaces the stored password of the given slot — Main, Investor or API — with the submitted value. The new password must satisfy the group policy, otherwise the platform rejects the change with an error. A successful change answers true; the other password types are left untouched.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
type path UsersPasswords yes Password slot to change: Main, Investor or API.
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) — New password value.

Responses

Example

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

Delete a user

POST /api/v2/MT5/{tradePlatform}/UserDelete/{login}

Removes the trading account with the given login from the trade server database. The operation is not reversible: the record is gone. The response carries the platform result code, which is the successful code when the account was deleted. Deleting an account that has never existed fails with a platform 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 identifier (GUID).
login path integer (int64) yes User login (account number).
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.

Responses

Example

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

Read the certificate of an account

GET /api/v2/MT5/{tradePlatform}/UserCertGet/{login}

Returns the certificate issued to the account under the extended authorization mode of its group: serial number, validity period, the names of the subject and of the issuer, and whether the certificate belongs to a certification authority. The key material is not part of the response.

The call only reads and changes nothing. An account without a certificate answers with the platform error rather than an empty record.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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/v2/MT5/$TRADE_PLATFORM_ID/UserCertGet/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Install or replace the certificate of an account

POST /api/v2/MT5/{tradePlatform}/UserCertUpdate/{login}

Replaces the certificate of the account with the submitted one; an account that has no certificate yet gets it installed. The submitted file must be a certificate the trade server accepts, otherwise the platform error is returned and the stored certificate stays as it was.

The change applies only when the caller is connected to the trade server that holds the account. Until the certificate is confirmed it cannot be used for authorization. The certificate body is neither returned nor logged by the service.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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

MT5CertificateRequest (application/json) — Certificate file contents.

Responses

Example

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

Reset the certificate of an account

POST /api/v2/MT5/{tradePlatform}/UserCertDelete/{login}

Removes the certificate the account uses for authorization in an extended authorization mode. Authorization with the certificate becomes impossible; the server issues a new one on the next connection attempt of the account. The call does not touch the account record itself, and repeated calls do not restore the certificate.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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.

Responses

Example

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

Confirm the certificate of an account

POST /api/v2/MT5/{tradePlatform}/UserCertConfirm/{login}

Marks the issued certificate as trusted, which is what allows the account to authorize with it in the extended authorization mode. The call only changes the confirmation state of the certificate and is idempotent: confirming a confirmed certificate keeps it confirmed.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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.

Responses

Example

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

Read an account by its number in an external trading system, from the cached copy

GET /api/v2/MT5/{tradePlatform}/UserExternalGet/{account}

Finds the account whose record carries the given number of an external trading system and returns it as held by the local cached copy. When several accounts carry the same number, the nearest record is returned.

The gateway identifier is optional: without it the number is matched against every gateway. The call only reads and changes nothing. It requires the live connection of users.

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 identifier (GUID).
account path string yes Account number in the external trading system.
gatewayId query integer (int64) no Gateway identifier the number belongs to; optional.
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/v2/MT5/$TRADE_PLATFORM_ID/UserExternalGet/$ACCOUNT" \
  -H "Authorization: Bearer $TOKEN"

Read an account by its number in an external trading system, from the trade server

GET /api/v2/MT5/{tradePlatform}/UserExternalRequest/{account}

Same lookup as the cached read, but the record is requested from the trade server instead of the local cache, so it reflects changes made on the server immediately. When several accounts carry the same external number, the nearest record is returned.

The gateway identifier is optional: without it the number is matched against every gateway. The call only reads and changes nothing.

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 identifier (GUID).
account path string yes Account number in the external trading system.
gatewayId query integer (int64) no Gateway identifier the number belongs to; optional.
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/v2/MT5/$TRADE_PLATFORM_ID/UserExternalRequest/$ACCOUNT" \
  -H "Authorization: Bearer $TOKEN"

Synchronize an account with an external trading system

POST /api/v2/MT5/{tradePlatform}/UserExternalSync/{login}

Asks the gateway to bring the trading state of the account in line with the external trading system it is linked to, and creates the correcting operations that follow from the difference. Such operations appear in the trading history of the account.

The scope of the synchronization is chosen by the request: the whole state, the balance, the open positions or the pending orders. The call works only when the gateway in use provides trading-state synchronization and the account is linked to the external system; otherwise the platform error is returned and nothing changes.

The operation is not idempotent — a repeat after an unclear outcome may create the correcting operations a second time.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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

MT5ExternalSyncRequest (application/json) — Gateway, external account and scope of the synchronization.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/UserExternalSync/$LOGIN" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "gatewayId": 0, "account": "", "syncMode": "" }'

Check the balance and credit of an account against its deals history

POST /api/v2/MT5/{tradePlatform}/UserBalanceCheck/{login}

Adds up the deals of the account and compares the result with the balance and credit held by the account record. The response carries both pairs of values, so the caller sees the size of a discrepancy even when no correction was requested.

With fix set, the record is corrected to match the history before the response is built; without it nothing is written. A mismatch is not an error: it is reported by the mismatch flag of the response, while the platform error is returned for an unknown account or a failed check.

Timeout: 5 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 identifier (GUID).
login path integer (int64) yes User login (account number).
fix query boolean no Whether the account is corrected to match its deals history.
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). 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 -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/UserBalanceCheck/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Check the balance and credit of several accounts against their deals history

POST /api/v2/MT5/{tradePlatform}/UserBalanceCheckBatch

Checks every submitted login in one call, with the same comparison and the same optional correction as the single-account check. The response lists the accounts in the order they were submitted.

Every account is reported on its own, with its login and the measured figures. A partly completed batch answers the same list: an account the server did not process carries the code that explains it, and the accounts that were checked carry their figures, so a partial correction is never mistaken for a complete one. Without the correction flag no account is written to.

Timeout: 5 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 identifier (GUID).
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). 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

MT5BalanceCheckBatchRequest (application/json) — Logins to check and the correction flag.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/UserBalanceCheckBatch" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "logins": [0], "fix": false }'

Remove several accounts

POST /api/v2/MT5/{tradePlatform}/UserDeleteBatch

Removes every submitted account from the trade server database in one call. The operation is not reversible: the records are gone.

Every account is reported on its own, at the same index as in the request, also when only some of them were removed. Accounts that do not exist are reported with their own code; they do not stop the removal of the others.

The operation is not idempotent — a repeated delete reports the record as absent instead of deleting twice.

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 identifier (GUID).
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

MT5UserDeleteBatchRequest (application/json) — Logins of the accounts to remove.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/UserDeleteBatch" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "logins": [0] }'

Change several accounts

POST /api/v2/MT5/{tradePlatform}/UserUpdateBatch

Applies a partial record to every submitted account in one call. Each account is read from the trade server first, the submitted fields are applied, and the resulting record is written back, so a field left out keeps the value the server holds.

An account that cannot be read or changed fails the whole call before anything is written. Once the batch is handed to the server, every account is reported on its own at the same index as in the request, also when only some of them were changed.

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 identifier (GUID).
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

MT5UserUpdateBatchRequest (application/json) — Accounts to change and the fields to apply to each.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/UserUpdateBatch" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "users": [{}] }'

Change several accounts, submitted as separate records

POST /api/v2/MT5/{tradePlatform}/UserUpdateBatchArray

Same operation as the batch update and the same rules for the body: each account is read from the trade server, the submitted fields are applied and the resulting record is written back. The two routes differ only in how the records are handed to the trade server, and a client normally needs one of them.

An account that cannot be read or changed fails the whole call before anything is written. Once the batch is handed to the server, every account is reported on its own at the same index as in the request, also when only some of them were changed.

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 identifier (GUID).
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

MT5UserUpdateBatchRequest (application/json) — Accounts to change and the fields to apply to each.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/UserUpdateBatchArray" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "users": [{}] }'

Read the trading state of a group of accounts from the cached copy

GET /api/v2/MT5/{tradePlatform}/UserAccountGetByGroup/{mask}

Returns the cached trading states — balance, credit, margin, equity and stop-out — of every account that matches the group mask, in one call. The data is as fresh as the last update delivered by the server.

The mask accepts one group, several groups separated by commas, and the * (any value) and ! (exception) characters, for example demo*,!demoforex. The call only reads and changes nothing. It requires the live connection of users, orders and positions.

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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
mask path string yes Group, comma-separated groups or a group mask.
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.

Responses

Example

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

Read the trading state of several accounts from the cached copy

GET /api/v2/MT5/{tradePlatform}/UserAccountGetByLogins

Returns the cached trading states of the submitted logins in one call, which is cheaper than reading them one by one. Logins the cache does not hold are absent from the result. The call only reads and changes nothing. It requires the live connection of users, orders and positions.

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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
logins query integer (int64)[] no Logins to read.
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.

Responses

Example

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

Request the trading state of a group of accounts from the trade server

GET /api/v2/MT5/{tradePlatform}/UserAccountRequestArray/{group}

Returns the trading states of every account of the group, requested from the trade server instead of the local cache, so the values are current. The group name is given in full, including the path; several groups are separated by commas.

The call only reads and changes nothing. It requires the live connection of users, orders and positions.

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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
group path string yes Group name, or several groups separated by commas.
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.

Responses

Example

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

Request the trading state of several accounts from the trade server

GET /api/v2/MT5/{tradePlatform}/UserAccountRequestByLogins

Returns the trading states of the submitted logins, requested from the trade server instead of the local cache. Logins that do not exist make the call fail as a whole. The call only reads and changes nothing.

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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
logins query integer (int64)[] no Logins to read.
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.

Responses

Example

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

Request the records of a group of accounts from the trade server

GET /api/v2/MT5/{tradePlatform}/UserRequestArray/{group}

Returns the full records of every account of the group, requested from the trade server. The mask accepts one group, several groups separated by commas, and the * (any value) and ! (exception) characters, for example demo*,!demoforex.

The call only reads and changes nothing. It can be expensive on a large group: prefer the cached read when the freshness of the server is not required.

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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
group path string yes Group, comma-separated groups or a group mask.
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.

Responses

Example

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

Request the records of several accounts from the trade server

GET /api/v2/MT5/{tradePlatform}/UserRequestByLogins

Returns the full records of the submitted logins, requested from the trade server, so they reflect changes made on the server immediately. Logins that do not exist make the call fail as a whole. The call only reads and changes nothing.

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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
logins query integer (int64)[] no Logins to read.
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.

Responses

Example

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

List the logins of a group

GET /api/v2/MT5/{tradePlatform}/UserLogins/{group}

Returns the logins of every account that belongs to the group, without their records. The group name is given in full, including the path. The call only reads and changes nothing, and requires the live connection of users.

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

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform identifier (GUID).
group path string yes Group name.
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.

Responses

Example

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

Read the group of an account

GET /api/v2/MT5/{tradePlatform}/UserGroup/{login}

Returns the name of the group the account belongs to, as held by the local cached copy of users. The call only reads and changes nothing, and requires the live connection of users. An unknown login answers with the platform error.

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 identifier (GUID).
login path integer (int64) yes User login (account number).
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/v2/MT5/$TRADE_PLATFORM_ID/UserGroup/$LOGIN" \
  -H "Authorization: Bearer $TOKEN"

Send an email from one of the mail configurations of the trade server

POST /api/v2/MT5/{tradePlatform}/EmailSend

Queues an email for the recipient through the mail configuration named by the request. The configuration must exist on the trade server; without it the platform error is returned and nothing is sent.

The answer carries the platform result code: success means the server accepted the message for sending, not that it was delivered. The subject and the body are not stored or logged by the service.

The operation is not idempotent — a repeat after an unclear outcome delivers a second message.

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 identifier (GUID).
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

MT5EmailSendRequest (application/json) — Mail configuration, recipient and content.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/EmailSend" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "account": "", "to": "", "toName": "", "subject": "", "body": "" }'

Send an SMS through the messenger integration of the trade server

POST /api/v2/MT5/{tradePlatform}/MessengerSend

Queues an SMS to the phone number through the messenger integration configured on the trade server. A group may be named to pick the provider that serves it; without it the provider is chosen without regard to the group.

Success means the message was accepted for sending, not that it was delivered. An invalid or non-mobile number is answered with its own platform error, which names the reason. The message text is not stored or logged by the service.

The operation is not idempotent — a repeat after an unclear outcome delivers a second message.

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 identifier (GUID).
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

MT5MessengerSendRequest (application/json) — Phone number, optional group and sender, and the text.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/MessengerSend" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "destination": "", "group": "", "sender": "", "text": "" }'

Validate a phone number against the local numbering rules

POST /api/v2/MT5/{tradePlatform}/MessengerVerifyPhone

Checks the submitted number against the numbering rules the trade server uses and answers whether it may be used for messenger delivery. Nothing is sent and nothing changes.

The answer is false for a number the rules reject — an invalid number and a landline number both count as rejected; every other failure, such as an unavailable connection, is returned as a platform 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 identifier (GUID).
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) — Phone number in international format, for example +74951113594.

Responses

Example

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

Send a push notification to mobile terminals

POST /api/v2/MT5/{tradePlatform}/NotificationsSend

Delivers a short message to the mobile terminals of the named accounts, either by their logins on the trade server or by the MetaQuotes identifiers their terminals are registered with. Exactly one of the two addressing lists must be sent.

Success means the notification was accepted for delivery, not that it reached a terminal; delivery needs the mobile terminal of the platform to be installed and registered. The message is limited by the platform to 1024 characters and is not stored or logged by the service.

The operation is not idempotent — a repeat after an unclear outcome delivers a second message.

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 identifier (GUID).
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

MT5NotificationsSendRequest (application/json) — Recipients and the message text.

Responses

Example

curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/NotificationsSend" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "logins": [0], "metaQuotesIds": "", "message": "" }'

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.

MT5UserApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5User MT5 user, v2 read record — the full field set. Includes all editable fields mirrored from MT5UserUpdate plus read-only financial/metadata fields. Rights is a flags string: the names of the set bits, "Enabled, Password".
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5UserUpdate

MT5 user update record: the editable field set of an account, every field optional.

PropertyTypeDescription
group string, nullable User group name.
name string, nullable Full display name of the account holder.
company string, nullable Company or organisation name.
country string, nullable Client country.
city string, nullable Client city.
state string, nullable Client state or province.
zipCode string, nullable Client postal code.
phone string, nullable Client phone number.
eMail string, nullable Client email address.
comment string, nullable Internal comment on the account.
color integer (int32), nullable Colour tag assigned to the account in MT5 Manager (ARGB uint).
leverage integer (int32), nullable Account leverage (e.g. 100 = 1:100).
rights MT5UserRights Account permission flags: names of the set bits, "Enabled, Password" (the MT5UserRights schema).
account string, nullable Account ID string (external account identifier).
language integer (int32), nullable Client language code (MT5 locale uint).
address string, nullable Client postal/physical address.
id string, nullable Client document ID (passport, national ID, etc.).
status string, nullable Client KYC / account status label.
agent integer (int64), nullable Introducing agent login.
leadCampaign string, nullable Marketing lead campaign name.
leadSource string, nullable Marketing lead source name.
clientID integer (int64), nullable External CRM client ID.
firstName string, nullable Given name (first name).
lastName string, nullable Family name (last name).
middleName string, nullable Patronymic / middle name.

MT5UserAddRequest

Request body of the account-creation operation: the editable record plus the optional login and the two passwords.

PropertyTypeDescription
login integer (int64), nullable Account login to create. Omit or send zero to let the trade server allocate one.
password string, nullable Master password. Optional — generated when missing.
passwordInvestor string, nullable Investor (read-only) password. Optional — generated when missing.
group string, nullable User group name.
name string, nullable Full display name of the account holder.
company string, nullable Company or organisation name.
country string, nullable Client country.
city string, nullable Client city.
state string, nullable Client state or province.
zipCode string, nullable Client postal code.
phone string, nullable Client phone number.
phonePassword string, nullable Phone password used for telephone trading.
eMail string, nullable Client email address.
comment string, nullable Internal comment on the account.
color integer (int32), nullable Colour tag assigned to the account in MT5 Manager (ARGB uint).
leverage integer (int32), nullable Account leverage (e.g. 100 = 1:100).
rights MT5UserRights Account permission flags: names of the set bits, "Enabled, Password" (the MT5UserRights schema).
account string, nullable Account ID string (external account identifier).
language integer (int32), nullable Client language code (MT5 locale uint).
address string, nullable Client postal/physical address.
id string, nullable Client document ID (passport, national ID, etc.).
status string, nullable Client KYC / account status label.
agent integer (int64), nullable Introducing agent login.
leadCampaign string, nullable Marketing lead campaign name.
leadSource string, nullable Marketing lead source name.
clientID integer (int64), nullable External CRM client ID.
firstName string, nullable Given name (first name).
lastName string, nullable Family name (last name).
middleName string, nullable Patronymic / middle name.
registration string (date-time), nullable Account registration date and time.
otpSecret string, nullable Shared secret for two-factor authentication (OTP).

MT5UserAddResultApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5UserAddResult The created account, and the passwords only when the service generated them.
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5AccountApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5Account
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5UserListApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5User[]
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

BooleanApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data boolean
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

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

MT5ResultApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5Result
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5CertificateApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5Certificate Certificate issued to a trading account under an extended authorization mode.
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5CertificateRequest

Replacement certificate for an account, sent as the file contents.

PropertyTypeDescription
data string (byte), nullable Contents of the certificate file (Base64 in JSON).

MT5ExternalSyncRequest

Request to synchronize an account with an external trading system through a gateway.

PropertyTypeDescription
gatewayId integer (int64) Identifier of the gateway configuration.
account string, nullable Account number in the external trading system.
syncMode string, nullable Part of the trading state to synchronize. One of: All, Balance, Positions, Orders. Case-insensitive; the numeric value is accepted too. Any other value is refused with error code Validation.

MT5BalanceCheckResultApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5BalanceCheckResult Result of comparing the stored balance and credit of one account with its deals history.
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5BalanceCheckBatchRequest

Request to check, and optionally correct, the balance and credit of several accounts.

PropertyTypeDescription
logins integer (int64)[] Account logins to check.
fix boolean Whether the accounts are corrected to match their deals history after the check.

MT5BalanceCheckResultListApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5BalanceCheckResult[]
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5UserDeleteBatchRequest

Request to remove several trading accounts in one call.

PropertyTypeDescription
logins integer (int64)[] Logins of the accounts to remove.

MT5UserBatchResultListApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5UserBatchResult[]
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5UserUpdateBatchRequest

Request to change several trading accounts in one call.

PropertyTypeDescription
users MT5UserUpdateBatchItem[] Accounts to change; each is applied on its own and reported on its own.

MT5AccountListApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data MT5Account[]
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

UInt64ListApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data integer (int64)[]
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

StringApiResponse

Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). A call that reaches an operation answers HTTP 200 — only transport failures (401, 403, 404, 400, 5xx) use other status codes.

PropertyTypeDescription
data string, nullable
error ApiError v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

MT5EmailSendRequest

An email to send through one of the mail configurations of the trade server.

PropertyTypeDescription
account string, nullable Name of the mail configuration used for sending.
to string, nullable Recipient address.
toName string, nullable Recipient name shown by the mail client.
subject string, nullable Subject line.
body string, nullable Message body.

MT5MessengerSendRequest

An SMS to send through the messenger integration of the trade server.

PropertyTypeDescription
destination string, nullable Recipient phone number in international format, for example +74951113594.
group string, nullable Group whose provider serves the message; optional.
sender string, nullable Sender name, where the provider supports one; optional.
text string, nullable Message text.

MT5NotificationsSendRequest

A push notification to send to the mobile terminals of a set of accounts.

PropertyTypeDescription
logins integer (int64)[] Logins of the accounts to notify; used instead of MetaQuotesIds.
metaQuotesIds string, nullable Comma-separated MetaQuotes identifiers of the mobile terminals; used instead of Logins.
message string, nullable Text of the notification.

MT5User

MT5 user, v2 read record — the full field set. Includes all editable fields mirrored from MT5UserUpdate plus read-only financial/metadata fields. Rights is a flags string: the names of the set bits, "Enabled, Password".

PropertyTypeDescription
login integer (int64) User login (identity, read-only).
group string, nullable User group name.
name string, nullable Full display name of the account holder.
company string, nullable Company or organisation name.
country string, nullable Client country.
city string, nullable Client city.
state string, nullable Client state or province.
zipCode string, nullable Client postal code.
phone string, nullable Client phone number.
eMail string, nullable Client email address.
comment string, nullable Internal comment on the account.
color integer (int32) Colour tag assigned to the account in MT5 Manager (ARGB uint).
leverage integer (int32) Account leverage (e.g. 100 = 1:100).
account string, nullable Account ID string (external account identifier).
language integer (int32) Client language code (MT5 locale uint).
address string, nullable Client postal/physical address.
id string, nullable Client document ID (passport, national ID, etc.).
status string, nullable Client KYC / account status label.
agent integer (int64) Introducing agent login.
leadCampaign string, nullable Marketing lead campaign name.
leadSource string, nullable Marketing lead source name.
clientID integer (int64) External CRM client ID.
firstName string, nullable Given name (first name).
lastName string, nullable Family name (last name).
middleName string, nullable Patronymic / middle name.
rights MT5UserRights Account permission flags: names of the set bits, "Enabled, Password" (the MT5UserRights schema).
certSerialNumber integer (int64) SSL certificate serial number (read-only).
registration string (date-time), nullable Account registration timestamp (UTC). Null when not set (unix 0).
lastAccess string (date-time), nullable Last login timestamp (UTC). Null when not set.
lastPassChange string (date-time), nullable Last password change timestamp (UTC). Null when not set.
lastIP string, nullable Last known client IP address.
balance number (double) Current account balance.
credit number (double) Current credit facility amount.
interestRate number (double) Annual interest rate on credit.
commissionDaily number (double) Accumulated commission for the current day.
commissionMonthly number (double) Accumulated commission for the current month.
commissionAgentDaily number (double) Agent commission accrued today.
commissionAgentMonthly number (double) Agent commission accrued this month.
balancePrevDay number (double) Balance at end of previous trading day.
balancePrevMonth number (double) Balance at end of previous calendar month.
equityPrevDay number (double) Equity at end of previous trading day.
equityPrevMonth number (double) Equity at end of previous calendar month.

ApiError

v2 error body, present when a call failed even though it answered HTTP 200. Code is the stable error category. ManagerCode is the raw result code of the trade server on MT4 (null otherwise: on MT5 the result name is in Message). Message is a human-readable description.

PropertyTypeDescription
code WebApiErrorCode Stable transport-level error code.
managerCode ResultCode Raw MT4 result code when ApiError.Code is MT4Error; null otherwise. On MT5 the result name is in ApiError.Message.
message string, nullable Human-readable error description.

ApiMeta

Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.

PropertyTypeDescription
activityId string, nullable W3C trace id of the request. Quote it when you contact support: it finds this exact call in the server logs.
paging PagingMeta Pagination info; present only on list responses, omitted otherwise.

MT5UserRights

MT5 user permission flags. The bit positions match the platform's user rights. 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, SponsoredHosting = 0x2000, APIEnabled = 0x4000, PushNotification = 0x8000, Technical = 0x10000, ExcludeReports = 0x20000.

MT5UserAddResult

The created account, and the passwords only when the service generated them.

PropertyTypeDescription
user MT5User The account as the trade server stored it, including the allocated login.
password string, nullable The master password, when this answer carries passwords. Absent otherwise.
passwordInvestor string, nullable The investor (read-only) password, when this answer carries passwords. Absent otherwise.
passwordsAvailable boolean Whether MT5UserAddResult.Password and MT5UserAddResult.PasswordInvestor are in this answer. They are present only when the service generated them in this call; a repeated call answered from the idempotent cache always reports false and carries no password.

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.

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

MT5Certificate

Certificate issued to a trading account under an extended authorization mode.

PropertyTypeDescription
serialNumber integer (int64) Serial number of the certificate.
validFrom string (date-time), nullable Start of the validity period, or null when the certificate is not opened.
validTo string (date-time), nullable End of the validity period, or null when the certificate is not opened.
nameCommon string, nullable Common name (CN) of the certificate subject.
nameIssuer string, nullable Common name (CN) of the issuing authority.
nameOrganization string, nullable Organization (O) of the certificate subject.
nameOrganizationUnit string, nullable Organizational unit (OU) of the certificate subject.
nameGiven string, nullable Given name of the certificate subject.
isRoot boolean Whether the certificate is a root certificate of a certification authority.
isCA boolean Whether the certificate belongs to a certification authority.
isOpened boolean Whether the stored blob could be parsed as a certificate.
rawSize integer (int32) Size of the stored certificate blob in bytes.

MT5BalanceCheckResult

Result of comparing the stored balance and credit of one account with its deals history.

PropertyTypeDescription
login integer (int64) Account login the result belongs to.
balanceUser number (double) Balance stored in the account record at the time of the check.
balanceHistory number (double) Balance the deals history adds up to.
creditUser number (double) Credit stored in the account record at the time of the check.
creditHistory number (double) Credit the deals history adds up to.
mismatch boolean Whether the stored balance or credit differs from the history.

MT5UserBatchResult

Outcome of a batch operation for one account.

PropertyTypeDescription
login integer (int64) Login of the account the result belongs to.
code MT5Result Result of the operation for this account.

MT5UserUpdateBatchItem

One account of a batch update: the login it belongs to and the fields to change.

PropertyTypeDescription
login integer (int64) Login of the account to change.
user MT5UserUpdate Fields to change on that account.