# Postman, TradingView and n8n Templates for the MT5 API

> Explore the fxapis MT5 API in Postman, send TradingView alerts straight to MT5, and automate trades with n8n — ready-made templates from fxapis-integrations.

Published 2026-10-08 by fxapis. Canonical: https://fxapis.com/blog/mt5-api-postman-tradingview-n8n

## In short

- fxapis-integrations holds a Postman collection for every API endpoint, ready-to-paste TradingView alert messages, and importable n8n workflows.
- The Postman collection adds a fresh Idempotency-Key to every POST and PATCH, so exploring by hand cannot double an order.
- A TradingView hook turns an alert into an MT5 order with no code: point the alert's webhook at the hook and paste a template as its message.
- Every template is meant for a broker demo account first: an alert hook places real orders on the accounts it points at.

Not everything that talks to MetaTrader 5 needs a program. [fxapis-integrations](https://github.com/FXapis/fxapis-integrations) collects the low-code ways in: **a Postman collection for exploring the API, ready-to-paste TradingView alert messages, and n8n workflows** for automations you would rather build on a canvas.

## Postman: try every endpoint by hand

`postman/fxapis.postman_collection.json` is a Postman collection covering every public endpoint — connecting accounts, bringing them online, market and pending orders, positions, history and multi-account orders — with a ready-to-send example body on every request that takes one. It is generated from the live [API spec](https://api.fxapis.com/openapi.json), one folder per section of the API.

1. In Postman, choose **Import** and select the file.
2. Open the collection's **Variables** and set `apiKey` to your key. Fill in `accountId` and the other ids as you go.
3. Send **Connect an MT5 account** with a demo login, then **Bring an account online**, then poll its status.

The collection's pre-request script gives every POST and PATCH a fresh `Idempotency-Key`, so clicking Send twice on an order cannot open two positions. If the API changes, `node postman/generate.mjs` regenerates the collection from the live spec.

## TradingView: alerts straight to MT5

A TradingView hook is a URL that turns each alert into an MT5 order — no bridge, no Expert Advisor, no VPS. Create one in the [console](https://fxapis.com/dashboard) under **TradingView**, choose the accounts and the default volume, and use the URL as the alert's **Webhook URL**. Then paste a message from the `tradingview/` folder:

```json
{ "action": "buy", "symbol": "{{ticker}}", "volume": "0.20", "sl": "2310.5", "tp": "2385", "id": "{{ticker}}-{{timenow}}" }
```

There are templates for **indicators** (one alert per direction: buy, sell, close, close everything), for **strategies** (one alert that handles entries, exits and reversals from `{{strategy.market_position}}`), and in **plain text** for when JSON is more than you need. The `id` makes a repeated alert harmless: the same id within a minute is recognised as a duplicate, not a second order.

Two cautions from the templates' notes. A hook places real orders on whatever accounts it points at, so fire your first test alert at a **demo** account. And TradingView sizes strategies in units, not lots — so the strategy template sends no volume and uses the hook's default, and anything above 1,000 lots is refused as a units mistake. The [TradingView guide](https://docs.fxapis.com/guides/tradingview) has the full field reference.

## n8n: automations on a canvas

fxapis has no official n8n node yet, so the two templates in `n8n/` use n8n's built-in **HTTP Request** node:

- **TradingView webhook to market order** — receives an alert-shaped body, places a market order, and responds with the result.
- **Scheduled flat-all** — every weekday at 21:00 UTC, lists an account's positions and closes each one.

Import either file from **Workflows → Import from File**. The API key is read from an environment variable (`$env.FXAPIS_API_KEY`), so it never lives inside the workflow JSON; the n8n notes cover instances where environment access is switched off.

## The rules every template follows

- **An idempotency key on every order** — the Postman script and the n8n templates send `Idempotency-Key`; the TradingView templates send `id`.
- **Volumes and prices are strings**, and stops and targets are absolute prices, not pips.
- **The hook URL and the API key are credentials.** Keep them out of anything you commit, screenshot or share.
- **Demo accounts first.** `fx_test_` is a label, not a sandbox.

## Where to go next

- [TradingView alerts to MT5](https://fxapis.com/tradingview) on the website, and the [TradingView guide](https://docs.fxapis.com/guides/tradingview) in the docs.
- The [API reference](https://docs.fxapis.com/api-reference) — the same requests as the Postman collection, with samples in 13 languages.
- [Runnable examples](https://fxapis.com/blog/mt5-api-examples-python-node-curl) when you are ready to write code.

## Questions

### Do I need to write code to trade TradingView alerts on MT5?

No. Create a TradingView hook in the fxapis console, use its URL as the alert's webhook, and paste one of the message templates. fxapis turns each alert into an order on the hook's accounts.

### Is there an official n8n node for fxapis?

Not yet. The templates use n8n's built-in HTTP Request node to call the REST API directly, with the API key read from an environment variable.

### Does the Postman collection stay up to date?

It is generated from the live OpenAPI spec, and node postman/generate.mjs regenerates it whenever the API changes.
