API v2 (current) · MT5 · 27 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.
GET /api/v2/MT5/{tradePlatform}/PositionRequestByGroup/{mask}
Returns open positions for all logins in groups matching the mask,
ordered by Position ID ascending. Use the cursor for the next page; a cursor
that was not issued by this call is answered as a Validation error.
limit is optional and must be between 1 and 5000.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — exact group name or a wildcard like "real\*".
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: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/OrderGetByGroup/{mask}
Returns active and pending orders for all logins in groups matching the mask,
ordered by Order ID ascending. Use the cursor for the next page; a cursor
that was not issued by this call is answered as a Validation error.
limit is optional and must be between 1 and 5000.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — exact group name or a wildcard like "real\*".
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: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/DealRequestByGroup/{mask}
Returns deals for all logins in groups matching the mask, ordered by Deal ID ascending.
Both window bounds are optional: without them the whole history since 01.01.1970 is
read. Use the cursor for the next page; a cursor that was not issued by this
call is answered as a Validation error. limit is optional and
must be between 1 and 5000.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — exact group name or a wildcard like "real\*".
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.
from
query
string (date-time)
no
Window start; omitted means 01.01.1970.
to
query
string (date-time)
no
Window end; omitted means no upper bound.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/DealRequest/{login}
Returns the deal history of one account for the requested time window.
Both window bounds are optional: without them the whole history since 01.01.1970 is read.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
login
path
integer (int64)
yes
Account login.
from
query
string (date-time)
no
Window start; omitted means 01.01.1970.
to
query
string (date-time)
no
Window end; omitted means no upper bound.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/DealRequestByGroupSymbol/{mask}/{symbol}
Returns the deals of the accounts matching the group mask, limited to the given symbols,
for the requested time window. Several symbols may be listed comma-separated.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask, several groups or a negation list.
symbol
path
string
yes
One or more comma-separated symbols.
from
query
string (date-time)
no
Window start; omitted means 01.01.1970.
to
query
string (date-time)
no
Window end; omitted means no upper bound.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/DealRequestByTickets
Looks up deals by their ticket numbers passed in the query string.
For long lists use the POST variant, which takes the tickets in the body.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
tickets
query
integer (int64)[]
no
Deal tickets to look up.
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.
Deals by a list of tickets sent in the request body
POST /api/v2/MT5/{tradePlatform}/DealRequestByTickets
Same lookup as the GET variant, but the ticket list travels in the JSON body,
so it can be much longer without hitting URL length limits.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform 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: 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.
Request body
integer (int64)[] (application/json) — Deal tickets to look up.
GET /api/v2/MT5/{tradePlatform}/DealRequestByLogins
Returns the deals of several accounts in one call, for the requested time window.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
logins
query
integer (int64)[]
no
Account logins to read.
from
query
string (date-time)
no
Window start; omitted means 01.01.1970.
to
query
string (date-time)
no
Window end; omitted means no upper bound.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/DealRequestByTicket/{ticket}
Reads a single deal from the server history by its ticket number.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
ticket
path
integer (int64)
yes
Deal ticket.
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.
The server first reads the existing deal, then applies only the fields present in the body,
so fields left null keep their current values. Required fields of the deal must still be
valid on the server (login, symbol, action, volume, price, time, digits, contract size).
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
Name
In
Type
Required
Description
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
MT5Deal (application/json) — Deal fields to apply.
Deletes the listed deals and returns one result code per ticket, in the same order. If
the server processed the batch, the response carries no error in the top-level
envelope even when only part of it was applied; the result array is the outcome to
check, one code per ticket. On a complete failure no array is returned.
Deleting deals does not change balances or open positions, so the
account may afterwards fail consistency checks.
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
Name
In
Type
Required
Description
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
integer (int64)[] (application/json) — Deal tickets to delete.
GET /api/v2/MT5/{tradePlatform}/PositionGet/{login}
Returns all open positions of every symbol held by the account.
Under the hedged margin mode a position is identified by its ticket, not by login and symbol.
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 identifier (GUID).
login
path
integer (int64)
yes
Account login.
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/MT5/{tradePlatform}/PositionGetByLogins
Returns all open positions of several accounts in one call.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
logins
query
integer (int64)[]
no
Account 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.
GET /api/v2/MT5/{tradePlatform}/PositionGetByTickets
Returns the open positions identified by the given tickets. This is the only way to address
positions under the hedged margin mode.
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 identifier (GUID).
tickets
query
integer (int64)[]
no
Position tickets 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: 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/MT5/{tradePlatform}/PositionGetBySymbol/{mask}/{symbol}
Returns the open positions of the accounts matching the group mask, limited to the given
symbols. Several symbols may be listed comma-separated.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask, several groups or a negation list.
symbol
path
string
yes
One or more comma-separated symbols.
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.
POST /api/v2/MT5/{tradePlatform}/PositionDeleteBatch
Deletes the listed positions and returns one result code per ticket, in the same order.
If the server processed the batch, the response carries no error in the
top-level envelope even when only part of it was applied; the result array is the
outcome to check, one code per ticket. On a complete failure no array is returned.
Deleting positions does not touch the deal history, so the account may
afterwards fail consistency checks.
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
Name
In
Type
Required
Description
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
integer (int64)[] (application/json) — Position tickets to delete.
GET /api/v2/MT5/{tradePlatform}/OrderRequestByGroup/{mask}
Returns the orders of every login in the groups matching the mask. Only groups
belonging to the trade platform are scanned. The result is not paginated: the
whole set is returned at once, in the order the trade server reports it.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — one group, several comma-separated groups, or a mask with * (any value) and ! (exception), for example demo*,!demoforex.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/OrderGetBySymbol/{mask}/{symbol}
Returns the orders of the given symbol for the logins in the groups matching the
mask. The result is not paginated: the whole set is returned at once, in the order
the trade server reports it.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — one group, several comma-separated groups, or a mask with * (any value) and ! (exception), for example demo*,!demoforex.
symbol
path
string
yes
Symbol name — one symbol or several comma-separated symbols.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/OrderRequestByGroupSymbol/{mask}/{symbol}
Returns the orders of the given symbol for the logins in the groups matching the
mask. The result is not paginated: the whole set is returned at once, in the order
the trade server reports it.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — one group, several comma-separated groups, or a mask with * (any value) and ! (exception), for example demo*,!demoforex.
symbol
path
string
yes
Symbol name — one symbol or several comma-separated symbols.
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.
Orders can only be deleted from the application that created them; a different
connection answers with an error instead of deleting. The reply carries one result
per requested ticket, at the same index as in the request, so the caller can see
which orders were removed. On partial success the array carries a result for every
ticket and the caller inspects them itself; on a complete failure no array is
returned. A request without tickets is rejected as invalid input.
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
Name
In
Type
Required
Description
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
integer (int64)[] (application/json) — Tickets of the orders to delete, in request-body JSON array form.
Returns a single order of the trade database by its ticket. When the ticket is
unknown, the response carries the trade server's "not found" error code instead
of a 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 identifier (GUID).
ticket
path
integer (int64)
yes
Order ticket.
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.
Returns the orders of the given accounts. The result is not paginated: the whole
set is returned at once. Use the ticket-based form for a longer list than fits in
the query string.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
logins
query
integer (int64)[]
no
Account logins, repeated as logins=…&logins=… query parameters.
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.
Returns the orders with the given tickets. The result is not paginated: the whole
set is returned at once. For a list longer than fits in the query string, use the
request-body form.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
tickets
query
integer (int64)[]
no
Order tickets, repeated as tickets=…&tickets=… query parameters.
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.
POST /api/v2/MT5/{tradePlatform}/OrderRequestByTickets
Same result as the ticket query form, but the tickets are sent in the request body,
so a much longer list can be requested. The result is not paginated: the whole set
is returned at once.
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 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: 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
integer (int64)[] (application/json) — Order tickets, in request-body JSON array form.
GET /api/v2/MT5/{tradePlatform}/HistoryRequest/{login}
Returns the orders of a single account within a time window, closed and still
pending ones alike. Omitted bounds mean the whole history: from 01.01.1970 to the
latest moment. The result is not paginated: the whole window is returned at once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
login
path
integer (int64)
yes
Account login (account number).
from
query
string (date-time)
no
Window start; omit to start from 01.01.1970.
to
query
string (date-time)
no
Window end; omit to take everything up to the newest order.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/HistoryRequestByGroup/{mask}
Returns the orders of every login in the groups matching the mask within a time
window. Omitted bounds mean the whole history: from 01.01.1970 to the latest
moment. The result is not paginated: the whole window is returned at once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — one group, several comma-separated groups, or a mask with * (any value) and ! (exception), for example demo*,!demoforex.
from
query
string (date-time)
no
Window start; omit to start from 01.01.1970.
to
query
string (date-time)
no
Window end; omit to take everything up to the newest order.
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.
POST /api/v2/MT5/{tradePlatform}/HistoryRequestByTickets
Returns the order history records with the given tickets, sent in the request body
so a long list fits. The result is not paginated: the whole set is returned at
once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform 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: 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.
Request body
integer (int64)[] (application/json) — Order tickets, in request-body JSON array form.
Types the operations above take and return, with their first-level properties; * marks a required one. The full graph is in the OpenAPI specification.
MT5PositionListApiResponse
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.
MT5OrderListApiResponse
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.
MT5DealListApiResponse
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.
MT5DealApiResponse
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.
MT5Deal
Property
Type
Description
deal *
integer (int64)
deal ticket
externalID
string, nullable
deal ticket in external system (exchange, ECN, etc)
Read-only: the trade server does not let this value be changed. modification flags
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.
MT5ResultListApiResponse
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.
MT5OrderApiResponse
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.
MT5Position
Property
Type
Description
login
integer (int64), nullable
Gets the login of the client, to whom the trade position belongs
symbol
string, nullable
position symbol
action
PositionActions
PositionAction
digits
integer (int32), nullable
price digits
digitsCurrency
integer (int32), nullable
currency digits
contractSize
number (double), nullable
symbol contract size
position
integer (int64), nullable
position ticket
externalId
string, nullable
The ticket of a position in an external trading system
timeCreate
string (date-time), nullable
position create time
timeUpdate
string (date-time), nullable
position last update time
timeCreateMsc
string (date-time), nullable
position create time in msc since 1970.01.01 If the value of this field is specified, the TimeCreate value will be filled in automatically.
timeUpdateMsc
string (date-time), nullable
position last update time in msc since 1970.01.01 If the value of this field is specified, the TimeUpdate value will be filled in automatically.
priceOpen
number (double), nullable
position weighted average open price
priceCurrent
number (double), nullable
position current price
priceSL
number (double), nullable
position SL price
priceTP
number (double), nullable
position TP price
volume
integer (int64), nullable
position volume in units of 1/10,000 lot
volumeExt
integer (int64), nullable
position volume in units of 1/100,000,000 lot
profit
number (double), nullable
position floating profit
storage
number (double), nullable
position accumulated swaps
obsoleteValue
number (double), nullable
obsolete value kept by the platform for compatibility
rateProfit
number (double), nullable
profit conversion rate (from symbol profit currency to deposit currency)
rateMargin
number (double), nullable
margin conversion rate (from symbol margin currency to deposit currency)
expertId
integer (int64), nullable
expert id (filled by expert advisor)
expertPositionId
integer (int64), nullable
expert position id
comment
string, nullable
dealer
integer (int64), nullable
The login of a dealer, who has processed the order that opened the position. 0 means that the order was processed automatically by the server
volume on gateway with extended accuracy (1/100000000 lot)
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.
MT5Order
Property
Type
Description
order
integer (int64), nullable
order ticket
externalID
string, nullable
order ticket in external system (exchange, ECN, etc)
login
integer (int64), nullable
client login
dealer
integer (int64), nullable
processed dealer login (0-means auto)
partyID
integer (int64), nullable
counterparty identification
symbol
string, nullable
order symbol
digits
integer (int32), nullable
price digits
digitsCurrency
integer (int32), nullable
currency digits
contractSize
number (double), nullable
contract size
state
OrderState
OrderState
reason
OrderReason
OrderReason
timeSetup
string (date-time), nullable
order setup time
timeExpiration
string (date-time), nullable
order expiration
timeDone
string (date-time), nullable
order filling/cancel time
type
OrderType
OrderType
typeFill
OrderFilling
OrderFilling
typeTime
OrderTime
OrderTime
priceOrder
number (double), nullable
order price
priceTrigger
number (double), nullable
order trigger price (stop-limit price)
priceCurrent
number (double), nullable
order current price
priceSL
number (double), nullable
order SL
priceTP
number (double), nullable
order TP
volumeInitial
integer (int64), nullable
order initial volume in units of 1/10,000 lot
volumeCurrent
integer (int64), nullable
order current volume in units of 1/10,000 lot
expertID
integer (int64), nullable
expert id (filled by expert advisor)
positionID
integer (int64), nullable
position id
comment
string, nullable
order comment
activationMode
integer (int32), nullable
order activation state, time and price
activationTime
string (date-time), nullable
activationPrice
number (double), nullable
Gets the price, at which the order was activated
activationFlags
TradeActivationFlags
timeSetupMsc
string (date-time), nullable
Gets and sets the order placing time in milliseconds, since 1970.01.01 If the value of this field is specified, the TimeSetup value will be filled in automatically.
timeDoneMsc
string (date-time), nullable
Gets and sets the order execution time in milliseconds, since 1970.01.01 If the value of this field is specified, the TimeDone value will be filled in automatically.
rateMargin
number (double), nullable
margin conversion rate (from symbol margin currency to deposit currency)
also used for Deal,Order,Position Flags: names of the set bits joined by ", " ("Admin, Manager"), "None" when none is set; a set bit without a name is "Bit<n>" (bit number). Bits: Admin = 0x1, Manager = 0x2, Position = 0x4, Restore = 0x8, ApiAdmin = 0x10, ApiManager = 0x20, ApiServer = 0x40, ApiGateway = 0x80. Accepted on input, never written: All = Admin, Manager, Position, Restore, ApiAdmin, ApiManager, ApiServer, ApiGateway.