Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

n8n

There is no FiveSocket node for n8n. The standard HTTP Request node does everything, because the API is plain HTTPS with a bearer key. This page gives the node settings for two workflows: reading an account on a schedule, and placing an order from a webhook.

Store the API key once

In n8n, create a credential of type Header Auth:
FieldValue
NameAuthorization
ValueBearer mt5_live_...
Select it in every HTTP Request node under Authentication → Generic Credential Type → Header Auth. The key then stays out of the workflow itself.

Read the account on a schedule

Use a Schedule Trigger node followed by an HTTP Request node:
SettingValue
MethodGET
URLhttps://api.fivesocket.com/v1/accounts/acc_.../snapshot
AuthenticationThe Header Auth credential
snapshot returns the balance, open positions and recent trades in one response, so one node covers a monitoring workflow:
{ "accountId": "acc_...", "observedAt": "2026-11-28T10:00:05.412Z", "balance": { "balance": "10000.00", "equity": "10012.50", "currency": "USD" }, "positions": [ { "id": "19283746", "symbol": "EURUSD", "side": "buy", "volume": "0.10", "profit": "18.40" } ] }
In later nodes, read fields with expressions such as {{ $json.balance.equity }}.
A 202 response with the code account_warming means the session is logging in to your broker. Turn on Retry On Fail in the node's settings, with a wait of five seconds, so the node repeats the read.

Place an order from a webhook

Use three nodes: Webhook, If and HTTP Request.
  1. The Webhook node accepts a POST with a JSON body such as:
    { "token": "a-long-random-string", "id": "alert-1042", "symbol": "EURUSD", "side": "buy", "volume": "0.10" }
  2. The If node continues only when {{ $json.body.token }} equals your stored token.
  3. The HTTP Request node sends the order:
SettingValue
MethodPOST
URLhttps://api.fivesocket.com/v1/accounts/acc_.../execution/orders
AuthenticationThe Header Auth credential, from a key with trading:execute
Send HeadersIdempotency-Key: {{ $json.body.id }}
Send BodyJSON, using the body below
{ "clientOrderId": "{{ $json.body.id }}", "symbol": "{{ $json.body.symbol }}", "side": "{{ $json.body.side }}", "type": "market", "volume": "{{ $json.body.volume }}" }
The request n8n sends is the same as this curl command:
curl -X POST https://api.fivesocket.com/v1/accounts/acc_.../execution/orders \ -H "Authorization: Bearer $FIVESOCKET_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: alert-1042" \ -d '{"clientOrderId":"alert-1042","symbol":"EURUSD","side":"buy","type":"market","volume":"0.10"}'
Before the first order, turn trading on for the account with PUT /v1/accounts/{accountId}/execution and a symbol allowlist. TradingView alerts shows the request.

Rules that matter in a workflow

  • clientOrderId is 1 to 31 characters from letters, digits, ., _, : and -, and must be unique for the account.
  • A retry with the same Idempotency-Key and the same body does not send the order twice.
  • volume and prices are decimal strings such as "0.10".
  • A response with outcome: "commit_unknown" means the broker's reply was lost. Poll GET /v1/accounts/{accountId}/execution/commands/{commandId} and do not send a new order.
  • FiveSocket sends nothing to n8n. It has no webhooks or stream, so a workflow polls.
Test on a demo account first. An order sent to a live account is a real trade.

Next