Skip to content

v1.65.0 — Custom JSON body for generic webhooks

Choose a tag to compare

@jcrabapple jcrabapple released this 18 Sep 22:07
· 105 commits to master since this release

Generic webhook destinations can now send the payload shape the receiving service actually wants, instead of FeedEcho's flat object.

Custom JSON body template

When connecting a webhook on the Accounts page there is a new optional Custom JSON body field. Paste a JSON template and every delivered item arrives in exactly that shape. It uses the same sandboxed template variables as echo templates ({{ title }}, {{ link }}, {{ summary }}, {{ feed_name }}, conditionals, filters, and so on) and must render to a JSON object.

Embed text with the tojson filter and no surrounding quotes — {{ title | tojson }}, never "{{ title }}". Quoted interpolation breaks the JSON the first time an item contains a quote or newline, and it lets item text inject extra keys into the payload. Templates are checked at connect time against a sample item that contains exactly those characters, so the naive form is rejected immediately with a pointer to the fix.

The motivating case is push services. The shape brrr expects:

{"title": {{ title | tojson }}, "message": {{ (summary or title) | tojson }}, "open_url": {{ link | tojson }}, "thread_id": {{ feed_name | tojson }}}

Paste that, point the webhook at your brrr URL, and every new feed item is a push notification on your devices — no Zapier or n8n shim needed. The same mechanism covers any receiver with a fixed body schema.

Details:

  • Test button renders your template: the test delivery is built from the stored template, so a body that only breaks on real items surfaces on the Test button, not on the first echo.
  • Reconnect semantics (same convention as headers): leaving the field blank on a reconnect keeps the stored template; entering {} (whitespace ignored) removes it and returns to the default flat payload.
  • Failure semantics: a template that fails to render at delivery time is a permanent failure, like a rejected payload — a broken template never enters the retry pipeline.
  • Export/import: the template travels in export documents and is re-validated on import.
  • Database: adds a body_template column to webhook_accounts in both SQLite and Postgres. The migration runs automatically at startup; no configuration changes and no new environment variables are required.