ChartSetupLab

TradingView Webhook Alerts: Setup and Examples

By · Updated

On this page
  1. Requirements
  2. How to set up a webhook alert
  3. Message format: JSON or plain text
  4. Allowlisting TradingView's IP addresses
  5. Why a webhook fails
  6. Using webhooks for automated trading

Short answer: A TradingView webhook sends an HTTP POST request to a URL you choose every time an alert fires, with your alert message as the request body. You need a paid plan (webhooks start on Essential) and two-factor authentication turned on. TradingView only calls ports 80 and 443 and cancels the request if your server takes longer than three seconds to answer.

Webhooks are how traders connect TradingView alerts to bots, trade copiers, spreadsheets and chat apps. This guide covers the setup, message formats and the reasons a webhook fails.

Requirements

RequirementDetail
PlanEssential or higher (Basic has no webhook notifications)
SecurityTwo-factor authentication enabled on your TradingView account
Ports80 (HTTP) or 443 (HTTPS) only; other ports are rejected
Response timeYour server must answer within 3 seconds or the request is cancelled
IP versionIPv4 only; IPv6 is not supported for webhooks

Sources: TradingView webhook guide and pricing page, checked October 2026.

How to set up a webhook alert

  1. Turn on two-factor authentication in your TradingView account settings. Without it, the webhook option stays unavailable.
  2. Get the URL you want to call. This is the endpoint of your bot, automation service or chat app. It must start with http:// on port 80 or https:// on port 443.
  3. Create the alert as usual (Alt + A, or the Alert button) and set the condition, trigger and expiration. Our step-by-step alert guide explains each field.
  4. Write the message. Whatever you type in the Message field becomes the body of the POST request.
  5. Enable Webhook URL in the Notifications section and paste your URL.
  6. Create the alert, then send a test by setting a condition that will fire soon, or point the URL at a request-inspection service first to see exactly what arrives.

Message format: JSON or plain text

TradingView checks your message. If it is valid JSON, the request is sent with the content type application/json. Otherwise it is sent as text/plain. Check what your receiving app expects; many, including Slack, expect JSON.

A plain-text message:

BTCUSD Greater Than 9000

A JSON message for a bot, using TradingView placeholders that are filled in when the alert fires:

{
  "symbol": "{{ticker}}",
  "exchange": "{{exchange}}",
  "price": "{{close}}",
  "interval": "{{interval}}",
  "time": "{{timenow}}",
  "action": "buy"
}

Placeholders such as {{ticker}}, {{close}} and {{timenow}} are documented in TradingView's Pine Script alert guide. If one quote or comma is missing, the message is no longer valid JSON and arrives as plain text, which many bots reject. Validate the JSON before saving the alert.

Never put passwords or API keys in the message. TradingView's own guide warns against sending sensitive data in the webhook body. Use a receiving service that authenticates requests in another way.

Allowlisting TradingView's IP addresses

If your server only accepts known senders, TradingView lists these source addresses for webhook requests:

TradingView webhook IPs
52.89.214.238
34.212.75.30
54.218.53.128
52.32.178.7

TradingView can change these, so recheck the official guide if deliveries suddenly stop.

Why a webhook fails

SymptomLikely causeFix
No webhook option in the dialogBasic plan, or 2FA is offUpgrade to Essential or higher and enable 2FA
Alert fires but nothing arrivesWrong port, IPv6-only server, or firewall blocking TradingView's IPsUse port 80/443, IPv4, and allowlist the four IPs
Request cancelledServer took more than 3 seconds to respondReply immediately and process the order afterwards
Bot rejects the messageInvalid JSON sent as plain textValidate the JSON; check quotes and commas
Old values in the messageAlert created before the script or indicator changedDelete and recreate the alert

The alert log shows a Webhook status for each delivery. Check it before changing anything else. TradingView notes that webhooks can occasionally fail to reach the URL even when everything is set up correctly, so don't build a system that breaks if one message is missed.

Using webhooks for automated trading

A common setup is TradingView alert → webhook → a bridge service → your broker or exchange. Keep a few rules in mind:

  • Test with tiny size or a demo account first. A wrong field name can turn a sell into a buy.
  • Use Once per bar close for strategy signals unless you deliberately want intrabar entries. See why alerts fire mid-bar.
  • Log every request on the receiving side so you can match it with TradingView's alert log.
  • Plan for missed messages. Have a manual check or a stop-loss at the broker, not only in TradingView.

Automation removes the delay of clicking, not the risk of the strategy.

FAQ

Are TradingView webhooks free?

No. Webhook notifications are not included in the free Basic plan; they start on Essential.

Why can't I see the webhook option?

Either your plan doesn't include webhooks or two-factor authentication is not enabled on your account.

Can I send a webhook to a custom port like 8080?

No. TradingView only sends webhooks to ports 80 and 443.

Does TradingView retry a failed webhook?

TradingView's guide says requests that take longer than three seconds are cancelled and that webhooks can occasionally fail. It does not promise retries, so design your receiver as if a message can be lost.

Keep learning

Last checked against TradingView's official pages: October 2026. Nothing here is financial advice.