Skip to content
Docs

Any tool (JSON)

Turn JSON from Grafana, Alertmanager, Datadog, Home Assistant or your own scripts into pushes, with templates and field mapping.

The generic webhook works with any tool that can send JSON to a URL: Grafana, Prometheus Alertmanager, Datadog, Zabbix, Home Assistant, Jenkins, or a script you wrote. You tell Opush which JSON fields hold the title, the message and the link, and every request becomes a push.

Set it up

  1. In the app or the web console, add a service integration and pick Any tool (JSON).
  2. Pick a Template that matches your tool: Generic JSON, Prometheus Alertmanager, Grafana or Datadog.
  3. Create it. Copy the Payload URL and the Token.
  4. In your tool, add a webhook (or HTTP notification) that sends JSON to the payload URL with POST.
  5. Add the header Authorization: Bearer YOUR_TOKEN. If the tool can't set headers, use URL with token instead. It's the payload URL with ?token=YOUR_TOKEN at the end.
  6. Send a test from the tool.

Opush accepts the token in any of these places:

Authorization: Bearer YOUR_TOKEN
X-Opush-Token: YOUR_TOKEN
https://opu.sh/v1/hooks/YOUR_HOOK_ID?token=YOUR_TOKEN

Try it with curl

With the Generic JSON template:

curl -X POST "https://opu.sh/v1/hooks/YOUR_HOOK_ID" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title":"Backup failed","message":"pg_dump exited 1","status":"firing","severity":"critical"}'

You get a time-sensitive push:

Webhook
🔴 Backup failed
pg_dump exited 1

The push title is the integration's name. If you didn't name it, it's the template's name ("Webhook", "Alertmanager", "Grafana" or "Datadog"). Opush doesn't translate these pushes. They show in the language your tool sends.

What goes into the push

Opush reads six fields from your JSON:

FieldUsed for
TitleThe main line of the push
MessageThe text under it
LinkOpened when you tap the push (only http and https links)
Statusfiring adds 🔴, resolved adds ✅
SeverityHigh severity makes the push time-sensitive
Event IDStops duplicates

If Opush finds neither a title nor a message, nothing is pushed. Opush still answers 200 with "ignored": true.

If the body isn't JSON, the whole body (up to 500 characters) becomes the message. So even plain text works:

curl -X POST "https://opu.sh/v1/hooks/YOUR_HOOK_ID?token=YOUR_TOKEN" -d "disk almost full"

Status

These values count as firing: firing, alerting, alert, triggered, trigger, problem, error, critical, down, failed, failure, open, active.

These count as resolved: resolved, ok, recovered, recovery, up, success, succeeded, closed, normal, inactive.

Case doesn't matter. Other values are kept but get no symbol.

Severity

These values make the push time-sensitive, unless the status is resolved: critical, crit, high, error, fatal, emergency, page, p1, p2, disaster, major.

Duplicates

If the same Event ID arrives twice, you get one push. Without an Event ID, Opush uses a hash of the body, so a tool that resends the exact same request won't push twice.

Field mapping

Each template is a set of rules, one per field. On the integration's page, under Fields, you can change any rule. Leave a field empty to use the template's rule.

  • {{path}} reads a value. Use dots for objects and [0] for list items: {{alerts[0].labels.severity}}. {{alerts.0.labels.severity}} works too.
  • {{a|b|c}} uses the first one that has a value.
  • Text outside the braces is kept as is: {{host}} is down.
  • If none of the {{…}} in a rule find a value, the field is left out.
  • Each field is cut to 500 characters.

For example, Home Assistant can send:

{ "entity": "Front door", "new_state": { "state": "open", "last_changed": "10:02" }, "priority": "high" }

With these rules:

FieldRule
Title{{entity}} is {{new_state.state}}
MessageChanged at {{new_state.last_changed}}
Severity{{priority}}

You get "Front door is open" with "Changed at 10:02", as a time-sensitive push.

Templates

Reads common field names:

FieldRule
Title{{title|subject|name|alertname|event}}
Message{{message|body|text|description|msg|summary}}
Link{{url|link|href}}
Status{{status|state}}
Severity{{level|severity|priority}}
Event ID{{id|event_id|uuid}}

Good for your own scripts and for tools whose JSON you can shape yourself.

Keep the token private

Anyone with the token can push to you through this integration. If it leaks, remove the integration and create a new one.