Change an alert hook's name, accounts or defaults
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 PATCH "https://api.fxapis.com/v1/alert-hooks/ACCOUNT_ID" \
-H "Authorization: Bearer YOUR_API_KEY"The URL does not change, so nothing needs editing in TradingView. defaults fields you send replace those fields; the rest stay as they are. symbolMap, when sent, replaces the whole map.
Authorization
apiKey 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
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
1 <= propertiesResponse Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://api.fxapis.com/v1/alert-hooks/497f6eca-6276-4993-bfeb-53cbbbba6f08" \ -H "Content-Type: application/json" \ -d '{}'{ "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "accountIds": [ "b75e4440-1cc9-49a6-8c9e-087e1aa69722" ], "defaults": { "volume": "0.10", "deviationPoints": 20, "symbolMap": { "XAUUSD": "XAUUSD.a", "US30": "DJ30" }, "symbolSuffix": ".a", "stripExchangePrefix": true, "allowClose": true, "onlyTradingViewIps": true }, "enabled": true, "urlHint": "https://api.fxapis.com/hooks/tradingview/…Qx4w", "lastUsedAt": null, "createdAt": "2019-08-24T14:15:22Z" }}Alerts a hook received, and what became of each GET
Newest first, kept for 30 days. The first place to look when an alert did not trade: every alert that reached a hook is here — refused, ignored and duplicate ones included — with the reason in words. A hook takes at most 30 alerts a minute; past that, one row records the refusal and the rest of that minute's alerts are not recorded.
Create a TradingView alert hook POST
Returns a secret `url` to paste into a TradingView alert's **Webhook URL**. Every alert sent to it becomes an order on the hook's accounts: one account places an ordinary order, several place a multi-account order. **The URL is returned once**, here, and is a credential: anyone who has it can trade these accounts. We store only a hash of it. Lost or leaked, rotate it. `defaults` fill in what an alert leaves out and translate TradingView's symbols to your broker's. See the TradingView guide for the message format. Several accounts need a plan with multi-account orders; that is checked here, and again on every alert.