API Reference

One base URL, bearer auth, JSON in and out. Everything the dashboard shows you comes through these same routes.

Authentication

Send your key as a bearer token. Every request needs one, and the key’s scope decides what it may do.

Authorization: Bearer vst_live_…

Scopes

  • read — prices, positions, history. Cannot place an order.
  • trade — everything read can do, plus orders. Cannot mint keys.
  • manage — accounts and keys. Cannot place a trade.

Routes

Reading

RouteScopeWhat it does
GET /v1/accountreadBalance, equity, margin, leverage.
GET /v1/positionsreadEverything currently open.
GET /v1/ordersreadPending orders.
GET /v1/symbolsreadWhat this account can trade, with its limits.
GET /v1/candlesreadHistorical bars for one symbol.
GET /v1/historyreadClosed deals over a time range.
GET /v1/sessionmanageThe terminal's own health and watchdog tallies.

Trading

RouteScopeWhat it does
POST /v1/orderstradePlace an order. Requires a client_order_id.
POST /v1/orders/checkreadValidate an order without sending it.
GET /v1/orders/{client_order_id}readLook up by your id, not a broker ticket.
PATCH /v1/positions/{ticket}tradeMove a stop or take-profit.
DELETE /v1/positions/{ticket}tradeClose a position, whole or partial.
DELETE /v1/orders/{ticket}tradeCancel a pending order.
POST /v1/positions/close-alltradeClose everything. Never rate limited.

Safety

RouteScopeWhat it does
POST /v1/killtradeEngage the kill switch. Never rate limited.
DELETE /v1/killmanageDisarm it. Deliberately manage-only.

Management

RouteScopeWhat it does
GET /v1/accountsmanageConnected MT5 accounts.
POST /v1/accountsmanageConnect one.
PATCH /v1/accounts/{id}manageRename, replace credentials, enable or disable.
DELETE /v1/accounts/{id}manageDisconnect. Positions stay at your broker.
GET /v1/keysmanageKey prefixes and scopes. Never the keys.
POST /v1/keysmanageMint a key. Shown once.
DELETE /v1/keys/{prefix}manageRevoke, immediately.
GET /v1/hostsmanageThe machines running your accounts.
GET /v1/activitymanageThe audit log. Supports ?format=csv.
POST /v1/session/restartmanageRebuild the terminal.

Idempotency

Every order carries a client_order_id you choose. Send the same one twice and you get the first result back rather than a second trade — including when the first attempt timed out and you never saw the answer. That is the whole point of it: after a 503, resending the identical request is the correct move, not a gamble.

Errors

Three classes, and the right response to each is different:

  • 4xx — the request is wrong or not allowed. Fix it; retrying unchanged will not help.
  • 200 with status: rejected — we reached your broker and they said no. Not an error in the transport sense; the reason says why.
  • 503 — we do not know what happened. Resend the identical request; the client_order_id makes that safe.
CodeHTTPMeaningWhat to do
missing_key401No API key was supplied.Fix the request. Retrying unchanged will not help.
invalid_key401This API key is not recognised.Fix the request. Retrying unchanged will not help.
revoked_key401This API key has been revoked.Fix the request. Retrying unchanged will not help.
scope_insufficient403This key does not have the scope for that.Fix the request. Retrying unchanged will not help.
account_not_permitted403This key is bound to a different account.Fix the request. Retrying unchanged will not help.
order_exceeds_max_lots403This order is larger than the key's ceiling.Fix the request. Retrying unchanged will not help.
position_limit_reached403This key has reached its open position limit.Fix the request. Retrying unchanged will not help.
kill_switch_engaged403The kill switch is engaged for this account.Fix the request. Retrying unchanged will not help.
instrument_not_permitted403This key may not trade that instrument.Fix the request. Retrying unchanged will not help.
two_factor_required403Enable two-factor authentication first.Fix the request. Retrying unchanged will not help.
subscription_past_due402Payment is past due. Closing positions still works.Fix the request. Retrying unchanged will not help.
client_order_id_required422client_order_id is required.Fix the request. Retrying unchanged will not help.
client_order_id_too_long422client_order_id must be 128 characters or fewer.Fix the request. Retrying unchanged will not help.
client_order_id_reused422That client_order_id was already used for a different request.Fix the request. Retrying unchanged will not help.
unknown_symbol422This account cannot trade that symbol.Fix the request. Retrying unchanged will not help.
unknown_timeframe422That timeframe is not one we serve.Fix the request. Retrying unchanged will not help.
invalid_side_or_type422side must be buy or sell; type must be market, limit, stop or stop_limit.Fix the request. Retrying unchanged will not help.
volume_below_minimum422That volume is below the symbol's minimum.Fix the request. Retrying unchanged will not help.
volume_above_maximum422That volume is above the symbol's maximum.Fix the request. Retrying unchanged will not help.
price_required422A pending order needs a price.Fix the request. Retrying unchanged will not help.
missing_parameter422A required parameter is missing.Fix the request. Retrying unchanged will not help.
invalid_json422The request body is not valid JSON.Fix the request. Retrying unchanged will not help.
not_found404No record of that.Fix the request. Retrying unchanged will not help.
busy429Too many requests. Retry after the interval given.Wait for retry_after_ms, then resend.
terminal_unavailable503The terminal is unreachable.Resend the identical request.
account_not_on_this_host503That account is not currently running.Resend the identical request.
host_unreachable503The host running this account is not connected.Resend the identical request.
order_outcome_unknown503No reply from the broker. The order may or may not exist.Resend the identical request.

Calls that reduce exposure — closing, cancelling, close-all, engaging the kill switch — are never rate limited and keep working while the kill switch is on or a payment is past due. If you build one safety assumption on this API, build it on that.