JSON or plain text

The TradingView webhook JSON payload

The payload is just the Message box of your TradingView alert. AlertSync reads both JSON and plain text, so you can send a tidy structured object or a hand-written line — whichever reads better in Telegram.

TradingView webhook JSON payload format — watch the walkthrough.

The payload of a TradingView webhook is whatever you type into the alert's Message box. AlertSync accepts two formats. A JSON object is rendered into clean labelled lines in Telegram — each top-level key becomes a bold label with its value beside it. Plain text is forwarded exactly as written, so a composed sentence reads the way you wrote it. You can use any TradingView placeholder, such as {{ticker}}, {{close}} or {{strategy.order.action}}, inside either format, and payloads up to 1 MB are accepted. You do not need to set any headers or content type — AlertSync detects JSON automatically.

Step by step

  1. 1

    Decide: structured or sentence

    Use JSON when you want several fields laid out clearly — ticker, action, price. Use plain text when a single human-readable line reads better, such as "BTCUSDT crossed 68,420 — buy". Both are valid; the choice is purely about how the message should look in Telegram.

  2. 2

    Write it in the alert's Message box

    Open the TradingView alert and type your payload into the Message field. For JSON, write a normal object with double-quoted keys. TradingView replaces placeholders like {{ticker}} and {{close}} with real values at fire time, so you can put them straight inside the JSON strings.

  3. 3

    Let AlertSync detect the format

    You do not set any content type. AlertSync tries to parse the body as JSON first; if it is valid JSON it is rendered as labelled lines, and if it is not, it is treated as plain text and forwarded verbatim. That means a malformed JSON object will simply arrive as the raw text you typed rather than failing.

  4. 4

    Check the result in Telegram

    Fire the alert, or send /test to the bot, and look at the message. Every top-level JSON key appears as a bold label; nested objects are shown as their value. Adjust the keys until the message reads the way you want — the alert log keeps the exact payload of every delivery so you can compare.

How JSON renders in Telegram

AlertSync formats a JSON object as one line per top-level key, with the key in bold and the value after it. So {"ticker":"BTCUSDT","action":"buy"} arrives as two lines — a bold "ticker:" then BTCUSDT, a bold "action:" then buy. This keeps a multi-field alert readable at a glance. Only the top level is expanded into labels; a nested object is shown as its stringified value, so keep the fields you want labelled at the top level.

When plain text is the better choice

If you publish signals to a group or channel, a composed sentence usually reads better than a field list. Plain text is forwarded exactly as written, so whatever template you compose in TradingView — including placeholders and emoji — is what your audience sees. There is no formatting applied and nothing stripped.

  • Plain text: forwarded verbatim, ideal for a curated signals message.
  • JSON: auto-labelled, ideal for a dense multi-field alert you read yourself.
  • Placeholders such as {{ticker}} and {{close}} work inside either one.

Limits and edge cases

The payload may be up to 1 MB, which is far more than any normal alert needs. An empty message still delivers — it just arrives with the webhook's name and no body. And because detection is automatic, you never have to worry about setting application/json yourself; AlertSync figures it out from the content.

New to TradingView webhooks?

The full walkthrough covers the whole flow end to end with screenshots of every screen — creating the webhook, linking Telegram with a six-digit code, and pasting the URL into a TradingView alert.

Read the setup guide →

Frequently asked questions

Does the TradingView alert message have to be JSON?

No. AlertSync accepts both JSON and plain text. JSON is rendered into labelled lines, and plain text is forwarded exactly as you wrote it. Use whichever reads better — there is no requirement to use JSON.

Can I use TradingView placeholders inside the JSON?

Yes. Placeholders like {{ticker}}, {{close}}, {{time}} and {{strategy.order.action}} work inside JSON string values just as they do in plain text. TradingView substitutes the real values when the alert fires, before it sends the payload.

Do I need to set a Content-Type header?

No. TradingView does not let you set headers anyway, and you do not need to. AlertSync tries to parse the incoming body as JSON regardless of the content type, and falls back to treating it as plain text if it is not valid JSON.

What happens if my JSON is malformed?

It does not error. If the body cannot be parsed as JSON, AlertSync forwards it as plain text — so a mistyped object simply arrives as the raw characters you typed. Checking the delivered message, or sending a /test, is the quickest way to spot a bracket out of place.

How large can a webhook payload be?

Up to 1 MB. That is far larger than any realistic TradingView alert, so in practice the size limit never gets in the way. Larger bodies are rejected before delivery.

How AlertSync compares

Set up your relay in 2 minutes

Start on the Free plan — no card required — and watch your next TradingView signal land in Telegram in real-time.