Plex-Meta-Manager/docs/config/webhooks.md

193 lines
7.5 KiB
Markdown
Raw Normal View History

2022-03-08 08:06:22 +00:00
# Webhooks Attributes
Configuring Webhooks is optional but can allow you to receive notifications when certain events happen.
2022-05-16 02:42:41 +00:00
Discord and Slack Direct webhooks are supported just use the correct urls.
2022-03-08 08:06:22 +00:00
A `webhooks` mapping is in the root of the config file.
Below is a `webhooks` mapping example and the full set of attributes:
```yaml
webhooks:
2024-04-22 14:20:12 +00:00
error: https://www.myspecialdomain.com/kometa
2022-03-18 13:00:42 +00:00
version:
2022-03-08 08:06:22 +00:00
run_start:
run_end:
changes:
```
2023-12-13 21:44:44 +00:00
| Attribute | Global | Library | Collection |
|:----------------------------------------|:------------------------------------------:|:------------------------------------------:|:--------------------------------------------:|
| [`error`](#error-notifications) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } |
| [`version`](#version-notifications) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } |
| [`run_start`](#run-start-notifications) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } |
| [`run_end`](#run-end-notifications) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } |
| [`delete`](#delete-notifications) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } |
| [`changes`](#changes-notifications) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } |
2022-03-08 08:06:22 +00:00
* Each Attribute can be either a webhook url as a string or a comma-separated list of webhooks urls.
2024-01-26 17:16:10 +00:00
* To send notifications to [Notifiarr](notifiarr.md) just add `notifiarr` to a webhook instead of the webhook url.
* To send notifications to [Gotify](gotify.md) just add `gotify` to a webhook instead of the webhook url.
2022-03-08 08:06:22 +00:00
## Error Notifications
2023-12-31 16:45:00 +00:00
The Error notification will be sent whenever an error occurs. The payload that is sent is different Depending on which
level the error occurs.
2022-03-08 08:06:22 +00:00
### Global JSON Payload
```yaml
{
2022-12-28 20:32:13 +00:00
"event": "error", // Event
2022-03-08 08:06:22 +00:00
"error": str, // Error Message
"critical": bool // Critical Error
}
```
### Library JSON Payload
```yaml
{
2022-12-28 20:32:13 +00:00
"event": "error", // Event
2022-03-08 08:06:22 +00:00
"error": str, // Error Message
"critical": bool, // Critical Error
"server_name": str, // Server Name
"library_name": str // Library Name
}
```
### Collection JSON Payload
```yaml
{
2022-12-28 20:32:13 +00:00
"event": "error", // Event
2022-03-08 08:06:22 +00:00
"error": str, // Error Message
"critical": bool, // Critical Error
"server_name": str, // Server Name
"library_name": str, // Library Name
"collection": str // Collection Name
}
```
### Playlist JSON Payload
```yaml
{
2022-12-28 20:32:13 +00:00
"event": "error", // Event
2022-03-08 08:06:22 +00:00
"error": str, // Error Message
"critical": bool, // Critical Error
"server_name": str, // Server Name
"playlist": str // Playlist Name
}
```
2022-03-18 13:00:42 +00:00
## Version Notifications
The Version notification will be sent at the beginning of a run if there is a newer version available.
### JSON Payload
```yaml
{
2022-12-28 20:32:13 +00:00
"event": "version", // Event
2022-03-18 13:00:42 +00:00
"current": str, // Current Version
"latest": str, // Latest Version
2023-12-13 21:44:44 +00:00
"notes": str // Sends the latest release notes or new commits to develop since your version
2022-03-18 13:00:42 +00:00
}
```
2022-03-08 08:06:22 +00:00
## Run Start Notifications
The Run Start notification will be sent at the beginning of every run.
### JSON Payload
```yaml
{
2022-12-28 20:32:13 +00:00
"event": "run_start", // Event
2022-03-08 08:06:22 +00:00
"start_time": str, // Time Run is started Format "YY-mm-dd HH:MM:SS"
}
```
## Run End Notifications
The Run End notification will be sent at the end of every run with statistics.
### JSON Payload
```yaml
{
2022-12-28 20:32:13 +00:00
"event": "run_end", // Event
2022-03-08 08:06:22 +00:00
"start_time": str, // Time Run started Format "YY-mm-dd HH:MM:SS"
"end_time": str, // Time Run ended Format "YY-mm-dd HH:MM:SS"
"run_time": str, // Time Run took to complete Format "HH:MM"
"collections_created": int, // Number of Collections/Playlists Created
"collections_modified": int, // Number of Collections/Playlists Modified
"collections_deleted": int, // Number of Collections/Playlists Removed
"items_added": int, // Number of Items added across all Collections/Playlists
"items_removed": int, // Number of Items removed across all Collections/Playlists
"added_to_radarr": int, // Number of Items added to Radarr
2022-10-26 18:01:39 +00:00
"added_to_sonarr": int, // Number of Items added to Sonarr
"names": [ // List of Dictionaries
2022-03-08 08:06:22 +00:00
"name": str, // Name of collection or playlist in the run
"library": str // Library the collection is in or PLAYLIST
]
}
```
2022-12-28 18:58:12 +00:00
## Delete Notifications
The Delete Notification will be sent whenever a collection/playlist is deleted containing the following payload.
### JSON Payload
```yaml
{
2022-12-28 20:32:13 +00:00
"event": "delete", // Event
2022-12-28 18:58:12 +00:00
"message": str, // Status Message
"server_name": str, // Server Name
"library_name": str, // Library Name (Only if a Collection is deleted)
}
```
2022-03-08 08:06:22 +00:00
## Changes Notifications
2023-12-31 16:45:00 +00:00
The Changes Notification will be sent after each collection/playlist containing the following payload if the
collection/playlist has been created, has new items, or has had items removed.
2022-03-08 08:06:22 +00:00
### JSON Payload
```yaml
{
2022-12-28 20:32:13 +00:00
"event": "changes", // Event
2022-03-08 08:06:22 +00:00
"server_name": str, // Server Name
"library_name": str, // Library Name
"collection": str, // Collection Name only in payload for a collection
"playlist": str, // Playlist Name only in payload for a playlist
"created": bool, // Was the Collection/Playlist Created on this run
"poster": str, // Base64 Encoded Collection/Playlist Poster if no poster_url is found
2023-12-13 21:44:44 +00:00
"poster_url": str, // Collection/Playlist Poster URL if available
2022-03-08 08:06:22 +00:00
"background": str, // Base64 Encoded Collection/Playlist Background if no poster_url is found
2023-12-13 21:44:44 +00:00
"background_url": str, // Collection/Playlist Background URL if available
2022-10-26 18:01:39 +00:00
"additions": [ // List of Dictionaries
2022-03-08 08:06:22 +00:00
"title": str, // Title of addition
2022-10-26 18:01:39 +00:00
"tmdb_id": int, // TMDb ID of addition only appears if it's a Movie
2022-03-08 08:06:22 +00:00
"tvdb_id": int // TVDb ID of addition only appears if it's a Show
],
2022-10-26 18:01:39 +00:00
"removals": [ // List of Dictionaries
2022-03-08 08:06:22 +00:00
"title": str, // Title of removal
2022-10-26 18:01:39 +00:00
"tmdb_id": int, // TMDb ID of removal only appears if it's a Movie
2022-03-08 08:06:22 +00:00
"tvdb_id": int // TVDb ID of removal only appears if it's a Show
],
2022-10-26 18:01:39 +00:00
"radarr_adds": [ // List of Dictionaries
2022-03-08 08:06:22 +00:00
"title": str, // Title of the Radarr Add
"id": int // TMDb ID of the Radarr Add
],
2022-10-26 18:01:39 +00:00
"sonarr_adds": [ // List of Dictionaries
2022-03-08 08:06:22 +00:00
"title": str, // Title of the Sonarr Add
"id": int // TVDb ID of the Sonarr Add
]
}
```