SWAGGER STYLE

MT4 Client Explorer

Test session management, account reads, and trade execution against the MT4 client surface.

Base URLhttps://api.metatraderapi.xyz/mt4/client
AuthBearer API key + x-session-id header

How To Test This API

Start by creating a bridge session, then attach the returned session id to subsequent reads or trade writes.

In production, you should validate symbols and lot sizes locally before submitting trade requests.

  1. Open the session bootstrap endpoint with your broker login and server data.
  2. Copy the returned session id into the x-session-id header for the next request.
  3. Test a read endpoint such as /account or /positions before placing any trade task.
  4. Open the websocket channel to confirm quote or order events are flowing.
HeaderValueNotes
AuthorizationBearer <api-key>Workspace API key.
x-session-idsess_mt4_demo_01Bridge session id.
x-request-idreq_demo_001Recommended for retry-safe task writes.

Sample Request

BASH
curl -X POST https://api.metatraderapi.xyz/mt4/client/orders \
  -H "Authorization: Bearer <api-key>" \
  -H "x-session-id: sess_mt4_demo_01" \
  -d '{
    "symbol": "EURUSD",
    "type": "BUY",
    "volume": 0.10
  }'

Sample Response

JSON
{
  "taskId": "ord_7x82b1",
  "status": "queued",
  "submittedAt": "2026-04-07T08:20:11Z"
}

Common Status Codes

CodeMeaningTypical Cause
200OKRead endpoints completed successfully.
202AcceptedTrade task was queued and will complete asynchronously.
401UnauthorizedAPI key or session id is invalid.
429Rate LimitedToo many requests from the current workspace or account.
502Bridge UnavailableThe MT4 bridge is disconnected from the broker.