{% extends "org-base.html" %} {% from "ui.html" import csrf_field, action, reveal_notice, when with context %} {% block section %}

{{ _("Notify other tools (Slack, n8n, CI…) with a signed HTTPS call on each event.") }}

{% if revealed %}{{ reveal_notice(revealed, _("Copy this secret now: it will not be shown again.")) }}{% endif %}
{% for hook in webhooks %}

{{ hook.url }}

{% if hook.last_status %}{{ hook.last_status }}{% endif %}

{{ hook.events|map("event_label")|join(", ") }}{% if hook.last_delivery_at %} · {{ _("last delivery") }} {{ when(hook.last_delivery_at) }}{% endif %}

{% if not hook.active %}

{{ _("Disabled after {count} consecutive failures: no events are sent to it any more. Re-enable it once the receiver is fixed.", count=hook.failures) }}

{% endif %}
{% if not hook.active %}{{ action("/o/" ~ org.slug ~ "/-/webhooks/" ~ hook.id ~ "/reactivate", _("Re-enable"), kind="primary") }}{% endif %} {{ action("/o/" ~ org.slug ~ "/-/webhooks/" ~ hook.id ~ "/test", _("Send a test")) }} {{ action("/o/" ~ org.slug ~ "/-/webhooks/" ~ hook.id ~ "/delete", _("Delete"), confirm=_("Delete this webhook? The tool receiving it will no longer be notified."), kind="danger") }}
{% else %}

{{ _("No webhook.") }}

{% endfor %}

{{ _("New webhook") }}

{{ csrf_field() }}
{{ _("Events") }}{% for event in webhook_events %}{% endfor %}
{{ _("Technical details") }}

{{ _("Each call is a signed JSON POST: header X-Synaptane-Signature = sha256=HMAC(secret, body). The secret is only shown at creation.") }}

{% endblock %}