Skip to main content

webhook

Webhooks​

Examples. Prefix: UN_WEBHOOK_, Header: [webhook.0]
  • Using the config file:
################
### Webhooks ###
################
# Sends a webhook when an extraction queues, starts, finishes, and/or is deleted.
# Created to integrate with notifiarr.com.
# Also works natively with Discord.com, Telegram.org, Slack.com, ntfy, Apprise, and Mattermost webhooks.
# Can possibly be used with other services by providing a custom template_path.
###### Don't forget to uncomment [webhook.0] and url at a minimum !!!!
[webhook.0]
## Notifiarr: https://notifiarr.com/api/v1/notification/unpackerr plus headers.X-Api-Key.
## A path API key in a pasted URL is moved to that header.
url = "https://notifiarr.com/api/v1/notification/unpackerr"
## Provide an optional name to hide the URL in logs.
## If a name is not provided then the URL is used.
name = ""
## Do not log success (less log spam).
silent = false
## List of event ids to send notification for, [0] for all.
## The default is [0] and this is an example:
events = [1, 4, 6]
## ===> Advanced Optional Webhook Configuration <===
## Discord, Slack, and Mattermost: bot/display name. Telegram: chat_id.
## Gotify, ntfy, and Apprise: optional title prefix. Unused by Notifiarr JSON.
nickname = "Unpackerr"
## Also passed into templates. Slack and Mattermost optional channel. Pushover user key.
channel = ""
## Passed into webhook templates. Pushover requires the application token. ntfy sends Authorization Bearer when set. Unused by Discord, Telegram, and Slack incoming webhooks.
token = ""
## Dialect tokens skip every instance of that API. Any other value matches an instance name. None by default. This is an example:
exclude = ["readarr", "lidarr"]
## Used when template is empty (automatic). A named template ignores this file.
template_path = ''
## Override automatic template detection. Values: notifiarr, discord, telegram, gotify, pushover, slack, ntfy, apprise, mattermost. Empty uses the URL or template_path.
template = ""
## Default on for Discord webhooks and Telegram sendMessage. Other templates ignore this. Set false to post a new message for every extract event.
update = true
## Set this to true to ignore the SSL certificate on the server.
ignore_ssl = false
## You can adjust how long to wait for a server response.
timeout = "10s"
## If your custom template uses another MIME type, set this.
content_type = "application/json"
## Nested [webhook.0.headers] table. Header names are letters, digits, underscore, or hyphen.
## Applied first; Content-Type and ntfy Authorization Bearer from token still win.
## Notifiarr client key: X-Api-Key. Env: UN_WEBHOOK_0_HEADERS_X-Api-Key=api_key_from_notifiarr_com
## [webhook.0.headers]
## X-Api-Key = "api_key_from_notifiarr_com"
  • Using environment variables:
## Webhooks
UN_WEBHOOK_0_URL=https://notifiarr.com/api/v1/notification/unpackerr
UN_WEBHOOK_0_NAME=
UN_WEBHOOK_0_SILENT=false
UN_WEBHOOK_0_EVENTS_0=1
UN_WEBHOOK_0_EVENTS_1=4
UN_WEBHOOK_0_EVENTS_2=6
UN_WEBHOOK_0_NICKNAME=Unpackerr
UN_WEBHOOK_0_CHANNEL=
UN_WEBHOOK_0_TOKEN=
UN_WEBHOOK_0_EXCLUDE_0=readarr
UN_WEBHOOK_0_EXCLUDE_1=lidarr
UN_WEBHOOK_0_TEMPLATE_PATH=
UN_WEBHOOK_0_TEMPLATE=
UN_WEBHOOK_0_UPDATE=true
UN_WEBHOOK_0_IGNORE_SSL=false
UN_WEBHOOK_0_TIMEOUT=10s
UN_WEBHOOK_0_CONTENT_TYPE=application/json

This application can send a POST webhook to a URL when an extraction begins, and again when it finishes. Configure 1 or more webhook URLs with the parameters below. Works great with notifiarr.com. You can use requestbin.com to test and see the payload.

Config NameVariable NameDefault / Note
urlUN_WEBHOOK_0_URLNo Default / URL to send POST webhook to.
nameUN_WEBHOOK_0_NAMENo Default / Provide an optional name to hide the URL in logs.
silentUN_WEBHOOK_0_SILENTfalse / Hide successful POSTs from logs.
eventsUN_WEBHOOK_0_EVENTS_0[0] / List of event ids to send notification for, 0 for all.
nicknameUN_WEBHOOK_0_NICKNAME"Unpackerr" / Discord/Slack/Mattermost username, Telegram chat_id, or ntfy/Gotify/Apprise title prefix.
channelUN_WEBHOOK_0_CHANNELNo Default / Slack/Mattermost channel override, or Pushover user key.
tokenUN_WEBHOOK_0_TOKENNo Default / Pushover app token, or optional ntfy Bearer token.
excludeUN_WEBHOOK_0_EXCLUDE_0[] / Apps or instance names to skip: sonarr, Sportarr, folder, etc.
template_pathUN_WEBHOOK_0_TEMPLATE_PATHNo Default / Custom Go template file; used when template is automatic.
templateUN_WEBHOOK_0_TEMPLATENo Default / Force a built-in template instead of the URL or template file.
updateUN_WEBHOOK_0_UPDATEtrue / Edit the previous Discord or Telegram message instead of posting a new one.
ignore_sslUN_WEBHOOK_0_IGNORE_SSLfalse / Ignore invalid SSL certificates.
timeoutUN_WEBHOOK_0_TIMEOUT"10s" / How long to wait for server response.
content_typeUN_WEBHOOK_0_CONTENT_TYPE"application/json" / Content-Type header sent to webhook.
headersUN_WEBHOOK_0_HEADERS_No Default / Extra HTTP headers sent with the webhook POST.

Notes for Webhooks​

  • Paste a Discord, Slack, Telegram, ntfy, Apprise, Mattermost, Gotify, Pushover, or Notifiarr URL; the template is detected unless you set template.
  • Discord and Telegram can edit the previous message (update, default on). Slack incoming webhooks cannot update; each event is a new message.
  • Telegram: nickname is the chat_id. Pushover: token is the app token, channel is the user key, nickname is an optional device.
  • Slack and Mattermost: nickname is the display name; channel is an optional override.
  • ntfy: optional token as Bearer. Gotify, ntfy, and Apprise: nickname is an optional title prefix.
  • Extra headers are sent when set; the UI shows them for a named template or a custom template_path. Content-Type and ntfy Bearer still win after those headers.
  • Notifiarr: use https://notifiarr.com/api/v1/notification/unpackerr plus headers.X-Api-Key. A path API key (.../unpackerr/<uuid>) is moved to that header on start, save, and test.
  • Empty or unknown URLs use the Notifiarr JSON payload. Set template_path for a custom Go template; a named template ignores that file.
  • Name is only used in logs, but it's also available as a template value as {{name}}.
  • Built-in templates: notifiarr, discord, telegram, slack, pushover, gotify, ntfy, apprise, mattermost.