Black Friday30% off your first year on annual plansSee the offer
Docs
Accounts

What happened to an account

Last updated:

Request

Synthetic example for the production API. Replace YOUR_API_KEY and the ids. Do not send it against a live account until you mean to.

curl -X GET "https://api.fxapis.com/v1/accounts/ACCOUNT_ID/events" \
  -H "Authorization: Bearer YOUR_API_KEY"
GET
/v1/accounts/{id}/events

The account's history in words, newest first: added, logging in, refused by the broker, online, moved to another server, taken offline. The same record the console shows as the account's activity.

Authorization

apiKey
AuthorizationBearer <token>

Authorization: Bearer fx_live_<id>_<secret>.

A key is shown once, at creation. We cannot show it again or recover it for you. Keys carry a label (live or test) in the key itself, so each configuration is easy to tell apart. Both reach real brokers: test with a broker demo account.

Scopes are per key. A key without accounts:write can read accounts and nothing else.

In: header

Path Parameters

id*string
Formatuuid

Query Parameters

limit?integer
Range1 <= value <= 200
Default50

Response Body

application/json

application/json

application/json

curl -X GET "https://api.fxapis.com/v1/accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08/events"
{  "data": [    {      "id": "string",      "at": "2019-08-24T14:15:22Z",      "tone": "success",      "title": "The broker refused the login",      "detail": null,      "by": "key",      "action": "string"    }  ]}

Search broker servers GET

MT5 servers matching what someone typed — a broker's name (`vantage`), the start of a server name (`JustMarkets-De`), with or without dashes and spaces. Built for a typeahead in your connect form: call it as the person types (debounced, from 2 characters) and let them pick. Servers accounts on fxapis have logged in to come first (`proven: true`), then names starting with what was typed, then the kind asked for (`demo`/`live`), then the broker's main server. With fewer than five matches for 3+ characters, the broker search is asked once and its servers added, so a broker nobody here has used yet is found too — that call can take a second or two. **A server that is not listed can still be connected**: always let people use exactly what they typed. Without `q`, the servers used most here.

Bring an account online POST

Starts connecting the account and returns **202** immediately — the broker login is still in progress. Poll `pollUrl` until `state` is `ready`. Calling this for an account that is already online is harmless and returns `alreadyRunning: true`, so a client that is unsure can simply call it. Returns 409 when the account needs a human first (a wrong password, 2FA, a certificate, trading disabled at the broker). Retrying will not fix those, and repeated failed logins are how a broker locks an account. Returns 402 `QUOTA_EXCEEDED` when the workspace has no plan (a trial that ended): choose one in Billing. Returns 429 `RESTART_TOO_SOON` (with `retry-after`) when the account's terminal has already been started 3 times in the last 10 minutes, counting restarts and starts made for orders.