pipsocketDOCS
API reference / Account data

Account

GET/v1/accounts/{account}

The account's login, status and connection, and the balance, equity and margin from its terminal's last report (once a second). Read from the engine, not the terminal, so it answers while the terminal is away.

Path

accountstringrequired

The account's id, acc_ and 26 characters, as the dashboard shows it.

Response

idstring

The account's id.

logininteger

The MT5 login.

serverstring

The broker's trade server.

statusstring

What the engine knows of the account's terminal: starting, connected, disconnected, unreachable (the broker's server can't be reached; it keeps trying), stopped, or a status someone has to act on: auth_failed (the broker refused the login), server_not_found, login_unknown or refused.

connectedboolean

Whether the terminal reports a connection to the trade server.

trade_allowedbooleanor null

Whether MT5 lets this terminal trade: the terminal, the account and automated trading all allow it. False for an investor (read-only) login.

companystringor null

The broker.

currencystringor null

The account's currency.

leverageintegeror null
margin_modestringor null

hedging, netting or exchange.

trade_modestringor null

demo, contest or real.

balancenumberor null
equitynumberor null
creditnumberor null
marginnumberor null
margin_freenumberor null
server_timeintegeror null

The trade server's time at the last report: broker server time, seconds since 1970.

kill_switchobject

Whether the account's kill switch is engaged.

Fields of kill_switch
engagedboolean
sinceintegeror null

When it was engaged: seconds since 1970 (UTC). Null when it is not engaged.

deviationintegeror null

The deviation, in points, its closing deals carry. Null when it is not engaged.

Errors

401invalid_api_key

The key is not a workspace's current key (a rolled key stops working within about a minute).

401missing_api_key

No API key: send it as Authorization: Bearer <key>.

404no_such_account

No such account, or one the key's workspace doesn't have: the two look the same.

503engine_busy

The account's engine host has too many calls in flight (256). Nothing was done; try again.

503engine_unavailable

The account's engine host is not connected to Pipsocket, or disconnected while the call waited. A trade it already had is still settled: look it up.

504engine_timeout

The account's engine did not answer within 30 seconds.