What you’ll see
- Health: in Details, Sonarr’s version, or its worst health check in its own words ("No indexers available with RSS sync enabled…") and how many others there are. An error turns the health card red and a warning turns it orange, and either sends a notification. A notice, such as an update being ready, doesn’t. It also turns red once Sonarr stops answering.
- Queue: each download with its show’s poster, the episode, a bar with "3.1 of 4.2 GB", the download client and when it should finish. A download that needs you comes first and says so ("Import blocked", "Failed"); a paused or queued one says Paused or Queued. The card draws up to 20. Any past those, and any whose size isn’t known yet, are counted underneath ("3 more in Sonarr"). Point at a row for Remove, which asks first: it takes the download off the client and blocks that release, so Sonarr looks for another.
- Upcoming: the next 7 days of episodes, grouped by day, with each episode’s number and title.
- Recently missing: the four most recently aired episodes Sonarr hasn’t found. Point at a row for Search, which asks Sonarr to search for that episode now.
- Library: how many episodes are missing, how many are on disk out of those aired, how many series you have, and the free space on your root folder.
Status
- Shows Sonarr’s own health checks.
- Red for an error, orange for a warning.
- A notice never counts as a problem.
- Red once Sonarr stops answering.
- Notifies you when it turns orange or red.
How it connects
The page reads Sonarr’s v3 API with your API key, sent as X-Api-Key.
Requests it makes on its own 8
- GET
/api/v3/system/statusSonarr’s version and instance name.
Every 5 minutes
- GET
/api/v3/healthSonarr’s own health checks.
Every 5 minutes
- GET
/api/v3/queue?page=1 &pageSize=20 &includeSeries=true &includeEpisode=true What’s downloading, how far along it is, and what needs you.
Once a minute
- GET
/api/v3/calendar?start={date.today} &end={date.days_ahead_7} &includeSeries=true Episodes airing in the next 7 days.
Every 15 minutes
- GET
/api/v3/wanted/missing?page=1 &pageSize=4 &sortKey=episodes.airDateUtc &sortDirection=descending &includeSeries=true The most recently aired missing episodes, and how many are missing.
Every 15 minutes
- GET
/api/v3/seriesHow many series, and their episode counts.
Every 15 minutes
- GET
/api/v3/rootfolderYour root folder and its free space.
Every 15 minutes
- GET
/api/v3/mediacover/{seriesId}/poster-250.jpgEach show’s poster, kept on this Mac.
While the panel shows the row
Requests it makes when you act 2
- DELETE
/api/v3/queue/{id}?removeFromClient=true &blocklist=true Removes the download from the client and blocks that release.
When you press Remove and confirm
- POST
/api/v3/commandStarts an
EpisodeSearchfor that episode.When you press Search
That’s about 100 requests an hour with the page open, plus a poster the first time each one shows. Posters come only from your Sonarr, and Load icons from the web in Settings doesn’t affect them.
Sources and buttons explains each part of a page.
Set it up
- Find your API key. In Sonarr, open Settings → General. The key is under Security.
- Save it in Legato. In Settings → Secrets, save the key under
sonarr, bound to your Sonarr’s address. You can also link a 1Password reference. - Add the page. Paste the prompt into your agent, or download the page and run
/Applications/Legato.app/Contents/Helpers/legato set sonarr sonarr.json. - Point it at Sonarr. Change
http://sonarr.local:8989to your Sonarr’s address on every source. If Sonarr sits behind a reverse proxy at a path, such ashttps://media.example.com/sonarr, set the source’surltohttps://media.example.comand add"base": "/sonarr".
The cards fill within a minute. A mistyped key is the usual reason they don’t: the page then notes that Sonarr refused it.
Prompt for your agent
Add a Legato page for Sonarr, starting from https://legatobar.com/examples/sonarr.json.
Add the page as it is and change http://sonarr.local:8989 on every source to my Sonarr’s address. I’ll save my API key as sonarr in Settings → Secrets myself. Don’t press Remove or Search to test them.
Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.Download the page
Show the page’s JSON 727 lines
{
"$schema": "./.schemas/page.schema.json",
"title": "Sonarr",
"icon": "tv",
"sources": {
"health": {
"url": "http://sonarr.local:8989",
"secret": "sonarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "5m",
"requests": {
"status": "/api/v3/system/status",
"health": "/api/v3/health"
},
"derive": [
{
"name": "errors",
"value": {
"count": "health",
"where": {
"path": "type",
"equals": "error"
},
"default": 0
}
},
{
"name": "warnings",
"value": {
"count": "health",
"where": {
"path": "type",
"equals": "warning"
},
"default": 0
}
},
{
"name": "problems",
"value": {
"count": "health",
"where": {
"path": "type",
"in": [
"error",
"warning"
]
},
"default": 0
}
},
{
"name": "worst",
"value": {
"if": {
"path": "errors",
"gt": 0
},
"then": {
"first": "message",
"of": "health",
"where": {
"path": "type",
"equals": "error"
}
},
"else": {
"first": "message",
"of": "health",
"where": {
"path": "type",
"equals": "warning"
}
}
}
},
{
"name": "problems_more",
"value": {
"subtract": [
"problems",
1
]
}
}
]
},
"queue": {
"url": "http://sonarr.local:8989",
"secret": "sonarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "1m",
"requests": {
"queue": "/api/v3/queue?page=1&pageSize=20&includeSeries=true&includeEpisode=true"
},
"derive": [
{
"name": "queue_first",
"value": {
"each": "queue.records",
"fields": {
"id": "id",
"title": {
"if": {
"path": "series.title",
"exists": true
},
"then": {
"template": "{series.title}"
},
"else": {
"template": "{title|clip:60}"
}
},
"subtitle": {
"if": {
"path": "episode",
"exists": true
},
"then": {
"template": "S{episode.seasonNumber|pad:2}E{episode.episodeNumber|pad:2} · {episode.title|clip:50}"
},
"else": {
"template": ""
}
},
"client": {
"if": {
"path": "downloadClient",
"exists": true
},
"then": {
"template": "{downloadClient}"
},
"else": {
"template": "{protocol|title}"
}
},
"done": {
"subtract": [
"size",
"sizeleft"
],
"scale": 1e-09,
"round": 1
},
"total": {
"path": "size",
"scale": 1e-09,
"round": 1
},
"state": {
"if": {
"path": "trackedDownloadState",
"equals": "importBlocked"
},
"then": {
"template": "Import blocked"
},
"else": {
"if": {
"path": "trackedDownloadState",
"equals": "importPending"
},
"then": {
"template": "Waiting to import"
},
"else": {
"if": {
"path": "trackedDownloadStatus",
"equals": "error"
},
"then": {
"template": "Failed"
},
"else": {
"path": "status",
"values": {
"paused": "Paused",
"queued": "Queued",
"delay": "Delayed",
"warning": "Needs attention"
},
"default": ""
}
}
}
},
"eta": {
"if": {
"path": "estimatedCompletionTime",
"exists": true
},
"then": {
"template": " · {estimatedCompletionTime|in}"
},
"else": {
"template": ""
}
},
"image": {
"template": "/api/v3/mediacover/{seriesId|raw}/poster-250.jpg"
}
},
"where": {
"all": [
{
"path": "size",
"gt": 0
},
{
"path": "trackedDownloadStatus",
"in": [
"warning",
"error"
]
}
]
}
}
},
{
"name": "queue_rest",
"value": {
"each": "queue.records",
"fields": {
"id": "id",
"title": {
"if": {
"path": "series.title",
"exists": true
},
"then": {
"template": "{series.title}"
},
"else": {
"template": "{title|clip:60}"
}
},
"subtitle": {
"if": {
"path": "episode",
"exists": true
},
"then": {
"template": "S{episode.seasonNumber|pad:2}E{episode.episodeNumber|pad:2} · {episode.title|clip:50}"
},
"else": {
"template": ""
}
},
"client": {
"if": {
"path": "downloadClient",
"exists": true
},
"then": {
"template": "{downloadClient}"
},
"else": {
"template": "{protocol|title}"
}
},
"done": {
"subtract": [
"size",
"sizeleft"
],
"scale": 1e-09,
"round": 1
},
"total": {
"path": "size",
"scale": 1e-09,
"round": 1
},
"state": {
"if": {
"path": "trackedDownloadState",
"equals": "importBlocked"
},
"then": {
"template": "Import blocked"
},
"else": {
"if": {
"path": "trackedDownloadState",
"equals": "importPending"
},
"then": {
"template": "Waiting to import"
},
"else": {
"if": {
"path": "trackedDownloadStatus",
"equals": "error"
},
"then": {
"template": "Failed"
},
"else": {
"path": "status",
"values": {
"paused": "Paused",
"queued": "Queued",
"delay": "Delayed",
"warning": "Needs attention"
},
"default": ""
}
}
}
},
"eta": {
"if": {
"path": "estimatedCompletionTime",
"exists": true
},
"then": {
"template": " · {estimatedCompletionTime|in}"
},
"else": {
"template": ""
}
},
"image": {
"template": "/api/v3/mediacover/{seriesId|raw}/poster-250.jpg"
}
},
"where": {
"all": [
{
"path": "size",
"gt": 0
},
{
"path": "trackedDownloadStatus",
"not": "warning"
},
{
"path": "trackedDownloadStatus",
"not": "error"
}
]
}
}
},
{
"name": "queue_rows",
"value": {
"each": [
"queue_first",
"queue_rest"
],
"fields": {
"id": "id",
"title": "title",
"subtitle": "subtitle",
"client": "client",
"done": "done",
"total": "total",
"state": "state",
"eta": "eta",
"image": "image"
}
}
},
{
"name": "drawn",
"value": {
"count": "queue_rows",
"default": 0
}
},
{
"name": "others",
"value": {
"subtract": [
{
"path": "queue.totalRecords",
"default": 0
},
"drawn"
],
"default": 0
}
},
{
"name": "sizeless",
"value": {
"count": "queue.records",
"where": {
"path": "size",
"lte": 0
},
"default": 0
}
},
{
"name": "empty_text",
"value": {
"if": {
"path": "sizeless",
"gt": 0
},
"then": {
"template": "{sizeless} with no size yet"
},
"else": {
"template": "Nothing in the queue"
}
}
}
]
},
"library": {
"url": "http://sonarr.local:8989",
"secret": "sonarr",
"auth": {
"type": "header",
"name": "X-Api-Key"
},
"every": "15m",
"requests": {
"calendar": "/api/v3/calendar?start={date.today}&end={date.days_ahead_7}&includeSeries=true",
"missing": "/api/v3/wanted/missing?page=1&pageSize=4&sortKey=episodes.airDateUtc&sortDirection=descending&includeSeries=true",
"series": "/api/v3/series",
"roots": "/api/v3/rootfolder"
},
"derive": [
{
"name": "free_gb",
"value": {
"first": "freeSpace",
"of": "roots",
"scale": 1e-09,
"round": 0
}
},
{
"name": "root_path",
"value": {
"first": "path",
"of": "roots"
}
},
{
"name": "missing_count",
"value": {
"count": "missing.records",
"default": 0
}
},
{
"name": "series_count",
"value": {
"count": "series",
"default": 0
}
},
{
"name": "files",
"value": {
"sum": "statistics.episodeFileCount",
"of": "series",
"default": 0
}
},
{
"name": "episodes",
"value": {
"sum": "statistics.episodeCount",
"of": "series",
"default": 0
}
}
]
}
},
"cards": [
{
"id": "health",
"type": "status",
"placement": "page_info",
"label": "Sonarr",
"state": "unknown",
"width": "full",
"source": {
"ref": "health",
"map": {
"label": {
"if": {
"path": "status.instanceName",
"exists": true
},
"then": {
"template": "{status.instanceName}"
},
"else": {
"template": "Sonarr"
}
},
"state": {
"if": {
"path": "errors",
"gt": 0
},
"then": {
"template": "critical"
},
"else": {
"if": {
"path": "warnings",
"gt": 0
},
"then": {
"template": "warning"
},
"else": {
"template": "ok"
}
}
},
"detail": {
"if": {
"path": "problems",
"equals": 0
},
"then": {
"template": "Sonarr {status.version} · No problems"
},
"else": {
"if": {
"path": "problems",
"equals": 1
},
"then": {
"template": "{worst|clip:110}"
},
"else": {
"template": "{worst|clip:90} · and {problems_more} more"
}
}
}
},
"failed": {
"state": "critical",
"detail": "The server isn't answering",
"after": 3
}
}
},
{
"id": "queue",
"type": "pacing",
"label": "Queue",
"unit": "GB",
"items": [],
"source": {
"ref": "queue",
"empty": {
"text": "{empty_text}",
"when": {
"path": "drawn",
"equals": 0
}
},
"map": {
"items": {
"each": "queue_rows",
"fields": {
"key": "id",
"label": "title",
"subtitle": "subtitle",
"state": "state",
"detail": {
"template": "{client}{eta}"
},
"value": "done",
"target": "total",
"image": "image",
"image_shape": {
"template": "poster"
}
}
},
"detail": {
"if": {
"path": "others",
"gt": 0
},
"then": {
"template": "{others} more in Sonarr"
}
}
}
},
"row_actions": [
{
"label": "Remove",
"icon": "xmark",
"method": "DELETE",
"path": "/api/v3/queue/{id}?removeFromClient=true&blocklist=true",
"confirm": {
"message": "Remove {title} from {client} and block this release? Sonarr will look for another.",
"button": "Remove"
}
}
]
},
{
"id": "upcoming",
"type": "agenda",
"label": "Upcoming",
"days": 7,
"max_events": 7,
"hide_empty_days": true,
"items": [],
"source": {
"ref": "library",
"map": {
"items": {
"each": "calendar",
"fields": {
"title": {
"template": "{series.title}"
},
"start": "airDateUtc",
"detail": {
"template": "S{seasonNumber|pad:2}E{episodeNumber|pad:2} · {title|clip:70}"
}
}
}
}
}
},
{
"id": "missing",
"type": "list",
"label": "Recently missing",
"max_items": 4,
"items": [],
"source": {
"ref": "library",
"empty": {
"text": "Nothing missing",
"when": {
"path": "missing_count",
"equals": 0
}
},
"map": {
"items": {
"each": "missing.records",
"fields": {
"key": "id",
"text": {
"template": "{series.title} · S{seasonNumber|pad:2}E{episodeNumber|pad:2}"
},
"detail": {
"template": "Aired {airDateUtc|ago}"
}
}
}
}
},
"row_actions": [
{
"label": "Search",
"icon": "magnifyingglass",
"method": "POST",
"path": "/api/v3/command",
"body": {
"name": "EpisodeSearch",
"episodeIds": [
"{id}"
]
}
}
]
},
{
"id": "library",
"type": "facts",
"label": "Library",
"items": [
{
"key": "Missing",
"value": "—"
},
{
"key": "Episodes on disk",
"value": "—"
},
{
"key": "Series",
"value": "—"
},
{
"key": "Free space",
"value": "—"
}
],
"source": {
"ref": "library",
"map": {
"items[0].value": {
"template": "{missing.totalRecords} episodes"
},
"items[1].value": {
"template": "{files} of {episodes}"
},
"items[2].value": "series_count",
"items[3].value": {
"template": "{free_gb} GB on {root_path}"
}
}
}
}
]
}Questions
Why is the page red when everything downloads fine?
Sonarr reports its own problems, and the page shows them as Sonarr rates them. A fresh install with no indexers or download client reports an error until you add them.
Why does Remove block the release?
So Sonarr doesn’t grab the same broken or wrong release again. It looks for another one straight away. To take a download off without blocking it, use Sonarr itself.
Why isn’t there a Search all?
Searching for every missing episode at once can send hundreds of searches to your indexers. Search on a row asks for one episode; Sonarr’s own Wanted page can search for all of them when you mean to.
Does it work with Radarr?
Yes: the Radarr page has the same layout for films.