SuperCharting
Sign in Get started Account Open charts

Learn / Alerts

Webhook alerts: send SuperCharting alerts to your own URL as JSON

Webhook alerts post your alert message to an https URL when it fires. Learn the request format, JSON messages, placeholders, retries and limits.

A webhook alert sends an HTTP POST request to a URL you choose every time the alert fires. In SuperCharting you paste the address into Notifications > Webhook URL in the Create alert dialog; the message you wrote, with its placeholders filled in, becomes the request body. This lets a spreadsheet script, a chat bot or your own trading journal react to alerts without anyone watching the screen.

What gets sent

When an alert with a webhook fires, the SuperCharting server sends one POST request to your URL with the header Content-Type: application/json. The body depends on how your message starts:

{"symbol": "NSE:RELIANCE", "message": "RELIANCE Crossing Up 2950.00", "time": 1793436125.4}

symbol is the full symbol with its exchange, message is your alert text, and time is the moment it fired in Unix seconds.

The webhook is sent whether or not a browser is open, because alerts run on the server, not in your tab.

Placeholders you can use

Placeholders are written in double curly brackets and replaced when the alert fires. Names the alert does not know are left exactly as typed, so a typo shows up in the received text instead of disappearing.

PlaceholderValueAvailable in
{{ticker}}symbol without the exchange, e.g. RELIANCEevery alert
{{exchange}}exchange prefix, e.g. NSEevery alert
{{interval}}the chart timeframe of the alert, e.g. 15 or Devery alert
{{timenow}}firing time, UTC, ISO formatevery alert
{{close}}last pricesingle price alerts, strategy alerts
{{open}} {{high}} {{low}} {{volume}} {{time}}values of the barstrategy alerts
{{strategy.order.action}}buy or sellstrategy alerts
{{strategy.order.contracts}} {{strategy.order.price}}fill size and pricestrategy alerts
{{strategy.order.id}} {{strategy.order.comment}} {{strategy.order.alert_message}}from the order in your scriptstrategy alerts
{{strategy.position_size}} {{strategy.market_position}} {{strategy.prev_market_position}}position after and before the fillstrategy alerts

A strategy alert is created from the Strategy Tester or by choosing a strategy as the condition source. It sends one notification per new order fill and its default message is {{strategy.order.action}} @ {{strategy.order.contracts}} filled on {{ticker}}. The new strategy position is {{strategy.position_size}}. Fills on historical bars never notify; only fills that happen after the alert is created do.

How to add a webhook to an alert in SuperCharting

  1. Open the chart, for example XAUUSD on the 1-hour timeframe, and press Alert (or Alt + A).
  2. Set the condition, say Price, Crossing, 4,150.
  3. Click the Message row. Give the alert a name and type the body your receiver expects, for example:
{"pair": "{{ticker}}", "price": "{{close}}", "tf": "{{interval}}", "at": "{{timenow}}", "note": "gold at 4150"}
  1. Click the Notifications row and paste your address into Webhook URL. It must start with https://.
  2. Press Ok, then Create. If the address is refused you see the reason straight away and the alert is not created.

The Message dialog of a strategy alert lists the strategy placeholders under the text box, so you do not have to remember them.

Rules for the webhook URL

To keep accounts from reaching private networks, SuperCharting accepts a webhook URL only when:

Other details of the request:

Delivery, retries and errors

Webhook requests go into a queue and are sent in the background. When your server answers with a 5xx error or 429 (too many requests), or the network fails, the request is retried with growing pauses. If a host keeps failing, sending to it is paused for a while and then tried again. A delivery that finally fails is written to the Log tab of the Alerts panel as "webhook ... failed" with the reason, so check there first when something does not arrive.

An alert that triggers more than 15 times in 3 minutes is stopped, which also stops its webhooks. Choose a trigger of Once per bar or Once only for anything that could fire repeatedly; see price alerts for how triggers work.

Practical tips

SuperCharting sends the message and nothing more. It does not place orders anywhere; what your receiver does with a message is up to you. Scripts and backtests are for study, and past results do not guarantee future results.

Frequently asked questions

Can I use an http address?

No. Only https URLs that resolve to public addresses are accepted.

Is the request body always JSON?

The Content-Type header is always JSON. If your message starts with { it is sent as you wrote it, so make sure it is valid. Otherwise your text is wrapped in the symbol, message and time fields.

Why is {{close}} not replaced in my indicator alert?

{{close}} is filled for single price alerts and strategy alerts. In indicator and multi-condition alerts use {{ticker}}, {{exchange}}, {{interval}} and {{timenow}}.

Where do I see failed webhooks?

In the Log tab of the Alerts panel, which keeps the last 200 events.

Can one alert send to several URLs?

No, each alert has one Webhook URL. Create a second alert, or forward the request from your own receiver.

Try it on a live chart

SuperCharting runs in your browser: charts, Pine-compatible scripts, the Strategy Tester, alerts and the screener, with Indian and global markets.

Create a free account More guides