View as Markdown

API reference / Models

Models

AccountCreated

AccountCreated fields
FieldTypeDescription
id requiredstring
state requiredstring

AccountFeatures

AccountFeatures fields
FieldTypeDescription
copyFactoryApiCopyTradingEnable | null
riskManagementApiEnabledboolean | null
metastatsApiEnabledboolean | null
reliabilityIncreasedboolean | null
allocateDedicatedIp"ipv4" | "none" | null

AccountHealth

The terminal's own health, as last reported. unknown until a report exists.

AccountHealth fields
FieldTypeDescription
status requiredstring
connected requiredboolean | null
tradingEnabled requiredboolean | null
reasons requiredany[]
checkedAt requiredstring | null
error requiredstring | null

AccountInformation

Live account values, read from the terminal on every call.

AccountInformation fields
FieldTypeDescription
platform required"mt4" | "mt5"
brokerstring | null
currency requiredstringThe deposit currency.
serverstring | null
balance requirednumber
equity requirednumber
margin requirednumber
freeMargin requirednumber
leverage requiredinteger | number
marginLevelnumber | nullOnly while margin is in use.
tradeAllowed requiredboolean
investorModeboolean | nullOnly when known.
marginModestring | nullFor example ACCOUNT_MARGIN_MODE_RETAIL_HEDGING.
namestring | null
login requiredinteger | string
creditnumber | null
typestring | nullACCOUNT_TRADE_MODE_DEMO or ACCOUNT_TRADE_MODE_REAL.
currencyDigitsinteger | null
marginCallLevelnumber | null
stopOutLevelnumber | null
stopOutModestring | null

ApiBillingUpgradeBody

ApiBillingUpgradeBody fields
FieldTypeDescription
accounts requiredinteger
own_addressboolean

Book

The market depth (MT5 only).

Book fields
FieldTypeDescription
symbol requiredstring
time requiredstring
brokerTime requiredstring
book requiredBookEntry[]

BookEntry

BookEntry fields
FieldTypeDescription
type requiredstringBOOK_TYPE_BUY or BOOK_TYPE_SELL.
price requirednumber
volume requirednumber

Candle

One candle. time is the candle's open time.

Candle fields
FieldTypeDescription
symbol requiredstring
timeframe requiredstring
time requiredstring
brokerTime requiredstring
open requirednumber
high requirednumber
low requirednumber
close requirednumber
tickVolume requirednumber
spreadinteger | number | null
volumenumber | null

Capabilities

What this account supports.

Capabilities fields
FieldTypeDescription
platform required"mt4" | "mt5"
marginModestring | null
features requiredobjectFeature name to true, false or a short note such as per_symbol.
timeframes requiredstring[]
limits requiredobject
brokerTimeobject | null

CopyTradingEnable

CopyTradingEnable fields
FieldTypeDescription
copyFactoryRoles required"PROVIDER" | "SUBSCRIBER"[]
copyFactoryResourceSlotsinteger | null

CreateAccount

CreateAccount fields
FieldTypeDescription
platform"mt4" | "mt5"
server requiredstring
login requiredinteger
password requiredstring
nicknamestring
trade_ea_symbolstring
proxy_addressstring
proxy_typestring
proxy_authstring
proxy_local_portinteger

CreatePrivateServer

CreatePrivateServer fields
FieldTypeDescription
slots requiredinteger
region requiredstring
name requiredstring

CreateReadonlyKey

CreateReadonlyKey fields
FieldTypeDescription
name requiredstring
scope"all" | "selected"
account_idsstring[]

CreateWebhook

CreateWebhook fields
FieldTypeDescription
url requiredstring
secretstring | null

Credentials

Credentials fields
FieldTypeDescription
loginstring | integer | null
password requiredstring

Deal

A deal from history. Balance, credit and other non-trade deals are included.

Deal fields
FieldTypeDescription
id requiredstring
platform required"mt4" | "mt5"
type requiredstringFor example DEAL_TYPE_BUY or DEAL_TYPE_BALANCE.
entryTypestring | nullFor example DEAL_ENTRY_IN or DEAL_ENTRY_OUT.
time requiredstring
brokerTime requiredstring
symbolstring | null
magicinteger | null
volumenumber | null
pricenumber | null
profit requirednumber
commissionnumber | null
swapnumber | null
positionIdstring | null
orderIdstring | null
reasonstring | null
commentstring | null
clientIdstring | null

ErrorEnvelope

The error body every control-plane route answers with.

ErrorEnvelope fields
FieldTypeDescription
error requiredstringThe machine code (not_found). On the account API paths (/users/current/...), the error name (NotFoundError).
message requiredstringA short human-readable explanation.
codestring | nullThe Tickwire machine code, on every surface.
idinteger | nullAccount API paths only: the HTTP status.
detailsanyValidation failures as [{parameter, message}], or more context for the error.
requestIdstring | nullThe request id, to quote to support.
docUrlstring | nullThe error's page in the docs.

Health

The truthful health snapshot. The same body comes with 200 and 503.

Health fields
FieldTypeDescription
status required"healthy" | "degraded" | "stale" | "disconnected" | "down"
connected requiredboolean
read_onlyboolean | null
trading_enabledboolean | null
reasons requiredany[]
reason_codesstring[] | null
checked_atstring | null
broker_timestring | null
cachedboolean | null
evidence_age_snumber | null
fx_status requiredstring
healthStatus requiredHealthViewThe account's health in camelCase.

HealthView

The account's health in camelCase.

HealthView fields
FieldTypeDescription
connected requiredboolean
connectedToBrokerboolean | null
quoteStreamingHealthyboolean | null
synchronizedboolean | null
healthy requiredboolean
status requiredstring
reasonCodes requiredstring[]
messagestring | null

KeyBody

KeyBody fields
FieldTypeDescription
namestring

LinkedAccount

A linked trading account. The broker password is never returned.

LinkedAccount fields
FieldTypeDescription
id requiredstring
nickname requiredstring
platform required"mt4" | "mt5"
server requiredstring
login requiredinteger | null
status requiredstringconnecting, connected, disconnected, error or provisioning.
error requiredstringThe last error, or an empty string.
rest_url requiredstring | nullnull until the terminal is placed.
ws_urlstring | null
proxy_address requiredstring
proxy_type requiredstring
proxy_local_port requiredinteger
trade_ea_symbol requiredstring
ip_mode required"shared" | "dedicated"dedicated when the account is on a private server.
created_at requiredstring
sandboxboolean | nulltrue for a simulated sandbox account.

MoveAccounts

MoveAccounts fields
FieldTypeDescription
account_ids requiredstring[]

NewProfile

NewProfile fields
FieldTypeDescription
name requiredstring
version required4 | 5
brokerTimezone requiredstring
brokerDSTSwitchTimezone requiredstring
type"mtTerminal" | "managerApi"
managerLoginstring | null
managerPasswordstring | null
managerServerstring | null

NewToken

NewToken fields
FieldTypeDescription
namestring
kind"api" | "account"
applicationsstring[] | null
rolesstring[] | null
accountIdsstring[] | null
readOnlyboolean
ttlInHoursnumber | null
ipAllowliststring[] | null

NewTradingAccount

NewTradingAccount fields
FieldTypeDescription
name requiredstring
server requiredstring
loginstring | integer | null
passwordstring | null
platform"mt4" | "mt5" | null
provisioningProfileIdstring | null
magicinteger
manualTradesboolean
slippagenumber | null
quoteStreamingIntervalInSecondsnumber
tagsstring[]
metadataobject | null
reliability"regular" | "high"
resourceSlotsinteger
copyFactoryResourceSlotsinteger
regionstring | null
type"cloud" | "cloud-g1" | "cloud-g2"
symbolstring | null
baseCurrencystring | null
copyFactoryRoles"PROVIDER" | "SUBSCRIBER"[]
riskManagementApiEnabledboolean
metastatsApiEnabledboolean
allocateDedicatedIp"ipv4" | "none" | null
keywordsstring[]
serverAddressstring | null

Order

A pending order, or an order from history.

Order fields
FieldTypeDescription
id requiredstring
platform required"mt4" | "mt5"
type requiredstringFor example ORDER_TYPE_BUY_LIMIT.
state requiredstringFor example ORDER_STATE_PLACED or ORDER_STATE_FILLED.
symbol requiredstring
magic requiredinteger
time requiredstringSetup time, ISO-8601 UTC.
brokerTime requiredstring
openPricenumber | null
currentPricenumber | nullPending orders only.
volume requirednumber
currentVolume requirednumber
doneTimestring | nullHistory orders only.
doneBrokerTimestring | null
positionIdstring | null
stopLossnumber | null
takeProfitnumber | null
stopLimitPricenumber | null
fillingModestring | null
expirationTypestring | null
expirationTimestring | null
reasonstring | null
commentstring | null
clientIdstring | null

PatchAccount

PatchAccount fields
FieldTypeDescription
trade_ea_symbolstring | null

PatchEndpoint

PatchEndpoint fields
FieldTypeDescription
enabledEventsstring[] | null
urlstring | null
descriptionstring | null

PatchPrivateServer

PatchPrivateServer fields
FieldTypeDescription
slots requiredinteger

PatchReadonlyKey

PatchReadonlyKey fields
FieldTypeDescription
namestring | null
scope"all" | "selected" | null
account_idsstring[] | null

PatchToken

PatchToken fields
FieldTypeDescription
namestring | null
ipAllowliststring[] | null

PinBody

PinBody fields
FieldTypeDescription
apiVersion requiredstring

Position

An open position.

Position fields
FieldTypeDescription
id requiredstringThe position identifier. It stays the same across adds and partial closes on netting accounts.
platform required"mt4" | "mt5"
type requiredstringPOSITION_TYPE_BUY or POSITION_TYPE_SELL.
symbol requiredstring
magic requiredinteger
time requiredstringOpen time, ISO-8601 UTC.
brokerTime requiredstringOpen time on the broker's clock.
updateTimestring | null
openPrice requirednumber
currentPricenumber | null
currentTickValuenumber | null
volume requirednumberLots.
swap requirednumber
commission requirednumber
profit requirednumberUnrealized plus realized profit, swap and commission.
unrealizedProfit requirednumber
realizedProfit requirednumber
stopLossnumber | null
takeProfitnumber | null
reasonstring | null
commentstring | null
clientIdstring | null
brokerCommentstring | null

Price

The current bid and ask.

Price fields
FieldTypeDescription
symbol requiredstring
bid requirednumber
ask requirednumber
profitTickValuenumber | null
lossTickValuenumber | null
time requiredstring
brokerTime requiredstring

PrivateServer

A private server: a dedicated address for its own accounts.

PrivateServer fields
FieldTypeDescription
id requiredstring
name requiredstring
status requiredstringFor example provisioning, ready or expired.
region requiredstring
ip requiredstring | null
purchased_slots requiredinteger
used_slots requiredinteger
period_end requiredstring
accounts requiredLinkedAccount[]

PrivateServerAddAccount

PrivateServerAddAccount fields
FieldTypeDescription
platform"mt4" | "mt5"
server requiredstring
login requiredinteger
password requiredstring
nicknamestring
trade_ea_symbolstring

ReadonlyKey

A read-only key. key is the value, shown once on create and rotate. Every other answer has key: null.

ReadonlyKey fields
FieldTypeDescription
id requiredstring
name requiredstring
key requiredstring | null
key_preview requiredstring
scope required"all" | "selected"
accounts requiredstring[]
created_at requiredstring
last_used_at requiredstring | null
key_noticestring | nullPresent when key is shown, or when a replay no longer shows it.

Region

Region fields
FieldTypeDescription
code requiredstring
label requiredstring

Regions

Where private servers can run, and what they cost.

Regions fields
FieldTypeDescription
enabled requiredboolean
regions requiredRegion[]
max_slots requiredinteger
max_servers requiredinteger
first_slot_eur_cents requiredinteger
additional_slot_eur_cents requiredinteger

RotateSecret

RotateSecret fields
FieldTypeDescription
secretstring | null
overlapHoursnumber

SandboxSignupBody

SandboxSignupBody fields
FieldTypeDescription
platform"mt4" | "mt5"

SeatDetail

SeatDetail fields
FieldTypeDescription
id requiredstring
account_id requiredstring
paid_until requiredstring | null
status required"active" | "inactive" | "unknown"

Seats

Seats fields
FieldTypeDescription
total requiredinteger
used requiredinteger

ServerTime

The current time on both clocks, and the detected broker time zone.

ServerTime fields
FieldTypeDescription
time requiredstringNow, ISO-8601 UTC.
brokerTime requiredstringNow, on the broker's clock.
lastQuoteTimestring | null
lastQuoteBrokerTimestring | null
brokerUtcOffsetMinutes requiredinteger | nullnull while the offset is unknown. It is never guessed.
brokerTimezonestring | null
brokerDSTSwitchTimezonestring | null
dstRulestring | nullus, eu, none or unknown.
offsetSourcestring | null
confidencestring | null

Subscription

The plan and its real billing state. status is unknown and paid_access is null when billing cannot be read.

Subscription fields
FieldTypeDescription
plan requiredstring
status requiredstring
paid_access requiredboolean | null
billing_provider requiredstring
cancel_at_period_end requiredboolean
seats requiredSeats
seat_details requiredSeatDetail[]
current_period_end requiredstring | null
grace_ends_at requiredstring | null
wallet requiredSubscriptionWallet

SubscriptionWallet

SubscriptionWallet fields
FieldTypeDescription
balance_eur_cents requiredinteger
next_charge_eur_cents requiredinteger
next_charge_at requiredstring | null
covers_next_charge requiredboolean
note requiredstring

SymbolSpecification

The symbol's trading rules.

SymbolSpecification fields
FieldTypeDescription
symbol requiredstring
tickSizenumber | null
minVolume requirednumber
maxVolume requirednumber
volumeStep requirednumber
contractSizenumber | null
baseCurrencystring | null
profitCurrencystring | null
marginCurrencystring | null
digits requiredinteger
pointnumber | null
descriptionstring | null
fillingModesstring[] | null
tradeModestring | null
quoteSessionsobject | null
tradeSessionsobject | null
swapLongnumber | null
swapShortnumber | null
pipSizenumber | null
stopsLevelinteger | null
freezeLevelinteger | null

Tick

One tick.

Tick fields
FieldTypeDescription
symbol requiredstring
time requiredstring
brokerTime requiredstring
bidnumber | null
asknumber | null
lastnumber | null
volumenumber | null

TradeResult

The trade's result. It comes with HTTP 200 even when the broker rejects the trade.

TradeResult fields
FieldTypeDescription
numericCode requiredinteger0, 10008, 10009, 10010 and 10025 mean success.
stringCode requiredstring
message requiredstring
orderIdstring | null
positionIdstring | null
outcome required"applied" | "no_change" | "partial" | "rejected" | "unknown"unknown means the order may have executed. Check positions and orders before you retry.
isEffectiveboolean | null
retcodeinteger | nullThe terminal's own code.
replayed requiredbooleantrue when this is the stored result of an earlier request with the same key.
positionsobject[] | nullPOSITIONS_CLOSE_SYMBOL only.

TradingAccount

A trading account on the account API, with Tickwire extras.

TradingAccount fields
FieldTypeDescription
_id requiredstring
name requiredstring
login requiredstring | nullnull for a DRAFT account with no credentials yet.
server requiredstring
platform required"mt4" | "mt5"
version required4 | 5
type requiredstring
state requiredstringFor example CREATED, DEPLOYING, DEPLOYED or UNDEPLOYED.
connectionStatus requiredstringCONNECTED, DISCONNECTED or DISCONNECTED_FROM_BROKER.
magic requiredinteger
manualTrades requiredboolean
reliability requiredstring
region requiredstring
tags requiredstring[]
createdAt requiredstring
stateChangedAt requiredstring
ipMode required"shared" | "dedicated"
instances requiredintegerTerminals serving the account right now.
health requiredAccountHealthThe terminal's own health, as last reported. unknown until a report exists.

TradingAccountPage

The list with api-version: 2.

TradingAccountPage fields
FieldTypeDescription
count requiredinteger
items requiredTradingAccount[]

TriggerBody

TriggerBody fields
FieldTypeDescription
type requiredstring
accountIdstring | null

UpdateProfile

UpdateProfile fields
FieldTypeDescription
namestring | null
brokerTimezonestring | null
brokerDSTSwitchTimezonestring | null
managerLoginstring | null
managerPasswordstring | null
managerServerstring | null

UpdateTradingAccount

UpdateTradingAccount fields
FieldTypeDescription
namestring | null
passwordstring | null
serverstring | null
magicinteger | null
manualTradesboolean | null
slippagenumber | null
quoteStreamingIntervalInSecondsnumber | null
tagsstring[] | null
metadataobject | null
copyFactoryRoles"PROVIDER" | "SUBSCRIBER"[] | null
resourceSlotsinteger | null
copyFactoryResourceSlotsinteger | null
metastatsApiEnabledboolean | null
allocateDedicatedIp"ipv4" | "none" | null
serverAddressstring | null

Wallet

The prepaid balance, used for private servers.

Wallet fields
FieldTypeDescription
balance_eur_cents requiredinteger
currency requiredstring

Webhook

A webhook endpoint. secret signs every delivery.

Webhook fields
FieldTypeDescription
id requiredstring
url requiredstring
secret requiredstring
active requiredboolean
created_at requiredstring