CPlugin

MT4 v2 :: Server Admin (destructive)

API v2 (beta) · MT4 · 4 operations · base URL https://cloud.mywebapi.com · OpenAPI v2 (JSON) · Redoc

Every call needs Authorization: Bearer $TOKEN — an OAuth 2.0 client-credentials token from https://auth.cplugin.net/connect/token (scope webapi). $TRADE_PLATFORM_ID is the id of a trade platform registered in Toolbox.

Operations

Restart server

POST /api/v2/MT4/{tradePlatform}/SrvRestart

Soft-restart of the MT4 server process. Destructive — requires ?confirm=true.

Manager (live) call to the wrapper's SrvRestart(). The current manager connection is dropped during the restart cycle — clients should expect the next request to surface a fresh login. Audit lines are emitted on both sides of the wrapper call (independently of the HTTP response).

The ?confirm=true guard rejects calls without the literal query string. It is a deliberateness signal, NOT an authorization mechanism — admin rights are still enforced separately.

Timeout: 60 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id (GUID)
confirm query boolean no Required deliberateness flag — must equal true
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 60 s (server maintenance). 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/MT4/$TRADE_PLATFORM_ID/SrvRestart" \
  -H "Authorization: Bearer $TOKEN"

Force chart resync

POST /api/v2/MT4/{tradePlatform}/SrvChartsSync

Force chart-history resync across the plugin set. Destructive — requires ?confirm=true.

Manager (live) call to the wrapper's SrvChartsSync(). Forces the MT4 server to walk every plugin's chart-history feed and bring the local cache in sync. Idempotent — running twice is a no-op against an already-synced state.

Timeout: 60 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id (GUID)
confirm query boolean no Required deliberateness flag — must equal true
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 60 s (server maintenance). 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/MT4/$TRADE_PLATFORM_ID/SrvChartsSync" \
  -H "Authorization: Bearer $TOKEN"

Start LiveUpdate distributor

POST /api/v2/MT4/{tradePlatform}/SrvLiveUpdateStart

Kick the LiveUpdate distributor. Destructive — requires ?confirm=true.

Manager (live) call to the wrapper's SrvLiveUpdateStart(). Starts (or restarts) the server's outbound LiveUpdate broadcast. Affects connected client terminals — they may receive an update prompt.

Timeout: 60 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id (GUID)
confirm query boolean no Required deliberateness flag — must equal true
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 60 s (server maintenance). 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/MT4/$TRADE_PLATFORM_ID/SrvLiveUpdateStart" \
  -H "Authorization: Bearer $TOKEN"

Restart data feeders

POST /api/v2/MT4/{tradePlatform}/SrvFeedsRestart

Restart all running data feeders. Destructive — requires ?confirm=true.

Manager (live) call to the wrapper's SrvFeedsRestart(). Cycles all running quote/news feeders. May cause a brief gap in the tick stream — typically a second or two. Idempotent.

Timeout: 60 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.

Parameters

NameInTypeRequiredDescription
tradePlatform path string (uuid) yes Trade platform id (GUID)
confirm query boolean no Required deliberateness flag — must equal true
X-Request-Timeout header number (double) no How long to wait for the trade server, in seconds (1–300). Default for this operation: 60 s (server maintenance). 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/MT4/$TRADE_PLATFORM_ID/SrvFeedsRestart" \
  -H "Authorization: Bearer $TOKEN"

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.

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). HTTP status is always 200.

PropertyTypeDescription
data boolean
error ApiError v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
meta ApiMeta Response metadata. ActivityId is the W3C trace-id for correlation in Seq/SigNoz. Paging is present only on paginated list responses; otherwise it is omitted — the global JSON context policy serialises null fields, so we override that here with System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull.

ApiError

v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.

PropertyTypeDescription
code WebApiErrorCode Stable transport-level error code.
managerCode ResultCode Raw MT4/MT5 manager result code, when the error came from the trading platform; otherwise null.
message string, nullable Human-readable error description.

ApiMeta

Response metadata. ActivityId is the W3C trace-id for correlation in Seq/SigNoz. Paging is present only on paginated list responses; otherwise it is omitted — the global JSON context policy serialises null fields, so we override that here with System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull.

PropertyTypeDescription
activityId string, nullable W3C trace id for correlating this response in logs and tracing (Seq/SigNoz).
paging PagingMeta Pagination info; present only on list responses, omitted otherwise.