discarr/docs/integrations/sonarr.md
pyr0ball dc768a8dbb docs: add MkDocs site
14-page documentation site covering installation, quick start,
full config reference, Sonarr/Radarr/qBittorrent/Tdarr integrations,
ffmpeg/HandBrake transcoder setup, SSH transcode workers, disc format
reference, and troubleshooting.

Stack: mkdocs-material 9.x (MIT), pinned <10 to avoid 2.0 licence wall.
2026-05-27 09:45:29 -07:00

1.4 KiB

Sonarr Integration

Discarr notifies Sonarr when an encode completes so it can trigger an import scan automatically.

1. Add the notification hook

In Sonarr, go to Settings → Connect → Add Connection → Custom Script.

Field Value
Name Discarr
Path /opt/discarr/scripts/sonarr-notify.sh
On Import
On Episode File Delete

!!! note "Docker installs" If Sonarr runs in Docker, the script path must be accessible inside the Sonarr container. Mount the Discarr scripts directory as a volume, or copy the script into a shared config directory.

2. Configure the API key

In ~/.config/media-postprocessor/api-keys.conf:

SONARR_URL=http://your-sonarr-host:8989/sonarr
SONARR_API_KEY=your-sonarr-api-key

Find your API key in Sonarr under Settings → General → Security → API Key.

3. How it works

When Discarr finishes an encode, it calls the Sonarr API to trigger a rescan on the target path. Sonarr picks up the new file and handles the rename and library update.

Encode completes
      │
      ▼
sonarr-notify.sh
      │  POST /api/v3/command
      │  {"name": "RescanSeries", "seriesId": <id>}
      ▼
Sonarr imports file

4. Test the connection

In Sonarr, click Test on the connection you just added. You should see a success notification.

To test end-to-end, queue a small encode in Discarr and watch Activity → Queue in Sonarr for the import.