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 Name | Variable Name | Default / Note |
|---|---|---|
| url | UN_WEBHOOK_0_URL | No Default / URL to send POST webhook to. |
| name | UN_WEBHOOK_0_NAME | No Default / Provide an optional name to hide the URL in logs. |
| silent | UN_WEBHOOK_0_SILENT | false / Hide successful POSTs from logs. |
| events | UN_WEBHOOK_0_EVENTS_0 | [0] / List of event ids to send notification for, 0 for all. |
| nickname | UN_WEBHOOK_0_NICKNAME | "Unpackerr" / Discord/Slack/Mattermost username, Telegram chat_id, or ntfy/Gotify/Apprise title prefix. |
| channel | UN_WEBHOOK_0_CHANNEL | No Default / Slack/Mattermost channel override, or Pushover user key. |
| token | UN_WEBHOOK_0_TOKEN | No Default / Pushover app token, or optional ntfy Bearer token. |
| exclude | UN_WEBHOOK_0_EXCLUDE_0 | [] / Apps or instance names to skip: sonarr, Sportarr, folder, etc. |
| template_path | UN_WEBHOOK_0_TEMPLATE_PATH | No Default / Custom Go template file; used when template is automatic. |
| template | UN_WEBHOOK_0_TEMPLATE | No Default / Force a built-in template instead of the URL or template file. |
| update | UN_WEBHOOK_0_UPDATE | true / Edit the previous Discord or Telegram message instead of posting a new one. |
| ignore_ssl | UN_WEBHOOK_0_IGNORE_SSL | false / Ignore invalid SSL certificates. |
| timeout | UN_WEBHOOK_0_TIMEOUT | "10s" / How long to wait for server response. |
| content_type | UN_WEBHOOK_0_CONTENT_TYPE | "application/json" / Content-Type header sent to webhook. |
| headers | UN_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:
nicknameis thechat_id. Pushover:tokenis the app token,channelis the user key,nicknameis an optional device. - Slack and Mattermost:
nicknameis the display name;channelis an optional override. - ntfy: optional
tokenas Bearer. Gotify, ntfy, and Apprise:nicknameis an optional title prefix. - Extra
headersare sent when set; the UI shows them for a namedtemplateor a customtemplate_path. Content-Type and ntfy Bearer still win after those headers. - Notifiarr: use
https://notifiarr.com/api/v1/notification/unpackerrplusheaders.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_pathfor a custom Go template; a namedtemplateignores that file. Nameis 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.