API v2 (current) · MT4 · 9 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.
All trading groups configured on the MT4 server from the cached copy.
Cached read. Curated record drops SMTP credentials, template paths,
and nested SecGroups/SecMargins arrays (those are read with
GroupSecGroupsGet and GroupSecMarginsGet). Typical group
counts are small (dozens), so no pagination is needed.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id (GUID)
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT4/{tradePlatform}/GroupRecordGet/{group}
Single trading group configuration by name (cached).
Cached lookup. Returns NotFound envelope if no group with the
given name exists. Group names are case-sensitive — the platform does
an exact dictionary lookup.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id (GUID)
group
path
string
yes
Group name (max 16 chars)
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.
Asks the trade server and returns a paged list of all configured groups on the platform. Sort key is the group name (string, ordinal compare) ascending. Cursor is the last returned group name encoded as opaque base64.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
limit
query
integer (int32)
no
Maximum number of items to return in one page. Omit to return all items in a single page. Maximum allowed value is 5000.
cursor
query
string
no
Opaque continuation token. Pass the value from the previous response's meta.paging.nextCursor to fetch the next page; omit for the first page. A token is accepted only by the call that issued it: a corrupt, truncated or foreign token answers a Validation error instead of restarting from the first page.
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.
Asks the trade server and returns the group configuration set as stored on
the MT4 server — the same data the platform persists for
CfgUpdateGroup, unlike the cached GroupsGet.
Curated record: SMTP credentials and template paths are dropped, and the
nested security/margin arrays are served by their own endpoints. Order
follows the server response. Typical group counts are small, so no
pagination is needed.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id (GUID)
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT4/{tradePlatform}/GroupSecGroupsGet/{group}
Security-group entries (SecGroups[32]) for one trading group.
Cached read. Returns the full 32-element array; entries whose
Trade and Show are both 0 are placeholders (the platform
reserves the slot for the symbol-group regardless of whether the
group is configured to trade it). Filter on the client side.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id (GUID)
group
path
string
yes
Group name (max 16 chars)
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT4/{tradePlatform}/GroupSecMarginsGet/{group}
Special-securities margin overrides (SecMargins) for one group.
Cached read. Returns the first SecMarginsTotal entries of
the platform's 128-element SecMargins array — the trailing
slots are always uninitialised padding. SecMarginsTotal itself
is part of the parent MT4Group 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
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id (GUID)
group
path
string
yes
Group name (max 16 chars)
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.
Change a trading group. The group field of the body names the target group and is
never changed; the response is a boolean.
Only the fields present in the body are written: the group is read live from the trade
server, the body is applied over it, and the merged record is written back. A field that
is left out keeps its server value; for the string fields, omitting the key keeps the
value while sending "" clears it. Fields the body cannot carry (SMTP credentials,
templates, the securities hash, reserved and nested arrays) keep their server values. A
body with the group name but no field to change is rejected, and a string that does not
fit the platform's fixed buffer is refused with the field name instead of being cut.
Idempotency-Key strongly recommended: the change applies to every
account in the group at once.
Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id (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
MT4GroupUpdate (application/json) — Group name plus the fields to change; omitted fields keep their server value
Partial update of a trading group: only the fields you send change. Same read-merge-write flow as the account patch: a patch must carry at least one known field, unknown keys and values of the wrong type are Validation errors, an explicit null clears a string field (and is refused elsewhere), and string values are checked against the platform's fixed buffers.
Timeout: 15 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id (GUID)
group
path
string
yes
Group name (immutable identity)
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) — JSON Merge Patch: an object with only the fields to change.
GET /api/v2/MT4/{tradePlatform}/EnsureGroupNameExist/{group}
Checks whether a trading group exists on the connected MT4 server. Useful as a validation pre-flight before creating users, moving users between groups, or wiring up automated provisioning.
The check enumerates the group catalog and looks the name up; there is no cheaper call for it
on the trade-server surface, so it costs the same as listing the groups.
Returns true if the group is configured on the server,
false otherwise. Group lookup is case-sensitive (MT4 group
names are case-sensitive in the underlying API).
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform id (GUID)
group
path
string
yes
Group name to look up (max 16 chars)
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.
Types the operations above take and return, with their first-level properties; * marks a required one. The full graph is in the OpenAPI specification.
MT4GroupListApiResponse
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.
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.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT4GroupApiResponse
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.
Trading group configuration: margin, leverage, rights and news settings. Server file paths, mail-server credentials and platform-internal arrays are not returned; the security entries of a group are read with GroupSecGroupsGet and GroupSecMarginsGet. Enums are returned as their names, and GroupRights is a flags string holding the names of the set bits.
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.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT4GroupSecListApiResponse
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.
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.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT4GroupMarginListApiResponse
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.
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.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT4GroupUpdate
Input shape for CfgUpdateGroup: the editable part of an MT4 trading group.
Property
Type
Description
group
string, nullable
Group name to update (required identity; never changed by this call)
Margin controlling unit (percent vs deposit currency)
archivePeriod
integer (int32), nullable
Inactivity period (days) before account archival
archiveMaxBalance
integer (int32), nullable
Max balance under which an account becomes archivable
stopoutSkipHedged
integer (int32), nullable
0 = include hedged in stop-out checks, non-zero = skip them
archivePendingPeriod
integer (int32), nullable
Pending orders clean-up period (days)
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.
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.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT4Group
Trading group configuration: margin, leverage, rights and news settings. Server file paths, mail-server credentials and platform-internal arrays are not returned; the security entries of a group are read with GroupSecGroupsGet and GroupSecMarginsGet. Enums are returned as their names, and GroupRights is a flags string holding the names of the set bits.
Property
Type
Description
group
string, nullable
Group name (unique per platform, max 16 chars)
enable
integer (int32)
0 = group disabled, non-zero = enabled (accounts in this group can log in)
Margin controlling unit (percent vs deposit currency)
archivePeriod
integer (int32)
Inactivity period (days) before account moves to archive
archiveMaxBalance
integer (int32)
Maximum balance under which an account is eligible for archiving
stopoutSkipHedged
integer (int32)
0 = include hedged accounts in stop-out checks, non-zero = skip them
archivePendingPeriod
integer (int32)
Pending orders clean-up period (days)
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.
Property
Type
Description
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.
Property
Type
Description
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.
MT4GroupSec
v2 record for one entry in a group's SecGroups array (32 elements indexed by symbol-group). Curated from ConGroupSec; drops the Reserved int[3] padding. Enum fields are returned as their names.
Property
Type
Description
show
integer (int32)
0 = security group hidden from clients, non-zero = visible
trade
integer (int32)
0 = trading disabled, non-zero = trading enabled
dealingMode
string, nullable
Dealing mode (Manual / Auto / Activity)
standardCommission
number (double)
Standard commission
commissionType
string, nullable
Commission type (Money / Pips / Percent)
commissionLotsMode
string, nullable
Commission lots mode (PerLot / PerDeal)
agentCommission
number (double)
Agent commission
agentCommissionMode
string, nullable
Agent commission type (Money / Pips)
spreadDiff
integer (int32)
Spread difference compared to default symbol spread
lotMin
integer (int32)
Minimum allowed lot size (in 1/100 lot units, e.g. 100 = 1 lot)
lotMax
integer (int32)
Maximum allowed lot size
lotStep
integer (int32)
Lot step (10 lot = 1000, 1 lot = 100, 0.1 lot = 10)
ieDeviation
integer (int32)
Max price deviation in Instant Execution mode
confirmation
integer (int32)
0 = no confirmation, non-zero = request mode confirmation
tradeRights
string, nullable
Clients trade rights bit mask (string-encoded)
ieQuickMode
integer (int32)
0 = normal, non-zero = don't resend on deviation in IE
v2 record for one of a group's "special securities" margin overrides. Curated from ConGroupMargin — the platform's per-symbol swap/margin overrides stored as a 128-element array on ConGroup.SecMargins. The Reserved int[7] padding is dropped.
Property
Type
Description
symbol
string, nullable
Symbol the override applies to (max 12 chars)
swapLong
number (double)
Swap charge for long positions
swapShort
number (double)
Swap charge for short positions
marginDivider
number (double)
Margin divider override (1.0 = use default)
OTPMode
Values: Disabled, TOTP_SHA256
MarginMode
Values: DontUse, UseAll, UseProfit, UseLoss
NewsMode
Values: No, Topics, Full
GroupRights
Flags: names of the set bits joined by ", " ("Signals, Trailing"), "None" when none is set; a set bit without a name is "Bit<n>" (bit number). Bits: Signals = 0x1, Trailing = 0x2, Advisor = 0x4, Expiration = 0x8, SignalAll = 0x10, SignalsOwn = 0x20, RiskWarning = 0x40, ForcedOTPUsage = 0x80.