{
  "openapi": "3.1.0",
  "info": {
    "title": "DroppedNeedle v3",
    "description": "Native API contract. Generated clients must never be hand-edited.",
    "license": {
      "name": "AGPL-3.0-or-later",
      "identifier": "AGPL-3.0-or-later"
    },
    "version": "3.0.0"
  },
  "paths": {
    "/api/v3/acquire/lidarr-import/artists": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "Monitored Lidarr artists annotated for the caller.",
        "operationId": "list_lidarr_artists",
        "responses": {
          "200": {
            "description": "Import candidates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LidarrArtistListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/lidarr-import/config": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "Masked Lidarr connection settings.",
        "operationId": "get_lidarr_config",
        "responses": {
          "200": {
            "description": "Masked Lidarr settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LidarrConnectionSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "imports"
        ],
        "summary": "Save the Lidarr connection. A masked key preserves the stored one.",
        "operationId": "put_lidarr_config",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LidarrConnectionSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved Lidarr settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LidarrConnectionSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/lidarr-import/import": {
      "post": {
        "tags": [
          "imports"
        ],
        "summary": "Import selected Lidarr artists into the caller's follows.",
        "operationId": "import_lidarr",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LidarrImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Import summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LidarrImportResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/lidarr-import/test": {
      "post": {
        "tags": [
          "imports"
        ],
        "summary": "Test submitted Lidarr credentials against `system/status`: the\nsubmitted url/key are probed so Test works before the first\nsave, a masked key resolves to the stored one, and reachable/bad-key\nverdicts travel in the body, never as a leaked 5xx, never echoing the\nURL or host.",
        "operationId": "test_lidarr",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LidarrConnectionSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Lidarr probe verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LidarrTestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/nzbget/status": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "Live NZBGet status against the saved config (admin only).",
        "operationId": "get_nzbget_status",
        "responses": {
          "200": {
            "description": "NZBGet status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsenetStatusResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/sabnzbd/status": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "Live SABnzbd status against the saved config (admin only).",
        "operationId": "get_sabnzbd_status",
        "responses": {
          "200": {
            "description": "SABnzbd status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsenetStatusResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/slskd/status": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "Live slskd client status (any signed-in user may read it).",
        "operationId": "get_slskd_status",
        "responses": {
          "200": {
            "description": "slskd status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlskdStatusResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/spotify/auth/callback": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "Spotify OAuth callback. State-identified, so it sits outside the\nsession gate: every outcome redirects to the profile page with\n`spotify=connected` or `spotify=error` with an optional `reason`.",
        "operationId": "spotify_callback",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "description": "Authorization code from Spotify.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "Round-tripped state token.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "error",
            "in": "query",
            "description": "Provider-side error, when the user declined.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "307": {
            "description": "Redirect to the profile page"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/acquire/spotify/auth/url": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "Authorize URL for the caller's Spotify link flow. Requires the admin\napp to be enabled and complete.",
        "operationId": "get_spotify_auth_url",
        "responses": {
          "200": {
            "description": "Authorize URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotifyAuthUrlResponse"
                }
              }
            }
          },
          "400": {
            "description": "Spotify is not set up, or no Redirect Origin is set and the request names no address to build one from",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/spotify/playlists": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "The caller's owned Spotify playlists. Unlinked reads as a 400,\nupstream failures as a 502.",
        "operationId": "list_spotify_playlists",
        "responses": {
          "200": {
            "description": "Owned playlists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotifyPlaylistListResponse"
                }
              }
            }
          },
          "503": {
            "description": "Spotify is rate limiting this server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/spotify/playlists/{id}/import": {
      "post": {
        "tags": [
          "imports"
        ],
        "summary": "Start a Spotify playlist import: ensure the internal record, queue the\nimport job unless one for this playlist is already queued or running,\nand answer the id at once.",
        "operationId": "import_spotify_playlist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Spotify playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpotifyImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Import acknowledgement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotifyImportResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/spotify/redirect-uri": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "The computed OAuth redirect URI, for the admin to register.",
        "operationId": "get_spotify_redirect_uri",
        "responses": {
          "200": {
            "description": "OAuth redirect URI",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotifyRedirectUri"
                }
              }
            }
          },
          "400": {
            "description": "No Redirect Origin is set and the request names no address to build one from",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/acquire/spotify/settings": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "Masked Spotify app settings.",
        "operationId": "get_spotify_settings",
        "responses": {
          "200": {
            "description": "Masked Spotify settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotifySettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "imports"
        ],
        "summary": "Save the Spotify app settings. A masked secret preserves the stored\none; a non-absolute redirect origin is a 400.",
        "operationId": "put_spotify_settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpotifySettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved Spotify settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotifySettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/app-passwords": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Every live app password across users, with owners.",
        "operationId": "admin_list_app_passwords",
        "responses": {
          "200": {
            "description": "All live app passwords",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminAppPasswordListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/app-passwords/{id}": {
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Revoke any user's app password.",
        "operationId": "admin_revoke_app_password",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "App-password id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/backups": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Backup listing, oldest first.",
        "operationId": "list_backups",
        "responses": {
          "200": {
            "description": "Backups on disk",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Run one backup now.",
        "operationId": "run_backup",
        "responses": {
          "201": {
            "description": "Backup completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BackupRunResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/backups/{name}/restore-report": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Pre-restore verification report for one backup. Read-only.",
        "operationId": "restore_report",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Backup file name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verification report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestoreReport"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/cache/clear": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Clear provider data, the cached images, or both.",
        "operationId": "clear_cache",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CacheClearBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Clear counts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CacheClearResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/cache/stats": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Provider data and image cache counters.",
        "operationId": "cache_stats",
        "responses": {
          "200": {
            "description": "Cache counters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CacheStatsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/import": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Import a batch of accounts from one provider. The catalog is re-read\nserver-side; unknown, already-bound, and failed uids land in `skipped`.",
        "operationId": "admin_import_users",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportUsersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Finished batch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportUsersResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/import/jellyfin": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "List Jellyfin accounts available for import. 503 when Jellyfin is off,\nhas no API key, or cannot be reached.",
        "operationId": "admin_import_list_jellyfin",
        "responses": {
          "200": {
            "description": "Importable accounts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportCandidateListResponse"
                }
              }
            }
          },
          "503": {
            "description": "Jellyfin is not set up or unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/import/plex": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "List Plex accounts (Plex Home users and friends) available for import.\n503 when no Plex token is set up or plex.tv cannot be reached.",
        "operationId": "admin_import_list_plex",
        "responses": {
          "200": {
            "description": "Importable accounts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportCandidateListResponse"
                }
              }
            }
          },
          "503": {
            "description": "Plex is not set up or unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/precache/run": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Start one supervised precache run. The run continues in the background\nunder the `precache-library` job name.",
        "operationId": "run_precache",
        "responses": {
          "202": {
            "description": "Precache run started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrecacheRunResponse"
                }
              }
            }
          },
          "409": {
            "description": "A precache run is already live",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/provider-stats": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Provider limiter posture plus the outbound calls counted since start.",
        "operationId": "provider_stats",
        "responses": {
          "200": {
            "description": "Provider snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderStatsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/queue-stats": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Queue demand, the job registry and the latest checkpoint pass.",
        "operationId": "queue_stats",
        "responses": {
          "200": {
            "description": "Queue snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueStatsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/users": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Admin user listing, paged.",
        "operationId": "admin_list_users",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Rows per page, 1 to 100 (default 100).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Rows to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminUserListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Create a local account.",
        "operationId": "admin_create_user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminUserCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/users/{id}": {
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Delete one user.",
        "operationId": "admin_delete_user",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/users/{id}/custom-css": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "What one user's custom CSS is, never its text.",
        "operationId": "get_user_custom_css",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom CSS summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomCssSummary"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/users/{id}/custom-css/turn-off": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Switch one user's custom CSS off, keeping its text so they can see it\nand switch it back on.",
        "operationId": "turn_off_user_custom_css",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom CSS summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomCssSummary"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/users/{id}/quota": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "One user's quota standing.",
        "operationId": "get_user_quota",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quota standing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "admin"
        ],
        "summary": "Set (or, with all-`None`, clear) one user's quota overrides.",
        "operationId": "set_quota",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotaOverrideBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Fresh quota standing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/users/{id}/recovery-code": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Mint a recovery code for one user. The code returns once.",
        "operationId": "admin_mint_recovery_code",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Minted code (shown once)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryCodeResponse"
                }
              }
            }
          },
          "403": {
            "description": "Password sign-in is turned off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/users/{id}/role": {
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Change one user's role.",
        "operationId": "admin_set_role",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/admin/users/{id}/sessions": {
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Revoke every session of one user.",
        "operationId": "admin_revoke_sessions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Sessions revoked"
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/basic": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The album header.",
        "operationId": "album_basic",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID, or a library album id identified as one",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumBasicInfo"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz down and the album is not in the library",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/edition/acquire": {
      "get": {
        "tags": [
          "requests"
        ],
        "summary": "The album's current or last edition fetch: its download, and where each\ntrack it asked for is. `latest` is absent when there is none. Retry is a\nnew acquire, which asks only for what is still missing; Stop cancels\nthe download. `GET /api/v3/albums/{album_id}/edition/acquire`. Curator\nonly.",
        "operationId": "edition_fetch_handler",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionFetchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Fill the selected edition's missing tracks and upgrade its below-cutoff\nowned tracks, in one download; with `replace_versions`, also fetch this\nedition's version of each track the copy holds in another version.\n`POST /api/v3/albums/{album_id}/edition/acquire`. Curator only. Never\nretags existing files.",
        "operationId": "acquire_edition_handler",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "album_id",
            "in": "query",
            "description": "Local album id of the copy the edition picker planned; the chosen\ncopy of the release group when absent.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "replace_versions",
            "in": "query",
            "description": "Also fetch this edition's version of each track a file of the copy\nis another version of, and replace that file with it (the default).\nWith `false` those files stay and their tracks are not fetched.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionAcquireResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not enough disk space, or not in the library",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/editions": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "Every edition of the album.",
        "operationId": "album_editions",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID, or a library album id identified as one",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Editions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumEditionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz down",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/editions/{release_mbid}/tracks": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The tracklist of one edition, any release, for comparing editions side\nby side before choosing one.",
        "operationId": "edition_tracks",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID, or a library album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "release_mbid",
            "in": "path",
            "description": "Release MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tracklist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumTracksInfo"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz down",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/lastfm": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "Last.fm summary and tags for the album.",
        "operationId": "album_lastfm",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID, or a library album id identified as one",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_name",
            "in": "query",
            "description": "Artist name for the Last.fm lookup.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "album_name",
            "in": "query",
            "description": "Album title for the Last.fm lookup.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Last.fm data; empty when Last.fm is not set up",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LastFmAlbumEnrichment"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Last.fm is down (PROVIDER_UNAVAILABLE, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/more-by-artist": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The artist's other albums.",
        "operationId": "more_by_artist",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_id",
            "in": "query",
            "description": "The album's artist MBID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "How many to return, 1 to 30 (default 10).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Other albums by the artist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MoreByArtistResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id or bad count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/plugin-details": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "What metadata plugins add about the album: notes, tags, links and an\nimage. Empty when no plugin knows the album.",
        "operationId": "album_plugin_details",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID, or a library album id identified as one",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin details; empty when no plugin answers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginDetails"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz down",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/purchase-options": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "Where to buy the album.",
        "operationId": "album_purchase_options",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID, or a library album id identified as one",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Store links plus a Bandcamp search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOptionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz down",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/refresh": {
      "post": {
        "tags": [
          "catalog"
        ],
        "summary": "Drop the album's cached upstream answers and rebuild the header.",
        "operationId": "album_refresh",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID, or a library album id identified as one",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fresh album header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumBasicInfo"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz down and the album is not in the library",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/similar": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "Albums by similar artists.",
        "operationId": "similar_albums",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_id",
            "in": "query",
            "description": "The album's artist MBID.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "How many to return, 1 to 30 (default 10).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Similar albums",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimilarAlbumsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id or bad count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "ListenBrainz is down (PROVIDER_UNAVAILABLE, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/albums/{album_id}/tracks": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The tracklist of the edition the page shows.",
        "operationId": "album_tracks",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Release-group MBID, or a library album id identified as one",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tracklist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumTracksInfo"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz down and the album is not in the library",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The artist header.",
        "operationId": "artist",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Artist header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistInfo"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown artist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz down and the artist is not in the library",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/auto-download": {
      "put": {
        "tags": [
          "collections"
        ],
        "summary": "Turn auto-download on or off for one artist.",
        "operationId": "set_auto_download_handler",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoDownloadBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Follow status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FollowStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Artist not followed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Follow before enabling auto-download",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/extended": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "Biography, portrait and artist images.",
        "operationId": "artist_extended",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Biography and images; fields absent when unknown",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistExtendedInfo"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/follow": {
      "put": {
        "tags": [
          "collections"
        ],
        "summary": "Follow or unfollow one artist.",
        "operationId": "set_follow_handler",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FollowBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Follow status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FollowStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/follow-status": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "Read one artist's follow status.",
        "operationId": "get_follow_status_handler",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Follow status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FollowStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/lastfm": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "Last.fm biography, tags and similar artists.",
        "operationId": "artist_lastfm",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_name",
            "in": "query",
            "description": "Artist name, the Last.fm fallback key.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Last.fm data; empty when Last.fm is not set up",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LastFmArtistEnrichment"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Last.fm is down (PROVIDER_UNAVAILABLE, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/owned-releases": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The release groups of the artist's discography that the library holds,\nwhatever their type.",
        "operationId": "owned_releases",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Held release groups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnedReleases"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/purchase-options": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The artist's own store pages.",
        "operationId": "artist_purchase_options",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Artist name for the Bandcamp search fallback.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Store pages plus a Bandcamp search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistPurchaseOptionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/releases": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "One page of the discography.",
        "operationId": "artist_releases",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Items to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 200 (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Discography page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistReleases"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id or bad paging",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz down and the library has no albums by the artist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/similar": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "Similar artists.",
        "operationId": "similar_artists",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "How many to return, 1 to 50.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Provider to ask; default is ListenBrainz.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListenSource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Similar artists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimilarArtistsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id or bad count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/top-albums": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The artist's most played albums.",
        "operationId": "top_albums",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "How many to return, 1 to 50.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Provider to ask; default is ListenBrainz.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListenSource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Top albums",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopAlbumsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id or bad count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/artists/{artist_mbid}/top-songs": {
      "get": {
        "tags": [
          "catalog"
        ],
        "summary": "The artist's most played songs.",
        "operationId": "top_songs",
        "parameters": [
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "How many to return, 1 to 50.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Provider to ask; default is ListenBrainz.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListenSource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Top songs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopSongsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz id or bad count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/app-connect/authorize": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Allow an app connect request: issue its one-time code and answer the\naddress that hands it to the app. Needs a standard session, as creating\nan app password by hand does.",
        "operationId": "app_connect_authorize_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Where to send the browser; never stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppConnectRedirect"
                }
              }
            }
          },
          "400": {
            "description": "The app or its address is not listed, or the request is malformed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "A device session cannot allow this",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "App connect is off: no app is listed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The user holds the most app passwords allowed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/app-connect/request": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "What an app connect request asks for, for the confirmation page.",
        "operationId": "app_connect_request_handler",
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "description": "Must be `code`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "description": "The app's id, one listed in the `app_connect` settings.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "description": "Where the browser hands the result back; exactly one of the app's\nlisted addresses.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "description": "`BASE64URL(SHA256(code_verifier))`, 43 characters, no padding.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "description": "Must be `S256`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "The app's own value, handed back unchanged; up to 512 bytes.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "The device name the app reports, such as `Pixel 9`. Optional.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request, checked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppConnectRequestView"
                }
              }
            }
          },
          "400": {
            "description": "The app or its address is not listed, or the request is malformed (then `details.redirect` hands the error back to the app)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "App connect is off: no app is listed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/app-connect/token": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "The OAuth 2.0 token endpoint: trade an app connect code and its PKCE\nverifier for an app password of the user who allowed it. The code is\ngone after this call, whatever it answers.",
        "operationId": "app_connect_token_handler",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/AppConnectTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The new app password, shown once",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppConnectTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "The trade is refused, as RFC 6749 section 5.2 names it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppConnectTokenError"
                }
              }
            }
          },
          "429": {
            "description": "Too many trades from this address; see `Retry-After`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/device-sessions": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Mint a named companion Bearer token. Standard sessions only.",
        "operationId": "mint_device_session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceSessionMint"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Minted token (raw value shown once)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceSessionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/jellyfin/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Jellyfin login: checks credentials against the configured server, imports\nthe user, and mints a session. Transport rule matches local login.",
        "operationId": "jellyfin_login_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JellyfinLoginBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Authenticated user; token only in Bearer mode",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Login/setup success body: the authenticated user, plus the raw session\ntoken only in Bearer mode (cookie mode carries it in `Set-Cookie`).",
                  "required": [
                    "user"
                  ],
                  "properties": {
                    "token": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Raw session token; present only in Bearer mode."
                    },
                    "user": {
                      "$ref": "#/components/schemas/UserResponse",
                      "description": "Authenticated user."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts for this client or username",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Jellyfin unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Local login. Cookie mode (default) sets the session cookie and the body\ncarries no token; Bearer mode returns the raw token once and sets no\ncookie. Failures are one uniform 401 with a dummy-hash verify behind it.",
        "operationId": "login_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Authenticated user; token only in Bearer mode",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Login/setup success body: the authenticated user, plus the raw session\ntoken only in Bearer mode (cookie mode carries it in `Set-Cookie`).",
                  "required": [
                    "user"
                  ],
                  "properties": {
                    "token": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Raw session token; present only in Bearer mode."
                    },
                    "user": {
                      "$ref": "#/components/schemas/UserResponse",
                      "description": "Authenticated user."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid username or password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Password sign-in is turned off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts for this client or username",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Logout. Public so a stale client can always clear its cookie: revokes the\npresented sessions that resolve, always clears the cookie under both its\nnames, always 204. A Bearer token is the only one presented when sent;\notherwise the session under each cookie name the request carries ends,\nso a sign-out at the https address leaves no plain cookie signed in.",
        "operationId": "logout_handler",
        "responses": {
          "204": {
            "description": "Logged out; cookie cleared"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/logout-all": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Revoke every own session.",
        "operationId": "logout_all",
        "responses": {
          "204": {
            "description": "All own sessions revoked"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/oidc/authorize": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Start an OIDC login: returns the browser URL (PKCE, state and nonce\nbaked in) and sets a short-lived cookie tying the state to this browser.",
        "operationId": "oidc_authorize_handler",
        "responses": {
          "200": {
            "description": "Browser URL for this login",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OidcAuthorizeBody"
                }
              }
            }
          },
          "503": {
            "description": "OIDC not configured or unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/oidc/callback": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "OIDC callback: consumes the IdP code/state and redirects (relative\nLocation, same-site hand-off, v2 parity) to the SPA callback carrying the\none-time exchange code. Always `no-store`.",
        "operationId": "oidc_callback_handler",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "description": "Authorization code from the IdP",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "State echoed from the authorize step",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the SPA callback with the exchange code"
          },
          "401": {
            "description": "OIDC authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "OIDC provider unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/oidc/exchange": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "OIDC exchange: swaps the one-time callback code for a session. Cookie\nmode (default) sets the session cookie and the body carries no token;\nBearer mode returns the raw token once.",
        "operationId": "oidc_exchange_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OidcExchangeBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Authenticated user; token only in Bearer mode",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Login/setup success body: the authenticated user, plus the raw session\ntoken only in Bearer mode (cookie mode carries it in `Set-Cookie`).",
                  "required": [
                    "user"
                  ],
                  "properties": {
                    "token": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Raw session token; present only in Bearer mode."
                    },
                    "user": {
                      "$ref": "#/components/schemas/UserResponse",
                      "description": "Authenticated user."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired code",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Server busy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/password-recovery/reset": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Reset a password with a recovery code. Public: a locked-out user holds\nno session.",
        "operationId": "reset_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordReset"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Password reset"
          },
          "403": {
            "description": "Password sign-in is turned off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/plex/poll/connect": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Plex settings completion: polls the PIN and returns the raw auth token\nuntouched. Requires a session (the token is an account credential).",
        "operationId": "plex_poll_connect_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlexPinBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Pending flag, or the raw auth token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlexConnectPollResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Plex unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/plex/poll/link": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Plex link completion: polls the PIN and, once authorized, stores the\nverified account as the caller's Plex media link (v2 parity). Requires\na session; the answer carries the Plex user name, never its tokens.",
        "operationId": "plex_poll_link_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlexPinBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Pending flag, or the linked Plex user name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlexLinkPollResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Plex unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/plex/poll/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Plex login completion: polls the PIN, and once authorized imports the\nuser and mints a session. Pending polls carry only the flag.",
        "operationId": "plex_poll_login_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlexLoginPollBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Pending flag, or the user once authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlexLoginPollResult"
                }
              }
            }
          },
          "403": {
            "description": "Access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Plex unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/plex/start": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Start a Plex sign-in: mints a PIN, its browser URL, and the secret\nevery poll must present. 503 while Plex login is switched off.",
        "operationId": "plex_start_handler",
        "responses": {
          "200": {
            "description": "Fresh PIN, browser URL and poll secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlexStartBody"
                }
              }
            }
          },
          "503": {
            "description": "Plex login is off, or Plex is unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/plex/start/connect": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Start the settings sign-in that hands an admin their Plex token for\nthe server settings. Admin only.",
        "operationId": "plex_start_connect_handler",
        "responses": {
          "200": {
            "description": "Fresh PIN, browser URL and poll secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlexStartBody"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Plex unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/plex/start/link": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Start linking the caller's Plex account. 400 without a configured Plex\nserver.",
        "operationId": "plex_start_link_handler",
        "responses": {
          "200": {
            "description": "Fresh PIN, browser URL and poll secret",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlexStartBody"
                }
              }
            }
          },
          "400": {
            "description": "No Plex server is configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Plex or the configured server is unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/providers": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Which sign-in methods are switched on (v2 `GET /auth/providers`).",
        "operationId": "providers_handler",
        "responses": {
          "200": {
            "description": "Enabled sign-in methods",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthProvidersBody"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/sessions": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "List the caller's sessions for the session-list UI.",
        "operationId": "list_sessions",
        "responses": {
          "200": {
            "description": "Own sessions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/sessions/{id}": {
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Revoke one own session.",
        "operationId": "revoke_session",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Session id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/auth/setup": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "First-admin setup. Creates the admin and logs them in (201 + session,\nv2 parity) iff no users exist; otherwise 409. On a server that logged a\nsetup code it also needs that code, checked before anything else is: a\nmissing or wrong one answers the same 401. The account and its\nsession are one write: a busy or failed setup leaves nothing, so a retry\ncan still run it. The emptiness check runs inside that transaction, so\nconcurrent setups, or a setup racing a first federated login (whose role\nis also decided in its insert), leave exactly one admin. The early probe\nonly skips the password hash.",
        "operationId": "setup_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "First admin created and logged in",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Login/setup success body: the authenticated user, plus the raw session\ntoken only in Bearer mode (cookie mode carries it in `Set-Cookie`).",
                  "required": [
                    "user"
                  ],
                  "properties": {
                    "token": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Raw session token; present only in Bearer mode."
                    },
                    "user": {
                      "$ref": "#/components/schemas/UserResponse",
                      "description": "Authenticated user."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid username, password, or email",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "The code from the server log is missing or wrong",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Setup has already been completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/auth/setup/status": {
      "get": {
        "tags": [
          "auth"
        ],
        "summary": "Setup-required probe for the SPA first-run gate.",
        "operationId": "setup_status_handler",
        "responses": {
          "200": {
            "description": "Whether setup must run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupStatusBody"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/cache/sync/cancel": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Stop the running library image precache. Images already fetched stay\ncached, so the next run continues from there. Succeeds when nothing is\nrunning too.",
        "operationId": "cancel_cache_sync",
        "responses": {
          "200": {
            "description": "Precache stopped",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CacheSyncCancelResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/cache/sync/status": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Where the library image precache stands. The same shape streams live\nas the `cache.sync` event.",
        "operationId": "cache_sync_status",
        "responses": {
          "200": {
            "description": "Precache progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CacheSyncProgress"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/covers/artist/{artist_id}": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Artist image.",
        "operationId": "artist_cover",
        "parameters": [
          {
            "name": "artist_id",
            "in": "path",
            "description": "MusicBrainz artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Preferred width in pixels",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes"
          },
          "202": {
            "description": "Image is warming; poll again"
          },
          "304": {
            "description": "Image unchanged"
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No image for this artist"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/covers/artist/{artist_id}/credit": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Artist image credit: the author and licence of a Commons picture.",
        "description": "Read from the stored image, so it is there exactly while the picture is.",
        "operationId": "artist_cover_credit",
        "parameters": [
          {
            "name": "artist_id",
            "in": "path",
            "description": "MusicBrainz artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The credit, or null",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistImageCredit"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/covers/release-group/{release_group_id}": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Release-group cover art.",
        "operationId": "cover_from_release_group",
        "parameters": [
          {
            "name": "release_group_id",
            "in": "path",
            "description": "MusicBrainz release group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Preferred size: 250, 500, 1200, or original for full size",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cover bytes"
          },
          "202": {
            "description": "Cover is warming; poll again"
          },
          "304": {
            "description": "Cover unchanged"
          },
          "400": {
            "description": "Unsupported size",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No art for this release group"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/covers/release/{release_id}": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Release cover art.",
        "operationId": "cover_from_release",
        "parameters": [
          {
            "name": "release_id",
            "in": "path",
            "description": "MusicBrainz release id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Preferred size: 250, 500, 1200, or original for full size",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cover bytes"
          },
          "202": {
            "description": "Cover is warming; poll again"
          },
          "304": {
            "description": "Cover unchanged"
          },
          "400": {
            "description": "Unsupported size",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No art for this release"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "Cached discover shelves for the caller.",
        "operationId": "get_discover",
        "responses": {
          "200": {
            "description": "Discover shelves",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoverResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/activity": {
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "Record one discover interaction for personalization.",
        "operationId": "record_activity",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscoverActivityRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Personalization cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoverActivityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/album-preview": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "Ordered 30-second samples of an album's first tracks.",
        "operationId": "album_preview",
        "parameters": [
          {
            "name": "artist",
            "in": "query",
            "description": "Artist name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "album",
            "in": "query",
            "description": "Album name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "Wanted samples, 1-8",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album samples",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not configured (NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/batches": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "The caller's batches, newest first.",
        "operationId": "list_batches",
        "responses": {
          "200": {
            "description": "Batch list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryBatchListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "The batch store failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "Create a discovery batch: every album the library lacks and nobody\nhas requested yet is filed as an album request, under the caller's\nquota and approval rules.",
        "operationId": "create_batch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscoveryBatchCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Batch created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryBatchDetail"
                }
              }
            }
          },
          "400": {
            "description": "Empty or oversized batch, or every album is already owned or requested",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Storage full (STORAGE_FULL)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Acquisition is not running (NOT_AVAILABLE)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Request quota spent (QUOTA_EXCEEDED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/batches/{batch_id}": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "One batch with each album's current state. Admins may open any batch;\nanyone else's reads as missing.",
        "operationId": "get_batch",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "description": "Batch id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryBatchDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown batch id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "discover"
        ],
        "summary": "Remove one batch. With `remove_albums` (the default) its pending\nrequests are cancelled and the albums it brought in go to the recycle\nbin; albums that were already owned or requested are never touched.",
        "operationId": "remove_batch",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "description": "Batch id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "remove_albums",
            "in": "query",
            "description": "Also remove the batch albums",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removal outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryBatchRemoveResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown batch id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/playlist-suggestions": {
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "Suggest rows extending one playlist.",
        "operationId": "playlist_suggestions",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistSuggestionsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Playlist suggestions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistSuggestionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown seed album or playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "The queue deck: the caller's last built deck, else one built now.",
        "operationId": "get_queue",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "description": "Wanted card count, max 20",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Queue deck",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoverQueueResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "The library check failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue/enrich/{release_group_mbid}": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "Details behind one queue card: tags, release date, country, artist\nbio, listen count and a video link when one is known.",
        "operationId": "enrich_queue_item",
        "parameters": [
          {
            "name": "release_group_mbid",
            "in": "path",
            "description": "Release-group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Card details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueEnrichment"
                }
              }
            }
          },
          "400": {
            "description": "Bad release-group id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue/generate": {
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "Start a background queue build. `action` says what happened:\n`started`, `already_building`, or `already_ready` (a fresh deck exists\nand `force` was not set).",
        "operationId": "queue_generate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueGenerateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Build state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueGenerateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue/ignore": {
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "Ignore one release: later decks skip it, and a new deck starts\nbuilding at once.",
        "operationId": "ignore_queue_item",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueIgnoreRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Release ignored"
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "The ignore could not be saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue/ignored": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "The caller's ignore ledger, newest first.",
        "operationId": "ignored_releases",
        "responses": {
          "200": {
            "description": "Ignore ledger",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IgnoredReleasesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "The ledger could not be read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue/ignored/{release_group_mbid}": {
      "delete": {
        "tags": [
          "discover"
        ],
        "summary": "Take one release off the caller's ignore ledger, so later decks may\nhold it. Answers the same when the caller had not ignored it.",
        "operationId": "unignore_queue_item",
        "parameters": [
          {
            "name": "release_group_mbid",
            "in": "path",
            "description": "MusicBrainz release-group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Release is not ignored"
          },
          "400": {
            "description": "Not a MusicBrainz id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "The change could not be saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue/preview/{release_group_mbid}": {
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "A video preview behind one queue card: a MusicBrainz video link when\none exists, else a YouTube search when an API key is set.",
        "operationId": "preview_queue_item",
        "parameters": [
          {
            "name": "release_group_mbid",
            "in": "path",
            "description": "Release-group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Card preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoverQueuePreview"
                }
              }
            }
          },
          "400": {
            "description": "Bad release-group id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue/status": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "Where the caller's background queue build stands: `idle`, `building`,\n`ready` (with the deck's id, size, age and staleness) or `error`.",
        "operationId": "queue_status",
        "responses": {
          "200": {
            "description": "Queue build status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoverQueueStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue/validate": {
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "The given cards whose albums the library already holds.",
        "operationId": "validate_queue",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueueValidateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Library membership",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueValidateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "The library check failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/queue/youtube-track-search": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "Track video lookup with the cached flag.",
        "operationId": "youtube_track_search",
        "parameters": [
          {
            "name": "artist",
            "in": "query",
            "description": "Artist name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "track",
            "in": "query",
            "description": "Track name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved video",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YouTubeSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not configured (NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "YouTube search quota used up for today (RATE_LIMITED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/radio": {
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "Generate one radio shelf from a seed.",
        "operationId": "discover_radio",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RadioRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Radio shelf",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChartSection"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown seed album or playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/radio/plan": {
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "Build a complete track-level radio plan.",
        "operationId": "radio_plan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RadioPlanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Radio plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RadioPlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown seed album or playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/refresh": {
      "post": {
        "tags": [
          "discover"
        ],
        "summary": "Trigger a background discover rebuild for the caller.",
        "operationId": "refresh_discover",
        "responses": {
          "202": {
            "description": "Refresh triggered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/discover/track-preview": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "A 30-second track preview. Empty means no provider had one.",
        "operationId": "track_preview",
        "parameters": [
          {
            "name": "artist",
            "in": "query",
            "description": "Artist name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "track",
            "in": "query",
            "description": "Track name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Track preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not configured (NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/download/access": {
      "get": {
        "tags": [
          "stream"
        ],
        "summary": "Whether the caller may download library files (for download buttons\nshown before any album is open).",
        "operationId": "download_access",
        "responses": {
          "200": {
            "description": "Download capability",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryDownloadAccess"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/download/local/album/mbid/{mbid}": {
      "get": {
        "tags": [
          "stream"
        ],
        "summary": "An album's streamable files as a ZIP, by MusicBrainz release-group (or\nrelease) id; the oldest local copy answers when several exist.",
        "operationId": "download_album_by_mbid",
        "parameters": [
          {
            "name": "mbid",
            "in": "path",
            "description": "Release-group or release mbid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album archive",
            "content": {
              "application/zip": {}
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Downloads restricted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No local album holds the id, or no files left",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/download/local/album/{id}": {
      "get": {
        "tags": [
          "stream"
        ],
        "summary": "An album's streamable files as a ZIP, by local album id.",
        "operationId": "download_album",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album archive",
            "content": {
              "application/zip": {}
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Downloads restricted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, or no files left to archive",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/download/local/track/{id}": {
      "get": {
        "tags": [
          "stream"
        ],
        "summary": "One track file, unchanged, as an attachment. A single `Range` is\nanswered with 206, so download managers can\nresume.",
        "operationId": "download_track",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local track id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Track file",
            "content": {
              "application/octet-stream": {}
            }
          },
          "206": {
            "description": "The asked byte range of the track file",
            "content": {
              "application/octet-stream": {}
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Downloads restricted, or the file left the library roots",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track, or the file is gone",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "416": {
            "description": "Range not satisfiable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/activity-summary": {
      "get": {
        "tags": [
          "downloads"
        ],
        "summary": "Queue counters and the revision that tells the page to refetch.\n`GET /api/v3/downloads/activity-summary`.",
        "operationId": "activity_summary_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadActivitySummaryResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/clear": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Remove finished (completed and cancelled) downloads from the queue.\nAdmins clear every user's. `POST /api/v3/downloads/clear`.",
        "operationId": "clear_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClearDownloadsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/cutoff-unmet": {
      "get": {
        "tags": [
          "downloads"
        ],
        "summary": "Albums below the quality cutoff, worst first; empty while upgrades are\noff. Admins and trusted users. `GET /api/v3/downloads/cutoff-unmet`.",
        "operationId": "cutoff_unmet_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CutoffUnmetResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/quarantine": {
      "get": {
        "tags": [
          "downloads"
        ],
        "summary": "The release blocklist, newest first. Admin only.\n`GET /api/v3/downloads/quarantine`.",
        "operationId": "list_quarantine_handler",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "1-based page (default 1).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "Entries per page, 1 to 200 (default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuarantineListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/quarantine/{quarantine_id}": {
      "delete": {
        "tags": [
          "downloads"
        ],
        "summary": "Remove one blocklist entry so its release may be tried again. Admin\nonly. `DELETE /api/v3/downloads/quarantine/{quarantine_id}`.",
        "operationId": "delete_quarantine_handler",
        "parameters": [
          {
            "name": "quarantine_id",
            "in": "path",
            "description": "Quarantine entry id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/retry-all-failed": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Retry every failed download that will not retry by itself, once per\nalbum or track. `POST /api/v3/downloads/retry-all-failed`.",
        "operationId": "retry_all_failed_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetryAllResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/search/album": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Search every download source for one album. The search runs in the\nbackground; follow it with `search_job_updated` events or by reading\nthe job. `POST /api/v3/downloads/search/album`.",
        "operationId": "search_album_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchAlbumRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchAlbumResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/search/{job_id}": {
      "get": {
        "tags": [
          "downloads"
        ],
        "summary": "One of your manual searches and its candidates.\n`GET /api/v3/downloads/search/{job_id}`.",
        "operationId": "search_job_handler",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Search job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchJobResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/search/{job_id}/cancel": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Close a search without downloading anything.\n`POST /api/v3/downloads/search/{job_id}/cancel`.",
        "operationId": "cancel_search_handler",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Search job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/search/{job_id}/dismiss": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "\"None of these, keep watching\": close the search and put the album on\nthe wanted watchlist. `POST /api/v3/downloads/search/{job_id}/dismiss`.",
        "operationId": "dismiss_search_handler",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Search job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DismissSearchResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/search/{job_id}/pick": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Download one candidate. The download fetches exactly that candidate\nfirst. `POST /api/v3/downloads/search/{job_id}/pick`.",
        "operationId": "pick_candidate_handler",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Search job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PickRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PickResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/stop-all-retries": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Stop every scheduled automatic retry.\n`POST /api/v3/downloads/stop-all-retries`.",
        "operationId": "stop_all_retries_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StopRetriesResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/tasks": {
      "get": {
        "tags": [
          "downloads"
        ],
        "summary": "The viewer's download queue, newest first. Admins see every user's\ntasks. `GET /api/v3/downloads/tasks`.",
        "operationId": "list_tasks_handler",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Only tasks in this status.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "release_group_mbid",
            "in": "query",
            "description": "Only tasks for this release group.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "1-based page (default 1).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "Tasks per page, 1 to 100 (default 20).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/tasks/{task_id}/cancel": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Stop a download: a live one is cancelled and its transfer aborted; a\nfailed one stops retrying. The owner's wanted watch on the album stops\ntoo. `POST /api/v3/downloads/tasks/{task_id}/cancel`.",
        "operationId": "cancel_task_handler",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "Download task id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/tasks/{task_id}/next-source": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Move a transfer that waits in a Soulseek peer's queue (no bytes yet)\nto the next ranked source.\n`POST /api/v3/downloads/tasks/{task_id}/next-source`.",
        "operationId": "next_source_handler",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "Download task id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NextSourceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextSourceResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/tasks/{task_id}/reimport": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Import a failed or short-landed task's files again, right away, from\nthe files its last download left on disk (no new search or download).\n`POST /api/v3/downloads/tasks/{task_id}/reimport`. Admin only. Missing\ntasks and tasks with no files to reimport answer 404; a download client\nthat is no longer configured answers 409.",
        "operationId": "reimport_task_handler",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "Download task id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReimportResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/tasks/{task_id}/retry": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Retry a failed, cancelled or partial download now. Answers the new\ntask, or the download already fetching the album. An album retry clears\nthe album's blocklist first.\n`POST /api/v3/downloads/tasks/{task_id}/retry`.",
        "operationId": "retry_task_handler",
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "description": "Download task id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetryDownloadResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/upgrade/album": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Fetch a better copy of an album below the cutoff. Admins and trusted\nusers. `POST /api/v3/downloads/upgrade/album`.",
        "operationId": "upgrade_album_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeAlbumRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeRequestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/downloads/upgrade/track": {
      "post": {
        "tags": [
          "downloads"
        ],
        "summary": "Fetch a better copy of one track below the cutoff. Admins and trusted\nusers. `POST /api/v3/downloads/upgrade/track`.",
        "operationId": "upgrade_track_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeTrackRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeRequestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/events/stream": {
      "get": {
        "tags": [
          "events"
        ],
        "summary": "Live events for the signed-in user.",
        "description": "Each SSE frame is one `StreamEvent`: its `event:` line is the member's\n`event` and its `data:` line the member's `data` as JSON. Some events\ngo to everyone, the rest only to the user they concern.",
        "operationId": "events_stream",
        "responses": {
          "200": {
            "description": "Server-Sent Events stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/StreamEvent"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/favorites/{kind}/{item_id}": {
      "put": {
        "tags": [
          "collections"
        ],
        "summary": "Favorite or unfavorite one item.",
        "description": "Acts on the caller's own favourites, the ones Subsonic apps star and\nJellyfin apps mark. The old id of a merged item acts on the item it went\ninto, and the answer names that id.",
        "operationId": "set_favorite_handler",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "description": "Kind: album, artist, or track",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "description": "Local id of the item",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetFavoriteBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Favorite status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FavoriteStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad kind or body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No live item holds the id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/following/artists": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "List the caller's followed artists.",
        "operationId": "list_followed_artists_handler",
        "responses": {
          "200": {
            "description": "Followed artists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FollowedArtistListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/following/concerts": {
      "get": {
        "tags": [
          "concerts"
        ],
        "summary": "Upcoming gigs for the caller's followed artists in their saved cities,\ndate ascending. `configured` is false when no events source is on.",
        "operationId": "list_concerts",
        "responses": {
          "200": {
            "description": "The caller's concerts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConcertsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/following/concerts/cities": {
      "get": {
        "tags": [
          "concerts"
        ],
        "summary": "The caller's saved cities in picker order.",
        "operationId": "list_event_cities",
        "responses": {
          "200": {
            "description": "Saved cities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventCitiesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "concerts"
        ],
        "summary": "Replace the caller's cities with the submitted list, in order.",
        "operationId": "replace_event_cities",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventCitiesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved cities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventCitiesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Coordinates out of range or malformed body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/following/concerts/city-search": {
      "get": {
        "tags": [
          "concerts"
        ],
        "summary": "City suggestions for the picker. An empty list means no such place; a\ngeocoder failure answers 503.",
        "operationId": "search_cities",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search text, 2-100 characters.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suggestions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CitySearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Query missing or not 2-100 characters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Geocoder unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/following/concerts/seen": {
      "post": {
        "tags": [
          "concerts"
        ],
        "summary": "Mark the caller's concerts seen. The count is zero afterwards.",
        "operationId": "mark_concerts_seen",
        "responses": {
          "200": {
            "description": "Zeroed count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnseenCountResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/following/concerts/unseen-count": {
      "get": {
        "tags": [
          "concerts"
        ],
        "summary": "Gigs in the caller's cities first seen since they last opened the page.",
        "operationId": "unseen_concerts",
        "responses": {
          "200": {
            "description": "Unseen count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnseenCountResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/following/new-releases/recent": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "List recent-window sightings for followed artists.",
        "operationId": "list_recent_releases_handler",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "Window in days, 1-365 (default 30).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Most rows returned, 1-500 (default 8).",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "include_owned",
            "in": "query",
            "description": "Keep albums the library already holds (default true).",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent releases",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewReleaseListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad window or limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/following/new-releases/seen": {
      "post": {
        "tags": [
          "collections"
        ],
        "summary": "Mark the caller's sightings seen.",
        "operationId": "mark_seen_handler",
        "responses": {
          "200": {
            "description": "Zeroed count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnseenCountResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/following/new-releases/unseen-count": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "Count unseen sightings for the caller.",
        "operationId": "unseen_count_handler",
        "responses": {
          "200": {
            "description": "Unseen count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnseenCountResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/held": {
      "get": {
        "tags": [
          "held"
        ],
        "summary": "Entries waiting for your decision, newest first, with when each\nexpires. `GET /api/v3/held`.",
        "operationId": "list_handler",
        "parameters": [
          {
            "name": "release_group_mbid",
            "in": "query",
            "description": "Only this album's entries.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "task_id",
            "in": "query",
            "description": "Only entries holding files of this download.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "all",
            "in": "query",
            "description": "Admins: every user's entries.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/held/files/{file_id}/audio": {
      "get": {
        "tags": [
          "held"
        ],
        "summary": "Play a held file, with byte ranges so the player can seek.\n`GET /api/v3/held/files/{file_id}/audio`.",
        "operationId": "audio_handler",
        "parameters": [
          {
            "name": "file_id",
            "in": "path",
            "description": "Held file id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The held file",
            "content": {
              "application/octet-stream": {}
            }
          },
          "206": {
            "description": "The requested byte range",
            "content": {
              "application/octet-stream": {}
            }
          },
          "416": {
            "description": "The range lies outside the file"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/held/recheck": {
      "post": {
        "tags": [
          "held"
        ],
        "summary": "Re-check AcoustID holds across entries (at most 25 checks a call).\n`POST /api/v3/held/recheck`.",
        "operationId": "recheck_all_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldRecheckAllRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldRecheckAllResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/held/{entry_id}/discard": {
      "post": {
        "tags": [
          "held"
        ],
        "summary": "Delete an entry's held files (all, or those named). For a download, the\nalbum's automatic retry resumes. `POST /api/v3/held/{entry_id}/discard`.",
        "operationId": "discard_handler",
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "description": "Held entry id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldFilesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/held/{entry_id}/import": {
      "post": {
        "tags": [
          "held"
        ],
        "summary": "Import an entry's held files (all, or those named), skipping the check\nthat held each. A file no better than your copy stays held until \"Use\nthis file\"; a lower-quality version replaces yours only by \"Use this\nversion\", and yours goes to the recycle bin.\n`POST /api/v3/held/{entry_id}/import`.",
        "operationId": "import_handler",
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "description": "Held entry id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldFilesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/held/{entry_id}/match": {
      "post": {
        "tags": [
          "held"
        ],
        "summary": "Import an entry's held files as the album a curator picked: the app\npairs them with its tracks. `POST /api/v3/held/{entry_id}/match`.",
        "operationId": "match_handler",
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "description": "Held entry id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldMatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/held/{entry_id}/recheck": {
      "post": {
        "tags": [
          "held"
        ],
        "summary": "Ask AcoustID again about an entry's files it heard as another recording\nor could not confirm; files it now confirms are imported.\n`POST /api/v3/held/{entry_id}/recheck`.",
        "operationId": "recheck_handler",
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "description": "Held entry id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HeldFilesRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeldActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/home": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "Cached home shelves for the caller.",
        "operationId": "get_home",
        "responses": {
          "200": {
            "description": "Home shelves",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HomeResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/home/genre/{genre_name}": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "Genre detail with owned and popular rows.",
        "operationId": "genre_detail",
        "parameters": [
          {
            "name": "genre_name",
            "in": "path",
            "description": "Genre name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Rows per lane",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "artist_offset",
            "in": "query",
            "description": "Artist lane offset",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "album_offset",
            "in": "query",
            "description": "Album lane offset",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Genre detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenreDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/home/integration-status": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "Integration availability behind the shelves.",
        "operationId": "integration_status",
        "responses": {
          "200": {
            "description": "Integration availability",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationStatus"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not configured (NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/home/popular/albums": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "One popular-albums page, with the range param.",
        "operationId": "popular_albums",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "description": "Range, this_week default",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/StatsRange"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Page offset",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Provider, listenbrainz default",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListenSource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Popular albums page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChartPage_AlbumRef"
                }
              }
            }
          },
          "400": {
            "description": "Bad range or source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not configured (NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/home/trending/artists": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "One trending-artists page. Range rides the `range` query param.",
        "operationId": "trending_artists",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "description": "Range, this_week default",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/StatsRange"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Page offset",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Provider, listenbrainz default",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListenSource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trending artists page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChartPage_ArtistRef"
                }
              }
            }
          },
          "400": {
            "description": "Bad range or source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not configured (NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/home/your-top/albums": {
      "get": {
        "tags": [
          "discover"
        ],
        "summary": "One your-top-albums page for the caller.",
        "operationId": "your_top_albums",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "description": "Range, this_week default",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/StatsRange"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Page offset",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "source",
            "in": "query",
            "description": "Provider, listenbrainz default",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListenSource"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your-top albums page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChartPage_AlbumRef"
                }
              }
            }
          },
          "400": {
            "description": "Bad range or source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not configured (NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "A source is down (PROVIDER_UNAVAILABLE names an outside one, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/import/jobs": {
      "get": {
        "tags": [
          "imports"
        ],
        "summary": "Your recent import jobs; admins may pass `all=true` for everyone's.\n`GET /api/v3/import/jobs`.",
        "operationId": "list_jobs_handler",
        "parameters": [
          {
            "name": "all",
            "in": "query",
            "description": "Admins: every user's jobs.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DropImportJobsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/import/uploads": {
      "post": {
        "tags": [
          "imports"
        ],
        "summary": "Upload files to import: audio files or `.zip` archives, at most 25\nper drop and 8 GB in all. Returns the new job; it keeps working in the\nbackground. `POST /api/v3/import/uploads`.",
        "operationId": "upload_handler",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/DropUploadForm"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DropImportJobResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/activity": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "What the library is doing now: scans, identification, and the work\nstack.",
        "operationId": "library_activity",
        "responses": {
          "200": {
            "description": "Activity feed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryActivity"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One page of catalog albums.",
        "operationId": "list_albums",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-200. Default 50.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The `next` of the page before, with the same sort and order.\nAbsent for the first page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Default `name`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AlbumListSort"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Default `asc`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListOrder"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Title/artist substring filter, case folded.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_id",
            "in": "query",
            "description": "Restrict to one album artist.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "decade",
            "in": "query",
            "description": "Restrict to one decade start year, e.g. 1990.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Restrict to one primary track format, e.g. `flac`. Blank reads as\nabsent; matching is case-insensitive. `formats` wins when both are\ngiven.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "formats",
            "in": "query",
            "description": "Primary track formats, comma-separated, e.g. `flac,mp3`; matching is\ncase-insensitive. See `format_mode`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format_mode",
            "in": "query",
            "description": "Default `with`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FormatMode"
            }
          },
          {
            "name": "min_tracks",
            "in": "query",
            "description": "Only albums with at least this many indexed tracks, 1-10000. See\n`tracks_mode`.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "tracks_mode",
            "in": "query",
            "description": "Default `at_least`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TracksMode"
            }
          },
          {
            "name": "rating",
            "in": "query",
            "description": "Only albums the caller rated, 1-5 stars. See `rating_mode`; albums\nthey did not rate are left out.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "rating_mode",
            "in": "query",
            "description": "Default `at_least`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RatingMode"
            }
          },
          {
            "name": "favorites",
            "in": "query",
            "description": "Only the caller's favourites. Without `sort`, the newest favourite\ncomes first, and `order=asc` puts the oldest first.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/formats": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "How many albums each primary format has, for the format filter.",
        "operationId": "album_format_counts",
        "responses": {
          "200": {
            "description": "Album counts per format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumFormatCounts"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/match/{mbid}": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One page of an album's streamable tracks by release-group mbid or\nlocal album id.",
        "operationId": "match_album",
        "parameters": [
          {
            "name": "mbid",
            "in": "path",
            "description": "Release-group mbid or local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-1000. Default 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Page start. Default 0.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Track page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown mbid or album id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/merge": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Fold whole albums into the target album.",
        "operationId": "apply_album_merge",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Merge applied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogCorrectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad selection or token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, track or target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The preview expired or the albums changed since",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/merge-preview": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview folding whole albums into the target album.",
        "operationId": "preview_album_merge",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipPreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "What the merge would do",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "No tracks, no target, or the target is the source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, track or target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "An album changed since the page loaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Where the album's edition stands, and why.",
        "operationId": "get_edition",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The album's edition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionStatusView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "library management"
        ],
        "summary": "Choose the album's edition: any release, from this album's release\ngroup or another. Files the edition has no track for keep their\nrecording; nothing automatic changes the choice afterwards. With\n`use_anyway`, a release that fits none of the files is taken placing\nnone: the files lose any track they had, and the album waits for its\nfiles to be matched by hand.",
        "operationId": "choose_edition",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChooseEditionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The choice and what it did",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionChoiceView"
                }
              }
            }
          },
          "400": {
            "description": "Not a release id, or the release fits none of the files and `use_anyway` is not set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, or MusicBrainz does not know the release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album's edition changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz is not answering",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "library management"
        ],
        "summary": "\"Let DroppedNeedle choose\": drop the person's choice and pick the best\nfit for the files again.",
        "operationId": "hand_back_edition",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expected_identity_revision",
            "in": "query",
            "description": "The `identity_revision` the edition status or plan showed.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The album's edition, identification queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionStatusView"
                }
              }
            }
          },
          "400": {
            "description": "No revision given",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album's edition changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/confirm": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "\"That's right\": confirm the album's unconfirmed best guess.",
        "operationId": "confirm_edition",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditionRevisionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The album's edition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionStatusView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Nothing waits for confirmation, or the edition changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/custom": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Keep the album's files as they are, as a custom edition of the\nrelease's group: the tags, positions and file list are frozen as they\nare now, and the release group becomes the album's chosen match.\nUndo with `.../edition/undo`.",
        "operationId": "seal_custom_edition",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomEditionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The album's edition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionStatusView"
                }
              }
            }
          },
          "400": {
            "description": "Not a release id, or the files cannot be sealed under that release group (CUSTOM_EDITION_NOT_SEALABLE)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, or MusicBrainz does not know the release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz is not answering",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/extras/remove": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Move files the album's edition has no place for (second copies, other\nversions and files not on it) to the recycle bin: every fate but\n`keep`. Only files the current plan marks that way are accepted;\nnothing runs on its own. The album's removals list it for Put back.",
        "operationId": "remove_extras",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveExtrasBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Files recycled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveExtrasView"
                }
              }
            }
          },
          "400": {
            "description": "A picked file keeps its place on the edition, or nothing was picked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album or track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The edition changed since the plan was read (STALE_REVISION), the library is busy or off, or a file is outside the library folders",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "A file could not be recycled; nothing changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz is not answering",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/files/{track_id}": {
      "put": {
        "tags": [
          "library management"
        ],
        "summary": "Match one file to a track of the album's edition by hand.",
        "description": "A file the edition did not place goes on a track no file holds, and\nthen counts as that track. On an edition the app picked, the edition\nbecomes the person's, as \"Looks right\" makes it. No file is read or\nwritten.",
        "operationId": "match_edition_file",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "track_id",
            "in": "path",
            "description": "Local track id of the file",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatchFileBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The album's edition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionStatusView"
                }
              }
            }
          },
          "400": {
            "description": "The album has no edition, or the track is not on it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, or the file is not one of its files",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The edition changed (STALE_REVISION), the file is already on a track, another file holds the track, or the album is a custom edition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz is not answering",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "library management"
        ],
        "summary": "Undo a file's match by hand.",
        "description": "The file's identity goes back to what it was before the match. Plays\nand favorites that moved to it stay.",
        "operationId": "unmatch_edition_file",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "track_id",
            "in": "path",
            "description": "Local track id of the file",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expected_identity_revision",
            "in": "query",
            "description": "The `identity_revision` the edition status or plan showed.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The album's edition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionStatusView"
                }
              }
            }
          },
          "400": {
            "description": "No revision given",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, not one of its files, or no match to undo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The edition or the match changed since (STALE_REVISION), or the app has written the file since",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/leave-unmanaged": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Leave the album unmanaged: its exact edition goes (the release group\nstays as the person's choice) and Library Management leaves its files\nalone until \"Manage it again\". Undo with `.../edition/undo`.",
        "operationId": "leave_unmanaged",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeaveUnmanagedBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The album's edition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionStatusView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album's edition changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/plan": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "What taking an edition would do: which files keep their place, which\nare second copies, other versions or extras, and which edition tracks\nare missing. Asks MusicBrainz for the release; changes nothing. The\nalbum's own edition is open to every signed-in user; planning another\nrelease is for curators, who can choose it.",
        "operationId": "plan_edition",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "release_mbid",
            "in": "query",
            "description": "Any MusicBrainz release; the album's current edition when absent.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionPlanView"
                }
              }
            }
          },
          "400": {
            "description": "Bad release id, or the album has no edition to plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required to plan another release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, or MusicBrainz does not know the release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz is not answering",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/tags": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview the album's edition's tags in its files: the files placed on a\ntrack of the edition, with the tags the album folder's profile writes\n(its fields, scripts, overrides, artwork and lyrics). Nothing is\nrenamed or moved. Planning runs in the background; read the job until\nit is ready, then apply it.",
        "operationId": "create_edition_tags",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditionTagsBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The tag write, queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionTagsQueuedView"
                }
              }
            }
          },
          "400": {
            "description": "The folder's profile cannot be used",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The edition changed (STALE_REVISION); the album has no edition from MusicBrainz, is left unmanaged, is still being placed, spans two folders or is written by itself; no file sits on the edition; the profile writes no tags; or the Library Management settings cannot be read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/tags/{job_id}": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "One of the album's tag writes, or the undo of one, that the caller\nmade; an admin reads any.",
        "operationId": "get_edition_tags",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "job_id",
            "in": "path",
            "description": "The tag write's job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tag write",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionTagsJobView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown tag write, or another curator's",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/tags/{job_id}/apply": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Write a planned tag write, or put an earlier one back with its undo.\nThe files are written in the background.",
        "operationId": "apply_edition_tags",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "job_id",
            "in": "path",
            "description": "The tag write's job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditionTagsApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Writing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionTagsJobView"
                }
              }
            }
          },
          "400": {
            "description": "Wrong token, another curator's tag write, or no request key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown tag write, or another curator's",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Expired, changed since it was planned, or nothing to write",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/tags/{job_id}/undo": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Plan putting a written tag write back, as a job read and applied like\nthe write itself.",
        "operationId": "undo_edition_tags",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "job_id",
            "in": "path",
            "description": "The written tag write's job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditionTagsUndoBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The undo, queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionTagsQueuedView"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown tag write, or another curator's",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not written, already undone, changed since the page loaded, or the Library Management settings cannot be read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/edition/undo": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Take back the album's last edition change.",
        "operationId": "undo_edition",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditionRevisionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The album's edition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionStatusView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required, or admin role to undo \"Leave this album unmanaged\" (FORBIDDEN)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No change to take back",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The edition changed since it was read, or again since the change (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/history": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "What the app did by itself to the album, its tracks and the albums it\nis made of, and the undos of those changes.",
        "operationId": "get_album_history",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The album's history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumHistoryView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/looks-wrong": {
      "put": {
        "tags": [
          "library management"
        ],
        "summary": "\"Looks wrong\": mark the album's match as looking wrong, so curators\ncheck it, or take your own mark back. Each person's mark is their own.",
        "operationId": "mark_looks_wrong",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LooksWrongBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The caller's mark",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LooksWrongView"
                }
              }
            }
          },
          "400": {
            "description": "No `looks_wrong` given",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "library management"
        ],
        "summary": "A curator finds nothing wrong with the album's match: every \"Looks\nwrong\" mark on it goes. Choosing, confirming or handing back its\nedition clears them too.",
        "operationId": "clear_looks_wrong",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No mark is left"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/management/hand-back": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Have DroppedNeedle manage an album again after it stepped back from it\nbecause the files were changed outside. The files are then retagged and\nrenamed from the album's edition, which overwrites those changes.",
        "operationId": "hand_back_management",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id or release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Hand-back answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandBackResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Album not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album's files could not be read; it stays unmanaged",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/management/re-enable": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Let library management change an album again after it was excluded.",
        "operationId": "reenable_management",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id or release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReenableBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Re-enable answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReenableResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Album not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The exclusion changed; reload and retry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/reidentification/releases": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Search MusicBrainz releases for an album's edition finder.",
        "operationId": "search_reidentification_releases",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "title",
            "in": "query",
            "description": "Release title; required unless `release_group_mbid` is given.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist",
            "in": "query",
            "description": "Artist name; blank searches every artist.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "release_group_mbid",
            "in": "query",
            "description": "List every release of this release group instead of searching by\ntitle, so any edition of the album can be chosen.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 12 (default 12); more is read as 12.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of releases",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseEditionSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing title or bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz is unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/removals": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "List the album's removals whose files are still in the recycle bin:\nwhole albums, single tracks and extras, newest first.",
        "operationId": "list_album_removals",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id or release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removals that can be put back",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumRemovalsView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/removals/{removal_id}/put-back": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Put back the files one removal moved to the recycle bin, and list\ntheir tracks again with their plays and favourites. Another file at a\nfile's old place refuses the whole put-back; a copy gone from the bin\nis named and the rest come back.",
        "operationId": "put_back_removal",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id or release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "removal_id",
            "in": "path",
            "description": "The removal's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Files put back and indexed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutBackView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, or nothing left to put back",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Another file now sits at an old path, a file or track changed, none of the files are left in the recycle bin, the library is busy, or the library is off; nothing was put back",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "The files could not be put back; they stay in the recycle bin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/rescan": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Rescan the folders holding one album's files.",
        "operationId": "rescan_album",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id or release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Rescan requested",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumRescanResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Album not found or has no files",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The library could not start a scan, or the library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/reset-grouping": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Hand an album's tracks back to automatic grouping.",
        "operationId": "apply_grouping_reset",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Reset applied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogCorrectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad selection or token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album or track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The preview expired or the album changed since",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/reset-grouping-preview": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview handing an album's tracks back to automatic grouping.",
        "operationId": "preview_grouping_reset",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipPreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Where the tracks would land",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "No tracks, a track from another album, or nothing grouped by hand",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album or track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album changed since the page loaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/split": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Split selected tracks off an album into a new album (or into the target).",
        "operationId": "apply_album_split",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Split applied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogCorrectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad selection or token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, track or target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The preview expired or the albums changed since",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/split-preview": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview splitting selected tracks off an album.",
        "operationId": "preview_album_split",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipPreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "What the split would do",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "No tracks, a track from another album, or nothing left behind",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, track or target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album changed since the page loaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{album_id}/undo-automatic-edition": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Undo the album's last automatic edition: the identity it replaced comes\nback, or the album goes to review when there was none. Pins stay.",
        "operationId": "undo_automatic_edition",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomaticEditionUndoBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "What the undo did",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomaticEditionUndoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No reversible automatic edition",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The identity changed since the automatic acceptance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{id}": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One catalog album.",
        "operationId": "get_album",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumDetailView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "library management"
        ],
        "summary": "Remove an album from the library. With `delete_files` its files move\ninto the recycle bin; nothing is deleted outright. Its pending download\nretries, held files and blocklist entries go, and its wanted watch\nstops (or, with `stop_wanted=false`, looks for a replacement).",
        "operationId": "remove_album",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The album's local id, as its detail shows it",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expected_revision",
            "in": "query",
            "description": "The album's `row_revision` as the person saw it. Another revision\nanswers STALE_REVISION and nothing moves.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "expected_listing_revision",
            "in": "query",
            "description": "The album's `listing_revision` as the person saw it. It moves when\nthe album is renamed or a track joins or leaves it; another revision\nanswers STALE_REVISION and nothing moves.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "delete_files",
            "in": "query",
            "description": "Move the album's files into the recycle bin too. Off by default:\nthe album only leaves the catalog.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "stop_wanted",
            "in": "query",
            "description": "Stop the album's wanted watch (default). False keeps looking for a\nreplacement: a fulfilled watch starts watching again.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemovalResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Album not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album or its tracks changed since the values sent, the library is busy or off, or a file is outside the library folders",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "A file could not be recycled; nothing changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{id}/artwork": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "An album's own art: the folder image or embedded picture the library\nscan found. Never reaches out to the network. Pass the album's\n`cover_version` as `v`: a matching version is cached for good, an older\none revalidates.",
        "operationId": "album_artwork",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "v",
            "in": "query",
            "description": "Art version the caller holds",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "250, 500, 1200, or original (the default) for full size",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes"
          },
          "304": {
            "description": "Image unchanged"
          },
          "400": {
            "description": "Bad query string or unsupported size",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The album has no local art"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{id}/contributions": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Start (or reopen) the contribution for one local album.",
        "operationId": "create_contribution",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The album's active contribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Album not found or has no indexed tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album already has an exact release, or changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{id}/copies": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "Other local albums sharing the album's release group.",
        "operationId": "list_album_copies",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sibling albums",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumPage"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{id}/status": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "What the library holds for one album, by local id or MusicBrainz id,\nwith each track's quality tier against the upgrade cutoff.",
        "operationId": "album_status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local album id, or a release-group or release mbid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryAlbumStatus"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/albums/{id}/tracks": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One page of an album's streamable tracks.",
        "operationId": "list_album_tracks",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-1000. Default 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Page start. Default 0.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Track page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artist-repairs/{repair_id}/undo": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Undo the repair that gave an album left on \"Unknown Artist\" the artist\nits tracks are credited to: the album's earlier artist and credits come\nback, and the cleanup leaves it on them.",
        "operationId": "undo_artist_repair",
        "parameters": [
          {
            "name": "repair_id",
            "in": "path",
            "description": "The history entry's undo_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The album's earlier artist is back"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No artist repair that can be undone",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The album's artist changed since the repair",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One page of catalog artists.",
        "operationId": "list_artists",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-200. Default 50.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The `next` of the page before, with the same scope, sort and\norder. Absent for the first page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Default `name`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ArtistListSort"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Default `asc`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListOrder"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Name substring filter, case folded.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Default `all`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ArtistListScope"
            }
          },
          {
            "name": "min_tracks",
            "in": "query",
            "description": "Only artists with at least this many indexed tracks in the library,\n1-10000: the tracks credited to them and the tracks on the albums\nthey lead, each once. The scope totals count the same artists. See\n`tracks_mode`.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "tracks_mode",
            "in": "query",
            "description": "Default `at_least`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TracksMode"
            }
          },
          {
            "name": "rating",
            "in": "query",
            "description": "Only artists the caller rated, 1-5 stars. See `rating_mode`;\nartists they did not rate are left out.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "rating_mode",
            "in": "query",
            "description": "Default `at_least`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RatingMode"
            }
          },
          {
            "name": "favorites",
            "in": "query",
            "description": "Only the caller's favourites. Without `sort`, the newest favourite\ncomes first, and `order=asc` puts the oldest first.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Artist page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/duplicate-groups": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "List duplicate artist groups, sorted by name.",
        "operationId": "list_artist_duplicate_groups",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100 (default 50); more is read as 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ArtistGroupState"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Matches the group name or any member's name.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of groups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistDuplicateGroupListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/duplicate-groups/{group_id}": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "One duplicate artist group with its evidence, albums, and tracks.",
        "operationId": "get_artist_duplicate_group",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "description": "Group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Group detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistDuplicateGroupDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The group no longer exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/duplicate-groups/{group_id}/dismiss": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Mark a group's records as distinct people. The group comes back if any\nmember changes or another record with the name appears.",
        "operationId": "dismiss_artist_duplicate_group",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "description": "Group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArtistDuplicateGroupDismissRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Group dismissed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistDuplicateGroupDismissResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad body, or the group was merged automatically",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "The group no longer exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "A member changed since the group was read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/duplicate-groups/{group_id}/undo": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Undo a join of records made because they share a name: each record\ncomes back with its songs, plays, favorites and ratings, less what\nchanged since, and the records are marked as different artists.",
        "operationId": "undo_artist_duplicate_group",
        "parameters": [
          {
            "name": "group_id",
            "in": "path",
            "description": "Group id of a resolved join",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Join undone",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistDuplicateGroupUndoResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No such group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not a join that can be undone, or undone already",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/merge": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Fold duplicate artists into one survivor.",
        "operationId": "apply_artist_merge",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArtistMergeApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Artists merged",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogCorrectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad selection or token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or already merged artist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The preview expired or an artist changed since",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/merge-preview": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview folding duplicate artists into one survivor.",
        "operationId": "preview_artist_merge",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArtistMergePreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "What the merge would move",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistMergePreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "No duplicate chosen, or a reserved artist would be merged away",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or already merged artist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "An artist changed since the page loaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/reconciliation": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Automatic artist merges so far and open group counts.",
        "operationId": "artist_reconciliation",
        "responses": {
          "200": {
            "description": "Progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistReconciliationProgress"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/{id}": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One catalog artist.",
        "operationId": "get_artist",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local artist id or linked MusicBrainz artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Artist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown artist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/{id}/albums": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One page of albums led by the artist.",
        "operationId": "list_artist_albums",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local artist id or linked MusicBrainz artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-1000. Default 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The `next` of the page before. Absent for the first page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Led albums",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown artist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/{id}/appearances": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One page of albums where the artist appears without leading.",
        "operationId": "list_artist_appearances",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local artist id or linked MusicBrainz artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-1000. Default 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The `next` of the page before. Absent for the first page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Appearance albums",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown artist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/{id}/artwork": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "A library artist's picture, a mosaic of the art of their own albums.",
        "description": "For artists the library holds with no MusicBrainz link, which have no\npicture of their own. Never reaches out to the network. Albums under\nthe artist's name with the newest release come first, studio albums\nbefore compilations. Four or more covers give a 2x2 of the first four,\ntwo or three the first two crosswise, and one that cover alone. A\nmosaic is a JPEG; full size draws it at 1200 pixels.",
        "operationId": "library_artist_artwork",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "250, 500, 1200, or original (the default) for full size",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes"
          },
          "304": {
            "description": "Image unchanged"
          },
          "400": {
            "description": "Bad query string or unsupported size",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "None of the artist's albums has art"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/artists/{id}/musicbrainz-link": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "An artist's MusicBrainz link: the id, who set it and when.",
        "operationId": "get_artist_link",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The artist's link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistLinkView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown artist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "library management"
        ],
        "summary": "Link an artist to a MusicBrainz artist by hand. The app's own linking\nnever changes it. Refused when another artist in the library is that\nMusicBrainz artist, or when artists of its name would then be joined:\nan admin merges them instead.",
        "operationId": "set_artist_link",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetArtistLinkBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The artist's link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistLinkView"
                }
              }
            }
          },
          "400": {
            "description": "Not a MusicBrainz artist id, or a special-purpose one (ARTIST_MBID_INVALID, ARTIST_MBID_SPECIAL)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown artist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The artist changed since it was read (STALE_REVISION), cannot be linked (ARTIST_NOT_LINKABLE), other artists are that MusicBrainz artist (ARTIST_LINK_SHARED), or artists of its name would then be joined (ARTIST_LINK_JOINS_NAMESAKES); either lists them in details.artists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "library management"
        ],
        "summary": "Clear an artist's hand-set link. The app then links the artist again\nwhere its albums and files prove one. Refused when that would make it\nthe same MusicBrainz artist as another in the library, or join artists\nof its name.",
        "operationId": "clear_artist_link",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expected_revision",
            "in": "query",
            "description": "The `artist_revision` as last read.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The artist's link after the clear",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistLinkView"
                }
              }
            }
          },
          "400": {
            "description": "No revision given",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown artist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The artist changed since it was read (STALE_REVISION), has no hand-set link (ARTIST_LINK_NOT_CHOSEN), would be the same MusicBrainz artist as others (ARTIST_LINK_SHARED), or artists of its name would then be joined (ARTIST_LINK_JOINS_NAMESAKES); either lists them in details.artists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/musicbrainz/callback": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Where the MusicBrainz release editor sends the curator back. Public:\nthe one-time token identifies the contribution. Every outcome is a 303\nto the web app: the contribution page on success, the library page\nwith `musicbrainz=callback-error` otherwise.",
        "operationId": "musicbrainz_callback",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "description": "The one-time token the seed carried.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "release_mbid",
            "in": "query",
            "description": "The release MusicBrainz created.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "303": {
            "description": "Redirect to the contribution or library page"
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/library/contributions/{id}": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Read one contribution.",
        "operationId": "get_contribution",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/cancel": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Cancel a contribution.",
        "operationId": "cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributionRevisionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Cancelled contribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Already closed, or changed since read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/discogs/remove": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Drop the Discogs source and its values.",
        "operationId": "remove_discogs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributionRevisionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated contribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Changed since read, or no longer editable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/discogs/search": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Search Discogs releases for this contribution.",
        "operationId": "search_discogs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscogsSearchBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Candidate releases",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscogsSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Query too short or too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The contribution is closed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Discogs unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/discogs/select": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Use a Discogs release as the source.",
        "operationId": "select_discogs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscogsSelectBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated contribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "400": {
            "description": "Not a Discogs release ID or URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution or Discogs release not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Changed since read, or no longer editable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Discogs unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/draft": {
      "put": {
        "tags": [
          "library management"
        ],
        "summary": "Save the edited draft.",
        "operationId": "update_draft",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributionDraftBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated contribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "400": {
            "description": "Invalid draft value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Changed since read, or no longer editable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/musicbrainz/attach": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Link the album to a release already on MusicBrainz.",
        "operationId": "attach_existing",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachExistingBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Linked contribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution or release not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not in the duplicate result, or does not match safely",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/musicbrainz/duplicates": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Check MusicBrainz for releases this would duplicate.",
        "operationId": "check_duplicates",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DuplicateCheckBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contribution with the duplicate result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Draft incomplete, source expired, or changed since read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/musicbrainz/result": {
      "put": {
        "tags": [
          "library management"
        ],
        "summary": "Record the release MusicBrainz created, by hand.",
        "operationId": "record_result",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MusicBrainzResultBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contribution, now verifying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "400": {
            "description": "Not a release MBID or URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not waiting for a result, or a different one exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/musicbrainz/seed": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Build the form that opens the seeded MusicBrainz release editor. The\nbrowser POSTs it; MusicBrainz sends the curator back to the callback.",
        "operationId": "create_seed",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributionRevisionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Release editor form",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicBrainzSeed"
                }
              }
            }
          },
          "400": {
            "description": "The public server address is not usable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Duplicate check missing or found an exact release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/musicbrainz/verify": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Queue the recorded release for verification again.",
        "operationId": "retry_verification",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributionRevisionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Contribution, now verifying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Nothing to verify, or changed since read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/contributions/{id}/rebuild": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Rebuild a stale contribution from the album's current files.",
        "operationId": "rebuild",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Contribution id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributionRevisionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The new draft",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionRecord"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Contribution or album not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not stale, or changed since read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/decades": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "Decade shelves, oldest first.",
        "operationId": "list_decades",
        "responses": {
          "200": {
            "description": "Decades",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DecadesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/duplicates": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Albums the library holds more than once, a page of groups at a time.",
        "operationId": "list_duplicate_albums",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "The previous page's `next_cursor`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Groups per page, 1 to 100 (50 by default); more is read as 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of duplicate groups",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_DuplicateGroupView"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/folds/{fold_id}/undo": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Undo the fold of a leftover album, or the join of a copy of the album's\nedition: the album, its files and its earlier match come back. Plays,\nfavorites and playlist entries moved to the album that kept the files\nstay there.",
        "operationId": "undo_album_fold",
        "parameters": [
          {
            "name": "fold_id",
            "in": "path",
            "description": "The history entry's undo_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The album is back"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No fold or join that can be undone",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The albums changed since the fold or join",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/identification/pause": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Pause identification. A job already running finishes first.",
        "operationId": "pause_identification",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentificationControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Queue state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentificationControlResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The switch changed since it was read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/identification/resume": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Resume identification.",
        "operationId": "resume_identification",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentificationControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Queue state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentificationControlResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The switch changed since it was read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/identity-repairs": {
      "get": {
        "tags": [
          "library management"
        ],
        "operationId": "list_repairs",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, at most 50; more is read as 50.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Repair jobs, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "library management"
        ],
        "operationId": "create_repair",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RepairCreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The repair job (new, or the one this key started)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The idempotency key started another kind of job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/identity-repairs/estimate": {
      "get": {
        "tags": [
          "library management"
        ],
        "operationId": "estimate_repair",
        "parameters": [
          {
            "name": "root_id",
            "in": "query",
            "description": "Library roots; none means every root",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "Estimate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepairEstimateView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/identity-repairs/{job_id}/apply": {
      "post": {
        "tags": [
          "library management"
        ],
        "operationId": "apply_repair",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Repair job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RepairApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Applying in the background",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Confirmation missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown repair job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The report changed since it was read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/identity-repairs/{job_id}/findings": {
      "get": {
        "tags": [
          "library management"
        ],
        "operationId": "repair_findings",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Repair job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 200 (default 100); more is read as 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "finding_category",
            "in": "query",
            "description": "Repairs: `valid`, `safe_detach`, `needs_review`, `unverifiable`,\n`manual_identity`. Preparations: `ready`, `mapping_ready`,\n`exact_release_required`, `exact_release_auto_accepted`,\n`needs_review`, `unverifiable`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Findings, newest change first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepairFindingListView"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor or category",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown repair job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/manage/plugin-files": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "The files one plugin added to the library, newest first.",
        "operationId": "list_plugin_files",
        "parameters": [
          {
            "name": "plugin",
            "in": "query",
            "description": "Plugin name.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Files per page, 1 to 100 (default 50); more is read as 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the plugin's files",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_PluginFileView"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/manage/undo": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Undo one published bundle as a new operation.",
        "operationId": "manage_undo",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManageUndoBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Undo answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManageUndoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing bundle id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown bundle id, or one a curator did not apply",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Undo blocked for a file, a Library Management run's change (undone from History), or the library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/automatic/skipped": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Albums automatic management skipped, newest first, each with why.",
        "operationId": "list_management_automatic_skipped",
        "responses": {
          "200": {
            "description": "Skipped albums",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementSkippedPage"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/baselines/purge": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Delete every saved original for good.",
        "operationId": "purge_management_baselines",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementPurgeBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Originals purged",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPurgeView"
                }
              }
            }
          },
          "400": {
            "description": "Confirmation missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The impact changed, or a restore or write is running",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/baselines/purge-impact": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "What a purge of the saved originals would remove.",
        "operationId": "get_management_purge_impact",
        "responses": {
          "200": {
            "description": "Purge impact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPurgeImpactView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/baselines/restore-previews": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview putting the selected albums back to their originals.",
        "operationId": "create_management_restore_preview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementRestorePreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Preview queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPreviewCreatedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid selection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Settings or library folders changed, or the library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/duplicate-resolution-previews": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview settling one file whose destination is taken.",
        "operationId": "create_management_duplicate_preview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementDuplicateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Preview queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPreviewCreatedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown preview or file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The preview or settings changed, or the library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/hand-back": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Have DroppedNeedle manage every album again that it stepped back from.\nThe albums are handed back one after another in the background; until\nits turn comes an album stays left unmanaged.",
        "operationId": "hand_back_all",
        "responses": {
          "200": {
            "description": "Albums waiting to be handed back",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandBackAllResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/identity-preparations": {
      "get": {
        "tags": [
          "library management"
        ],
        "operationId": "list_preparations",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, at most 50; more is read as 50.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preparation jobs, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "library management"
        ],
        "operationId": "create_preparation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreparationCreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The preparation job (new, or the one this key started)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The idempotency key started another kind of job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/identity-preparations/estimate": {
      "get": {
        "tags": [
          "library management"
        ],
        "operationId": "estimate_preparation",
        "parameters": [
          {
            "name": "root_id",
            "in": "query",
            "description": "Library roots; none means every root",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "Estimate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreparationEstimateView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/identity-preparations/{job_id}/apply": {
      "post": {
        "tags": [
          "library management"
        ],
        "operationId": "apply_preparation",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Preparation job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RepairApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Applying in the background",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Confirmation missing, or the report used older rules",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown preparation job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The report changed since it was read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/identity-preparations/{job_id}/discard": {
      "post": {
        "tags": [
          "library management"
        ],
        "operationId": "discard_preparation",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Preparation job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OperationControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Dismissed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown preparation job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The report changed since it was read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/identity-preparations/{job_id}/findings": {
      "get": {
        "tags": [
          "library management"
        ],
        "operationId": "preparation_findings",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Preparation job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 200 (default 100); more is read as 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "finding_category",
            "in": "query",
            "description": "Repairs: `valid`, `safe_detach`, `needs_review`, `unverifiable`,\n`manual_identity`. Preparations: `ready`, `mapping_ready`,\n`exact_release_required`, `exact_release_auto_accepted`,\n`needs_review`, `unverifiable`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Findings that still describe their album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepairFindingListView"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor or category",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown preparation job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/operations": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Management history, newest first.",
        "operationId": "list_management_operations",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Rows per page, 1 to 50 (default 50); more is read as 50.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "profile_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "root_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "created_to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "format": "double"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "History page, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_ManagementHistoryItemView"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/operations/{job_id}": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "One management operation.",
        "operationId": "get_management_operation",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Management job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementJobView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/operations/{job_id}/results": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "A page of an applied operation's files with their outcome.",
        "operationId": "list_management_operation_results",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Management job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Files per page, 1 to 200 (default 100); more is read as 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Only the files that change, or only the others; all when absent.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Which planned files a list shows, by whether they change.",
              "enum": [
                "changing",
                "not_changing"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_ManagementResultItemView"
                }
              }
            }
          },
          "400": {
            "description": "Bad scope or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/operations/{job_id}/undo-preview": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview undoing an applied operation. Apply the undo preview like any\nother.",
        "operationId": "create_management_undo_preview",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Management job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementUndoPreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Undo preview queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPreviewCreatedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Not a finished apply, nothing to undo, or the library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/previews": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Make a management preview. Planning runs in the background; poll the\npreview until it is ready.",
        "operationId": "create_management_preview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementPreviewCreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Preview queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPreviewCreatedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad selection, profile or destination",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Settings or library policy changed since the page loaded, or the library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/previews/{job_id}": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "One preview with its summary.",
        "operationId": "get_management_preview",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Management job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementJobView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/previews/{job_id}/apply": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Apply a ready preview: its albums are written one at a time in the\nbackground. Watch the operation for progress.",
        "operationId": "apply_management_preview",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Management job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Apply queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Not confirmed, or wrong token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Preview expired, stale, or nothing to write, or the library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/previews/{job_id}/discard": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Set a preview aside without changing any file.",
        "operationId": "discard_management_preview",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Management job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementDiscardBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Discarded preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementJobView"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Stale revision or already applying",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/previews/{job_id}/items": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "A page of the files a preview planned.",
        "operationId": "list_management_preview_items",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Management job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Files per page, 1 to 200 (default 100); more is read as 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "eligibility",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Eligibility"
            }
          },
          {
            "name": "reason_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "root_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "album_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_id",
            "in": "query",
            "description": "Files on albums by or credited to this local artist.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "audio_format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "change_kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "What a planned file changes, to filter by.",
              "enum": [
                "tags",
                "path",
                "sidecars",
                "artwork",
                "no_change"
              ]
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Only the files that change, or only the others; all when absent.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Which planned files a list shows, by whether they change.",
              "enum": [
                "changing",
                "not_changing"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Planned files",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_ManagementPlanItemView"
                }
              }
            }
          },
          "400": {
            "description": "Bad filter or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/previews/{job_id}/items/{ordinal}/artwork/{sha256}": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "The cover art one planned file embeds or writes, as the preview lists\nit by hash.",
        "operationId": "get_management_preview_artwork",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Management job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ordinal",
            "in": "path",
            "description": "Planned file ordinal",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sha256",
            "in": "path",
            "description": "Artwork hash from artwork_choices",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The planned image",
            "content": {
              "image/jpeg": {}
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job, file or artwork",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/previews/{job_id}/reissue": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "A new confirmation token for your own ready preview.",
        "operationId": "reissue_management_preview",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Management job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "New token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPreviewReissueResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required, or another administrator's preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Preview no longer ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/recovery/diagnostics": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "What the publish journal holds, and the writes that need you.",
        "operationId": "get_management_recovery_diagnostics",
        "responses": {
          "200": {
            "description": "Journal diagnostics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementRecoveryView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/recovery/import-bundles/{bundle_id}/resolve": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Close a write that needs attention once its files check out. Nothing\non disk changes.",
        "operationId": "resolve_management_bundle",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "description": "Publish bundle id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Write closed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementResolveView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown write",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "A file is missing or different, or the write needs no attention",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/tag-edit-previews": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview a tag edit; apply it like any preview.",
        "operationId": "create_management_tag_edit_preview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementTagEditPreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Preview queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPreviewCreatedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid edit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Settings or library folders changed, or the library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/takeovers": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Albums left unmanaged because their files were changed outside\nDroppedNeedle and that nobody has handed back yet, newest first.",
        "operationId": "list_management_takeovers",
        "responses": {
          "200": {
            "description": "Albums left unmanaged",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementTakeoverPage"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/management/tracks/{track_id}/tag-editor": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "The tag editor for one file.",
        "operationId": "get_management_tag_editor",
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "description": "Library track id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file's tags",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementTagEditorView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The file cannot be read now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/membership": {
      "post": {
        "tags": [
          "library"
        ],
        "summary": "Which MusicBrainz album ids the library holds or has requested.",
        "operationId": "membership",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryMembershipRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Owned and requested ids",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryMembershipResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad body or more than 500 ids",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/operations/{job_id}/pause": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Pause a job. A running job pauses at its next checkpoint.",
        "operationId": "pause_operation",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Operation job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OperationControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Operation job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Stale revision or reused idempotency key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/operations/{job_id}/resume": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Resume a paused or stopped job, or one that failed while MusicBrainz\nwas down.",
        "operationId": "resume_operation",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Operation job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OperationControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Operation job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Stale revision or reused idempotency key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/operations/{job_id}/stop": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Stop a job. A running job stops at its next checkpoint.",
        "operationId": "stop_operation",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Operation job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OperationControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Operation job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Stale revision or reused idempotency key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/recently-added": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "Newest albums first, capped.",
        "operationId": "list_recently_added",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Card cap, 1-50. Default 20.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent albums",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlbumPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/recycle-bin": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "List what the recycle bin holds, grouped by the removal or change\nthat put it there, newest first.",
        "operationId": "list_recycle_bin",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "The previous page's `next_cursor`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page, 1 to 100 (50 by default); more is read as 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of the recycle bin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecycleBinPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/recycle-bin/accept-folder": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Use the folder the recycle bin path names as the bin.",
        "description": "For when the app finds it is not the folder used before, because the\nbin was moved. It is marked as the bin, and removals and upgrades go\nahead. Nothing is written when it already holds the marker.",
        "operationId": "accept_recycle_bin_folder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptRecycleBinFolderBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "The folder is the recycle bin"
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The path changed, the saved folder can't be used as the bin now, or it can't be written to",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/recycle-bin/empty": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Empty the recycle bin of what it held at `before`, under the rules\nits expiry keeps: a copy that changed in the bin, one a put-back is\nusing, and one in a bin that is or holds a library or download folder\nstay. Runs in the background. Refused while the library is off.",
        "operationId": "empty_recycle_bin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRecycleBinBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Emptying started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmptyRecycleBinView"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/recycle-bin/status": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Whether the recycle bin is being emptied, and what the last run did.",
        "operationId": "recycle_bin_status",
        "responses": {
          "200": {
            "description": "Emptying state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecycleBinStatus"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/recycle-bin/summary": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Count what emptying the recycle bin now would delete, for its\nconfirm.",
        "operationId": "recycle_bin_summary",
        "responses": {
          "200": {
            "description": "What Empty would delete",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecycleBinSummary"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/resolve-tracks": {
      "post": {
        "tags": [
          "library"
        ],
        "summary": "Resolve track positions to playable local files.",
        "operationId": "resolve_tracks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveTracksRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Resolved positions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveTracksResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/retag-pairs": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "List album rows that look like one retagged album and wait for a\nperson to join or dismiss them.",
        "operationId": "list_retag_pairs",
        "parameters": [
          {
            "name": "album_id",
            "in": "query",
            "description": "Only the pairs naming this album, as their old or new album.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100 (default 100); more is read as 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of open pairs, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_RetagPairView"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/retag-pairs/{old_album_id}/{new_album_id}/dismiss": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Mark a retag pair as two different albums. A scan never joins it then,\nuntil its tracks are back on the old album.",
        "operationId": "dismiss_retag_pair",
        "parameters": [
          {
            "name": "old_album_id",
            "in": "path",
            "description": "The pair's old album",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "new_album_id",
            "in": "path",
            "description": "The pair's new album",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dismissed, or dismissed already",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetagPairDismissResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No such pair",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/retag-pairs/{old_album_id}/{new_album_id}/join": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Join a retag pair: the old album is merged into the new one. A custom\nedition on the old album is dropped, and so is the edition not kept\nwhen the two hold different chosen editions; each leaves a review on\nthe album that stays. No file is written.",
        "operationId": "join_retag_pair",
        "parameters": [
          {
            "name": "old_album_id",
            "in": "path",
            "description": "The pair's old album",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "new_album_id",
            "in": "path",
            "description": "The pair's new album",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RetagPairJoinBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Joined, or joined already",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetagPairJoinResponse"
                }
              }
            }
          },
          "400": {
            "description": "An album's revision is missing, or the edition to keep is missing, not needed or not one of the two",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No such pair",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The pair was dismissed, an album was merged, removed or changed its edition, or work is open on one",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Identification reviews, most recently changed first.",
        "operationId": "list_reviews",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "description": "`pending` (default), `approved`, `rejected`, `dismissed`,\n`excluded`, `resolved` (approved or dismissed) or `all`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "album_id",
            "in": "query",
            "description": "Only this album's reviews.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reason_code",
            "in": "query",
            "description": "Only reviews filed with this reason code.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Album title or artist contains this, ignoring case.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "root_id",
            "in": "query",
            "description": "Albums with a file in this library folder.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "policy",
            "in": "query",
            "description": "Albums with a file under this folder policy: `automatic`,\n`local_metadata` or `excluded`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "job_state",
            "in": "query",
            "description": "Albums with an identification job in this state: `queued`,\n`running`, `deferred`, `succeeded`, `failed` or `attention`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "exclude_active_jobs",
            "in": "query",
            "description": "Leave out albums whose identification is still queued or running.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "created_from",
            "in": "query",
            "description": "Filed at or after this time (Unix milliseconds).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "created_to",
            "in": "query",
            "description": "Filed at or before this time (Unix milliseconds).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "updated_from",
            "in": "query",
            "description": "Changed at or after this time (Unix milliseconds).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "updated_to",
            "in": "query",
            "description": "Changed at or before this time (Unix milliseconds).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "with_candidates",
            "in": "query",
            "description": "Only reviews that list at least one release.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Sort order; newest change first by default.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ReviewSort"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 200 (default 50); more is read as 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of reviews",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unknown state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/bulk-apply": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Apply a previewed bulk change as one background job that can be\npaused, resumed and stopped. Refused when the token is not the caller's\nor is too old, or the selection changed since the preview.",
        "operationId": "apply_bulk_reviews",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewBulkBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The job, and the reviews the preview left alone",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewBulkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unknown action or filter value, or no readable preview token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required (admin to exclude)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The preview is too old or another person's, or the selection changed since",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/bulk-preview": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview a bulk change: how many reviews it changes, which it skips and\nwhy, the releases every selected review shares, and the token that\napplies exactly this change. The token is good for 15 minutes, and only\nfor the person who previewed.",
        "operationId": "preview_bulk_reviews",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewBulkBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "What the change would do",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewBulkPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unknown action or filter value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required (admin to exclude)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/jobs": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Review jobs still running, queued or paused, and those that ended in\nthe last five minutes, newest first.",
        "operationId": "list_review_jobs",
        "responses": {
          "200": {
            "description": "Review jobs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewJobsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/jobs/{job_id}/control": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Pause, resume or stop a review job. A running job halts between\nreviews.",
        "operationId": "control_review_job",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Review job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewJobControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The review job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "400": {
            "description": "Bad body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "A stopped job can't be resumed (REVIEW_JOB_STOPPED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/retry-pending": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Start identification again for every pending review a filter selects\n(all of them by default), as one background job that can be paused,\nresumed and stopped. With `preview`, nothing starts: the answer counts\nwhat would start and why the rest would not.",
        "operationId": "retry_pending_reviews",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewRetryAllBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The job, or what would start",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewRetryAllResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unknown filter value, folder or sub-folder",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/{id}": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "One review with its candidates.",
        "operationId": "get_review",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Review id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/{id}/approve": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Approve a review with the curator's chosen candidate.",
        "operationId": "approve_review",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Review id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settled review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewResolveResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing candidate key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review or candidate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Review already settled, or changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/{id}/detach": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Take the album's MusicBrainz match off and keep its own tags. The\nalbum shows as unmatched, and the change can be undone from the album\nlike an edition choice.",
        "operationId": "detach_review",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Review id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewActionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settled review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Review already settled, or changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/{id}/dismiss": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Close a review without a decision. The album stays as it is.",
        "operationId": "dismiss_review",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Review id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewActionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settled review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Review already settled, or changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/{id}/exclude": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Take the album's files out of the library. Nothing is deleted; scans\nkeep the files out until the review is restored.",
        "operationId": "exclude_review",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Review id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewActionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settled review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Review already settled, or changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/{id}/keep-tagged": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Keep the album as tagged: nothing seals, and the review settles.",
        "operationId": "keep_tagged_review",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Review id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewActionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settled review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Review already settled, or changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/{id}/reopen": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Reopen a review whose tags were kept, or that was left for later: it\nwaits for a decision again. The album stays as it is.",
        "operationId": "reopen_review",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Review id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewActionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Reopened review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The review is not closed, or changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/{id}/restore": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Put an excluded album's files back into the library.",
        "operationId": "restore_review",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Review id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewActionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settled review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The review's album was not excluded, or the review changed since it was read (STALE_REVISION)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/reviews/{id}/retry": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Start identification again for the review's album. The new job\ncarries the decision, so the review is dismissed.",
        "operationId": "retry_review",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Review id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewRetryBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Re-identification job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown review id, or the album has no files",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Review already settled or changed since it was read (STALE_REVISION), album excluded (ALBUM_EXCLUDED), needs the Local metadata confirmation (LOCAL_METADATA_NEEDS_CONFIRMATION), keeps its own tags in a managed folder (LOCAL_METADATA_MANAGED), has an edition someone chose (EDITION_IS_CHOSEN), or the idempotency key started another album's job (CONTROL_KEY_REUSED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Request a scan by kind over chosen roots and path rules.",
        "operationId": "request_scan_run",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanRunRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Scan taken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanRunRequestedResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad body or unknown scope id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Library disabled or library policy changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs/current": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "The run holding the scan worker and the next queued one.",
        "operationId": "current_scan_runs",
        "responses": {
          "200": {
            "description": "Current runs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanRunCurrentResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs/estimate": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Roughly how many files a scan over the chosen scopes would read.",
        "operationId": "estimate_scan_run",
        "parameters": [
          {
            "name": "scope_ids",
            "in": "query",
            "description": "Root and path-rule ids; none means every root",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "explode": true
          }
        ],
        "responses": {
          "200": {
            "description": "Estimate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanEstimateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unknown scope id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs/history": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Finished runs, newest first, a page at a time.",
        "operationId": "scan_run_history",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Runs per page, 1 to 50; more is read as 50",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "History page, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_ScanRunView"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs/{id}": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Get one scan run with its scopes and discovered files.",
        "operationId": "get_run",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scan run id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Run detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown run id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs/{id}/diagnostics": {
      "get": {
        "tags": [
          "library management"
        ],
        "operationId": "scan_diagnostics",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scan run id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Redacted diagnostic report, as a JSON download",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad run id, or the report is over the 2 MB limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown scan run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs/{id}/failures": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Paths one run could not read or index, oldest first.",
        "operationId": "scan_run_failures",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scan run id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Rows per page, 1 to 200; more is read as 200",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Failed paths, oldest first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_ScanRunFailureItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown run id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs/{id}/pause": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Pause a running scan at its next checkpoint.",
        "operationId": "pause_scan_run",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scan run id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Run after the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanControlResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown run id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Run changed, or cannot pause in its state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs/{id}/resume": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Resume a paused scan where it stopped.",
        "operationId": "resume_scan_run",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scan run id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Run after the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanControlResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown run id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Run changed, or is not paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/scan/runs/{id}/stop": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Stop a scan. What it already indexed stays.",
        "operationId": "stop_scan_run",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Scan run id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanControlBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Run after the request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanControlResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown run id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Run changed, or already finished",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/stats": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "Library totals plus the caller's favorite counts.",
        "operationId": "get_stats",
        "responses": {
          "200": {
            "description": "Library totals",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatsView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/suggestions": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "Reason-tagged track suggestions.",
        "operationId": "list_suggestions",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Track cap, 1-40. Default 12.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "decade",
            "in": "query",
            "description": "Era anchor for the `same_era` pool, e.g. 1990.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Suggestions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuggestionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/tracks": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "One page of streamable tracks.",
        "operationId": "list_tracks",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-500. Default 50.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The `next` of the page before, with the same sort and order.\nAbsent for the first page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Default `title`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TrackListSort"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Default `asc`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ListOrder"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Title/artist/album substring filter, case folded.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "album_id",
            "in": "query",
            "description": "Restrict to one album.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_id",
            "in": "query",
            "description": "Restrict to one credited artist.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "genre",
            "in": "query",
            "description": "Restrict to one genre tag, case folded.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "formats",
            "in": "query",
            "description": "Track formats, comma-separated, e.g. `flac,mp3`; matching is\ncase-insensitive. See `format_mode`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format_mode",
            "in": "query",
            "description": "Default `with`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/FormatMode"
            }
          },
          {
            "name": "rating",
            "in": "query",
            "description": "Only tracks the caller rated, 1-5 stars. See `rating_mode`; tracks\nthey did not rate are left out.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "rating_mode",
            "in": "query",
            "description": "Default `at_least`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RatingMode"
            }
          },
          {
            "name": "favorites",
            "in": "query",
            "description": "Only the caller's favourites. Without `sort`, the newest favourite\ncomes first, and `order=asc` puts the oldest first.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Track page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackListPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/tracks/move": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Move selected tracks onto the target album.",
        "operationId": "apply_track_move",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipApplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Move applied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogCorrectionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad selection or token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, track or target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The preview expired or the albums changed since",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/tracks/move-preview": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Preview moving selected tracks onto the target album.",
        "operationId": "preview_track_move",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembershipPreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "What the move would do",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembershipPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "No tracks, no target, or the tracks are already there",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown album, track or target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "An album changed since the page loaded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/library/tracks/{id}": {
      "delete": {
        "tags": [
          "library management"
        ],
        "summary": "Remove one track. Its file moves into the recycle bin unless\n`delete_file=false`.",
        "operationId": "remove_track",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local track id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expected_revision",
            "in": "query",
            "description": "The track's `row_revision` as the person saw it. Another revision\nanswers STALE_REVISION and nothing moves.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "delete_file",
            "in": "query",
            "description": "Move the track's file into the recycle bin too. On by default.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Track removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemovalResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Curator role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Track not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The track changed since the revision sent, the library is busy or off, or the file is outside the library folders",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "The file could not be recycled; nothing changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "curator"
            ]
          }
        ]
      }
    },
    "/api/v3/library/tracks/{id}/lyrics": {
      "get": {
        "tags": [
          "library"
        ],
        "summary": "Stored lyrics for one track.",
        "operationId": "get_lyrics",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Local track id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lyrics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LyricsView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/library/unconfirmed": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "Albums whose match is a best guess waiting for a look (or, with\n`state=unmatched`, albums nothing fits). Newest first.",
        "operationId": "list_unconfirmed",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "description": "Default: `unconfirmed`.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Which albums the unconfirmed list shows.",
              "enum": [
                "unconfirmed",
                "unmatched",
                "looks_wrong"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 200 (default 50); more is read as 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` from the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of albums",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_WaitingAlbumView"
                }
              }
            }
          },
          "400": {
            "description": "Unknown state or bad cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Profile of the caller.",
        "operationId": "get_profile",
        "responses": {
          "200": {
            "description": "Own profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "users"
        ],
        "summary": "Change the caller's display name.",
        "operationId": "patch_profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisplayNameUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/app-passwords": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Caller's app passwords.",
        "operationId": "list_app_passwords",
        "responses": {
          "200": {
            "description": "Own app passwords",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppPasswordListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Create an app password. The secret returns once.",
        "operationId": "create_app_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppPasswordCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created (secret shown once)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppPasswordCreatedResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/app-passwords/{id}": {
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Revoke one own app password.",
        "operationId": "revoke_app_password",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "App-password id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/appearance": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Read your own theme and custom CSS, with the site's CSS.",
        "operationId": "get_my_appearance",
        "responses": {
          "200": {
            "description": "Own appearance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyAppearance"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Save your own theme or custom CSS. A field left out keeps its value,\nand a change any part of which is refused saves nothing.",
        "operationId": "put_my_appearance",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppearanceUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved appearance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyAppearance"
                }
              }
            }
          },
          "400": {
            "description": "The CSS is refused (`CUSTOM_CSS_REFUSED`, its problems in `details`) or too long (`CUSTOM_CSS_TOO_LONG`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Custom CSS is turned off on this server (`CUSTOM_CSS_TURNED_OFF`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/appearance/css-saves": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "List your last saves of your custom CSS, newest first.",
        "operationId": "list_my_css_saves",
        "responses": {
          "200": {
            "description": "Own CSS saves, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CssSave"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/appearance/import": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Move the theme and CSS this browser kept to your account, once. An\naccount that already holds them keeps its own and changes nothing.",
        "operationId": "import_my_appearance",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppearanceUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The appearance as stored, and whether this call wrote it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppearanceImported"
                }
              }
            }
          },
          "400": {
            "description": "The CSS is refused (`CUSTOM_CSS_REFUSED`, its problems in `details`) or too long (`CUSTOM_CSS_TOO_LONG`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Custom CSS is turned off on this server (`CUSTOM_CSS_TURNED_OFF`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/avatar": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Upload a new avatar from base64 bytes.",
        "operationId": "post_avatar",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvatarUploadBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/connect-apps": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Read your own Connect Apps choices.",
        "operationId": "get_my_connect_apps",
        "responses": {
          "200": {
            "description": "Own Connect Apps choices",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyConnectApps"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Save your own Connect Apps choices.",
        "operationId": "put_my_connect_apps",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MyConnectApps"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved choices",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyConnectApps"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/connections": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "The caller's linked accounts across every service.",
        "operationId": "me_list_connections",
        "responses": {
          "200": {
            "description": "Linked accounts",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkedAccounts"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/connections/lastfm": {
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Store the caller's own Last.fm API credentials.",
        "operationId": "lastfm_set_credentials",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LastFmCredentialsSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LastFmConfiguredResponse"
                }
              }
            }
          },
          "409": {
            "description": "Last.fm is switched off on this server (LASTFM_OFF)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "users"
        ],
        "summary": "Unlink Last.fm (drops credentials and session).",
        "operationId": "lastfm_unlink",
        "responses": {
          "204": {
            "description": "Unlinked"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/connections/lastfm/session": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Exchange an approved token for a linked session.",
        "operationId": "lastfm_session",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LastFmSessionExchange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Linked session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LastFmSessionResponse"
                }
              }
            }
          },
          "409": {
            "description": "Last.fm is switched off on this server (LASTFM_OFF), there is no key pair to sign with (PROVIDER_NOT_CONFIGURED), or the sign-in is not approved, expired or not started here (CONFLICT)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/connections/lastfm/token": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Fetch a Last.fm sign-in token plus approval URL.",
        "operationId": "lastfm_token",
        "responses": {
          "200": {
            "description": "Token and approval URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LastFmTokenResponse"
                }
              }
            }
          },
          "409": {
            "description": "Last.fm is switched off on this server (LASTFM_OFF), or there is no key pair to sign with (PROVIDER_NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/connections/listenbrainz": {
      "put": {
        "tags": [
          "listening"
        ],
        "summary": "Link the caller's ListenBrainz account. The credential verifies first;\nonly a verified pair stores.",
        "operationId": "connect_listenbrainz_route",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListenBrainzConnectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Link status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListeningLinkStatus"
                }
              }
            }
          },
          "400": {
            "description": "Username required or credential rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "ListenBrainz is rate-limiting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "listening"
        ],
        "summary": "Remove the caller's ListenBrainz link.",
        "operationId": "disconnect_listenbrainz_route",
        "responses": {
          "200": {
            "description": "Disconnect receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMessage"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/connections/spotify": {
      "delete": {
        "tags": [
          "imports"
        ],
        "summary": "Unlink the caller's Spotify account.\nIdempotent: no link reads as done too.",
        "operationId": "disconnect_spotify",
        "responses": {
          "204": {
            "description": "Unlinked"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/email": {
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Set or clear the caller's email.",
        "operationId": "put_email",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/local-password": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Set the first local password on an account without one.",
        "operationId": "post_local_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocalPasswordSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "403": {
            "description": "Password sign-in is turned off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/password": {
      "post": {
        "tags": [
          "users"
        ],
        "summary": "Change the caller's password.",
        "operationId": "post_password",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "400": {
            "description": "Current password is incorrect, or the new one is refused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Password sign-in is turned off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The account has no local password",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/scrobble-preferences": {
      "get": {
        "tags": [
          "listening"
        ],
        "summary": "Read the caller's scrobble preferences.",
        "operationId": "get_scrobble_preferences",
        "responses": {
          "200": {
            "description": "Scrobble preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScrobblePreferences"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "listening"
        ],
        "summary": "Update the caller's scrobble preferences. Absent fields keep their\nstored values.",
        "operationId": "update_scrobble_preferences",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrobblePreferencesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Scrobble preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScrobblePreferences"
                }
              }
            }
          },
          "400": {
            "description": "Unknown enum value",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The server is busy; try again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/section-prefs": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the caller's section visibility prefs (all three pages).",
        "operationId": "get_section_prefs",
        "responses": {
          "200": {
            "description": "Section prefs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SectionPrefsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Replace one page of the caller's section prefs. Unknown pages and\nunknown keys are a 400; only the updated page is returned.",
        "operationId": "put_section_prefs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SectionPrefsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SectionPrefsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/me/username": {
      "put": {
        "tags": [
          "users"
        ],
        "summary": "Rename the caller.",
        "operationId": "put_username",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsernameUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/now-playing": {
      "get": {
        "tags": [
          "playback"
        ],
        "summary": "The live now-playing snapshot across users.",
        "operationId": "now_playing",
        "responses": {
          "200": {
            "description": "Live snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NowPlayingSnapshot"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "playback"
        ],
        "summary": "Record a native heartbeat (upsert presence).",
        "operationId": "heartbeat",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NowPlayingHeartbeat"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Heartbeat recorded"
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "playback"
        ],
        "summary": "Clear one native device (stop presence).",
        "operationId": "clear_now_playing",
        "parameters": [
          {
            "name": "device",
            "in": "query",
            "description": "Device slug, `web` default",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Presence cleared"
          },
          "400": {
            "description": "Bad query string",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playback/conversion": {
      "get": {
        "tags": [
          "stream"
        ],
        "summary": "Whether a stream that asks for a format is converted, so the web player\nknows before it asks.",
        "operationId": "playback_conversion",
        "responses": {
          "200": {
            "description": "Whether converting is on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackConversion"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playback/progress": {
      "post": {
        "tags": [
          "playback"
        ],
        "summary": "Record a heartbeat for a live session.",
        "operationId": "report_progress",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaybackProgressRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Heartbeat recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackProgressResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playback/start": {
      "post": {
        "tags": [
          "playback"
        ],
        "summary": "Open a playback session for one track.",
        "description": "A Jellyfin, Navidrome or Plex track is reported on to that server under\nthe caller's own linked account, and the answer does not wait for it.",
        "operationId": "start_playback",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaybackStartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Session opened",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackStartResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playback/stop": {
      "post": {
        "tags": [
          "playback"
        ],
        "summary": "Close a session, counting a library play past threshold.",
        "operationId": "stop_playback",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaybackStopRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Session closed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackStopResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "List visible playlists.",
        "operationId": "list_playlists_handler",
        "responses": {
          "200": {
            "description": "Visible playlists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "collections"
        ],
        "summary": "Create a playlist.",
        "operationId": "create_playlist_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePlaylistBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistDetail"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/check-tracks": {
      "post": {
        "tags": [
          "collections"
        ],
        "summary": "Check which visible playlists hold each queried track.",
        "operationId": "check_tracks_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckTracksBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Membership map",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckTracksResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/import": {
      "post": {
        "tags": [
          "collections"
        ],
        "summary": "Import a playlist from an M3U or CSV file.",
        "operationId": "import_playlist_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportPlaylistBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The new playlist and the match report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportPlaylistResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad body, blank name, or a file over 2 MB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "Read one playlist.",
        "operationId": "get_playlist_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Playlist detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "PLAYLIST_PRIVATE: another user's private playlist, with a RedactedPlaylist in error.details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "collections"
        ],
        "summary": "Rename a playlist.",
        "operationId": "update_playlist_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePlaylistBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Renamed playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistDetail"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "collections"
        ],
        "summary": "Delete a playlist.",
        "operationId": "delete_playlist_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deletion receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/cover": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "Serve playlist cover bytes.",
        "operationId": "get_cover_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cover bytes"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "collections"
        ],
        "summary": "Upload a playlist cover.",
        "operationId": "upload_cover_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoverUploadBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Cover URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoverUploadResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "collections"
        ],
        "summary": "Delete a playlist cover.",
        "operationId": "remove_cover_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removal receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/export": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "Export one playlist as extended M3U or CSV.",
        "description": "Entries with no local file are left out of either format; the\n`X-DroppedNeedle-Skipped-Tracks` header counts them.",
        "operationId": "export_playlist_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "`m3u8` (default) or `csv`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ExportFormat"
            }
          },
          {
            "name": "prefix",
            "in": "query",
            "description": "Added before each entry's path, for a player that stores music under\na folder of its own. At most 200 characters; no control characters.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The playlist as extended M3U (`audio/x-mpegurl`) or CSV (`text/csv; charset=utf-8`), named in Content-Disposition",
            "headers": {
              "x-droppedneedle-skipped-tracks": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Entries left out because they have no local file"
              }
            }
          },
          "400": {
            "description": "Unknown format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id, or one the caller may not read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/members": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "The people a playlist is shared with.",
        "operationId": "list_members_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembersResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "collections"
        ],
        "summary": "Share a playlist with exactly these people.",
        "operationId": "set_members_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MembersBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Members now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body, or an id that names no other user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/members/me": {
      "delete": {
        "tags": [
          "collections"
        ],
        "summary": "Leave a playlist shared with the caller.",
        "operationId": "leave_playlist_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Left",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not shared with the caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/resolve-sources": {
      "post": {
        "tags": [
          "collections"
        ],
        "summary": "Resolve each track's known sources.",
        "operationId": "resolve_sources_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source map",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveSourcesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/tracks": {
      "post": {
        "tags": [
          "collections"
        ],
        "summary": "Add tracks to a playlist.",
        "operationId": "add_tracks_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddTracksBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Added tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddTracksResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/tracks/remove": {
      "post": {
        "tags": [
          "collections"
        ],
        "summary": "Bulk-remove tracks from a playlist.",
        "operationId": "remove_tracks_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveTracksBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Removal receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveTracksResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/tracks/reorder": {
      "patch": {
        "tags": [
          "collections"
        ],
        "summary": "Reorder one track inside a playlist.",
        "operationId": "reorder_track_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Reorder receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReorderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist or track id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/tracks/{track_id}": {
      "delete": {
        "tags": [
          "collections"
        ],
        "summary": "Remove one track from a playlist.",
        "operationId": "remove_track_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "track_id",
            "in": "path",
            "description": "Track row id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Removal receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist or track id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "collections"
        ],
        "summary": "Update one track's source fields.",
        "operationId": "update_track_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "track_id",
            "in": "path",
            "description": "Track row id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTrackBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistTrack"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist or track id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/playlists/{playlist_id}/visibility": {
      "patch": {
        "tags": [
          "collections"
        ],
        "summary": "Flip playlist visibility.",
        "operationId": "set_visibility_handler",
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "description": "Playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VisibilityBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistSummary"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Owner only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown playlist id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/plugins": {
      "get": {
        "tags": [
          "plugins"
        ],
        "summary": "List every discovered plugin, secrets masked.",
        "operationId": "list_plugins",
        "responses": {
          "200": {
            "description": "Plugin listing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/plugins/ext/{name}/{subpath}": {
      "get": {
        "tags": [
          "plugins"
        ],
        "summary": "Serve one declared plugin GET route.",
        "operationId": "plugin_ext_get",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Plugin name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subpath",
            "in": "path",
            "description": "Declared route subpath",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin answer"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown plugin or route",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "plugins"
        ],
        "summary": "Serve one declared plugin POST route.",
        "operationId": "plugin_ext_post",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Plugin name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subpath",
            "in": "path",
            "description": "Declared route subpath",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin answer"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown plugin or route",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "plugins"
        ],
        "summary": "Serve one declared plugin DELETE route.",
        "operationId": "plugin_ext_delete",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Plugin name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subpath",
            "in": "path",
            "description": "Declared route subpath",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plugin answer"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown plugin or route",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/plugins/install": {
      "post": {
        "tags": [
          "plugins"
        ],
        "summary": "Install a plugin from a public GitHub repository, pinned to an exact\ncommit. The code is stored, never run: the plugin arrives disabled and\nan admin must enable it. Reinstalling over an installed plugin replaces\nits code and keeps its settings.",
        "operationId": "install_plugin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginInstallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Installed plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginInfo"
                }
              }
            }
          },
          "400": {
            "description": "Not a usable plugin repository",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The repository moved since the preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "502": {
            "description": "GitHub refused the request, could not be reached, or sent an unreadable answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "GitHub is rate limiting this server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/plugins/install/preview": {
      "post": {
        "tags": [
          "plugins"
        ],
        "summary": "Show what installing a repository would bring in: the manifest, the\npermissions it asks for, the exact commit, and the trust warning.\nDownloads and validates; writes nothing.",
        "operationId": "preview_plugin_install",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginInstallRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "What would be installed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginInstallPreview"
                }
              }
            }
          },
          "400": {
            "description": "Not a usable plugin repository",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "502": {
            "description": "GitHub refused the request, could not be reached, or sent an unreadable answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "GitHub is rate limiting this server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/plugins/sources": {
      "get": {
        "tags": [
          "plugins"
        ],
        "summary": "List enabled plugin acquisition sources. Any authenticated user may\nread this; only admins manage plugins.",
        "operationId": "list_plugin_sources",
        "responses": {
          "200": {
            "description": "Plugin sources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginSourcesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/plugins/{name}": {
      "put": {
        "tags": [
          "plugins"
        ],
        "summary": "Save one plugin's enable switch plus its settings.",
        "operationId": "update_plugin",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Plugin name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginInfo"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "plugins"
        ],
        "summary": "Remove one plugin's folder. Its saved settings stay in config, so a\nreinstall picks them back up.",
        "operationId": "uninstall_plugin",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Plugin name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Uninstall receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMessage"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/plugins/{name}/ui/panel": {
      "get": {
        "tags": [
          "plugins"
        ],
        "summary": "Serve one enabled plugin's settings panel as a page for the admin UI to\nframe: a fixed wrapper with the plugin's panel script inlined. Admin-only.\nThe entry path resolves inside the plugin's own directory; anything\nescaping it reads as missing.",
        "operationId": "plugin_panel_page",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Plugin name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Panel page",
            "content": {
              "text/html": {}
            }
          },
          "304": {
            "description": "Not modified"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown plugin or panel",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/plugins/{name}/update": {
      "post": {
        "tags": [
          "plugins"
        ],
        "summary": "Update one installed plugin from the GitHub repository it came from.\nA plugin installed from releases moves to the latest release, a branch\nto its tip; a pinned one moves only when a new ref is given. An update\nnever switches the kind of install by itself, and never installs from a\nrepository GitHub knows by another id. Settings and data stay.",
        "operationId": "update_plugin_from_source",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "Plugin name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PluginSourceUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Update outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PluginSourceUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "No GitHub source, or not a usable plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown plugin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The repository moved since the preview, was replaced, or has no releases now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "502": {
            "description": "GitHub refused the request, could not be reached, or sent an unreadable answer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "GitHub is rate limiting this server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/ratings/lookup": {
      "post": {
        "tags": [
          "collections"
        ],
        "summary": "The caller's ratings of the given albums, tracks and artists.",
        "description": "A read that takes its ids in a body, at most 1000 of each kind. Only\nrated ids are listed.",
        "operationId": "rating_lookup_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RatingLookupBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The caller's ratings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RatingLookupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad body or too many ids",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/ratings/{kind}/{item_id}": {
      "put": {
        "tags": [
          "collections"
        ],
        "summary": "Rate an album, track or artist, or clear the rating.",
        "description": "Acts on the caller's own rating, the one Subsonic apps show and set.\n1 to 5 stars, 0 clears. The old id of a merged item rates the item it\nwent into, and the answer names that id.",
        "operationId": "set_rating_handler",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "description": "Kind: album, artist, or track",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "path",
            "description": "Local id of the rated item",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetRatingBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The caller's rating now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RatingStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad kind, rating or body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No live item holds the id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/navidrome/folders": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Navidrome folder preference resolution for the caller.",
        "operationId": "remotes_get_navidrome_folders",
        "responses": {
          "200": {
            "description": "Folder resolution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderResolutionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "remotes"
        ],
        "summary": "Save the Navidrome folder preference.",
        "operationId": "remotes_put_navidrome_folders",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FolderSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Folder resolution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderResolutionView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/albums": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "One page of albums.",
        "operationId": "remotes_list_albums",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max items (1-500, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Records to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Sort field (source-native name, default SortName/titleSort).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "description": "\"asc\" or \"desc\" (default asc).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "genre",
            "in": "query",
            "description": "Genre filter.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "query",
            "description": "Exact year filter.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "decade",
            "in": "query",
            "description": "Decade filter in `\"2020s\"` spelling (Plex honors it, others ignore it).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mood",
            "in": "query",
            "description": "Mood filter (Plex honors it, others ignore it).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tags",
            "in": "query",
            "description": "Tag filter, `|`-separated for several (Jellyfin honors it, others\nignore it).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "studios",
            "in": "query",
            "description": "Studio (label) filter, `|`-separated for several (Jellyfin honors\nit, others ignore it).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesAlbumPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/albums/{id}/tracks": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Tracks of one album.",
        "operationId": "remotes_list_album_tracks",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Remote album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesTrackPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/analytics": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Listening analytics over the history (Plex).",
        "operationId": "remotes_get_analytics",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listening analytics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/artists": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "One page of artists.",
        "operationId": "remotes_list_artists",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max items (1-500, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Records to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Sort field (source-native name).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "description": "\"asc\" or \"desc\" (default asc).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Name filter.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Artist page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesArtistPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/artists/index": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Full alphabetic artist index.",
        "operationId": "remotes_get_artist_index",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Artist index",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtistIndex"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/connection": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Connection status for one source. Never carries credential material.",
        "operationId": "remotes_get_connection",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionStatus"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "remotes"
        ],
        "summary": "Link the caller's own Navidrome or Jellyfin account. The password is\nchecked against the server first and never echoed.",
        "operationId": "remotes_put_connection",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectionSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionStatus"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "remotes"
        ],
        "summary": "Remove the caller's own link for one source.",
        "operationId": "remotes_delete_connection",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Connection status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionStatus"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/covers/playlists/{id}": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Playlist cover bytes. Never cached: playlist art follows membership.",
        "operationId": "remotes_get_playlist_cover",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Remote playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Square edge in px (1-2000, default 500).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Playlist cover bytes"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/discovery": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Discovery shelves (Plex).",
        "operationId": "remotes_get_discovery",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "Items per hub (1-20, default 10).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Discovery shelves",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/favorites": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Favorite artists, albums, and tracks.",
        "operationId": "remotes_get_favorites",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max items per kind (1-100, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Favorites",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FavoritesView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/filters": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Album filter facets (Jellyfin).",
        "operationId": "remotes_get_filters",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Filter facets",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilterFacetsView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/genres": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Genre labels.",
        "operationId": "remotes_list_genres",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Genre labels",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/genres/songs": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Tracks carrying one genre label.",
        "operationId": "remotes_list_genre_songs",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "genre",
            "in": "query",
            "description": "Genre label.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "genres",
            "in": "query",
            "description": "Several genre labels, comma-separated (up to 10). Tracks of any of\nthem come back merged, without duplicates.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max items (1-500, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Records to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Genre tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesTrackPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/history": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Listening history, newest first.",
        "operationId": "remotes_list_history",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max items (1-200, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Records to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "History page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/hub": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Hub highlights for one source.",
        "operationId": "remotes_get_hub",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Hub highlights",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HubView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/images/{id}": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Item image bytes. Immutable and cacheable for a year: image URLs carry\nthe upstream tag, so a new tag is a new URL.",
        "operationId": "remotes_get_image",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Remote image id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Square edge in px (1-2000, default 500).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/info/albums/{id}": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Album info passthrough.",
        "operationId": "remotes_get_album_info",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Remote album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Album info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InfoView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/info/artists/{id}": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Artist info passthrough.",
        "operationId": "remotes_get_artist_info",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Remote artist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Artist info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InfoView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/lyrics/{id}": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Lyrics for one track.",
        "operationId": "remotes_get_lyrics",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Remote track id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist",
            "in": "query",
            "description": "Artist name fallback (Navidrome classic lyrics).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "title",
            "in": "query",
            "description": "Title fallback (Navidrome classic lyrics).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lyrics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesLyricsView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/match": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "The caller's copy of an album on one source.",
        "description": "Found by MusicBrainz id, or on Plex and Navidrome by title and artist\nwhen no album there carries the id.",
        "operationId": "remotes_match_album",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "mbid",
            "in": "query",
            "description": "MusicBrainz release or release-group id.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "title",
            "in": "query",
            "description": "Album title.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist",
            "in": "query",
            "description": "Album artist.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Match result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatchView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/mix/{id}": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Instant mix for an item, artist, or genre id (Jellyfin).",
        "operationId": "remotes_get_mix",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Seed id or genre name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "Seed kind: `item` (default), `artist`, or `genre`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max tracks (1-200, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Instant mix",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesTrackPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/moods": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Mood labels (Plex).",
        "operationId": "remotes_list_moods",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mood labels",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/playlists": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "The caller's playlists on the server.",
        "operationId": "remotes_list_playlists",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Playlists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistCollection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/playlists/{id}": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "One playlist with its tracks.",
        "operationId": "remotes_get_playlist",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Remote playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Playlist detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesPlaylistDetail"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/playlists/{id}/import": {
      "post": {
        "tags": [
          "remotes"
        ],
        "summary": "Import one remote playlist into the caller's playlists.",
        "operationId": "remotes_import_playlist",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Remote playlist id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Import receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportResult"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/random": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Random tracks, optionally filtered by genre. The default is 20 and the max 50.\nPlex answers unsupported.",
        "operationId": "remotes_list_random",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max tracks (1-50, default 20).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "genre",
            "in": "query",
            "description": "Genre label filter, when present.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Random tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesTrackPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/recent": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Recently played albums.",
        "operationId": "remotes_list_recent",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max items (1-500, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Records to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recently played",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RemotesAlbumView"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/search": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Unified search across artists, albums, and tracks.",
        "operationId": "remotes_search",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Query text.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Per-bucket cap (1-100, default 20).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesSearchResults"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/similar/{id}": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Tracks similar to one track.",
        "operationId": "remotes_list_similar",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Remote track id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max items (1-500, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Records to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Similar tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesTrackPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/stats": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Library totals for one source.",
        "operationId": "remotes_get_stats",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Library totals",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesStatsView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/top/{artist}": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "Top songs for one artist name.",
        "operationId": "remotes_list_top_songs",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "artist",
            "in": "path",
            "description": "Artist name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max items (1-500, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Records to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Top songs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesTrackPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/remotes/{source}/tracks": {
      "get": {
        "tags": [
          "remotes"
        ],
        "summary": "One page of tracks.",
        "operationId": "remotes_list_tracks",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Remote source",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/SourceName"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max items (1-500, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Records to skip (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Sort field (source-native name).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "description": "\"asc\" or \"desc\" (default asc).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Title filter.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "genre",
            "in": "query",
            "description": "Genre filter.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Track page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemotesTrackPage"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/active": {
      "get": {
        "tags": [
          "requests"
        ],
        "summary": "Live asks. `GET /api/v3/requests/active`. Admins see every row.",
        "operationId": "active_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/active/count": {
      "get": {
        "tags": [
          "requests"
        ],
        "summary": "Live-ask count. `GET /api/v3/requests/active/count`.",
        "operationId": "active_count_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveCountResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/active/{musicbrainz_id}": {
      "delete": {
        "tags": [
          "requests"
        ],
        "summary": "Cancel one ask. `DELETE /api/v3/requests/active/{musicbrainz_id}`.\nCo-requesters detach with the shared row continuing; owners cancel.",
        "operationId": "cancel_one_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Album or recording MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "`album` (default) or `track`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RequestKind"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such request on the caller's list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/albums": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Ask for one album. `POST /api/v3/requests/albums`. Users wait for\napproval; curators dispatch at once. Duplicate asks attach to the live\nrow and report its status. Answers 202.",
        "operationId": "request_album_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlbumIntake"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntakeResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/approvals": {
      "get": {
        "tags": [
          "requests"
        ],
        "summary": "Rows waiting for review. `GET /api/v3/requests/approvals`. Admin only.",
        "operationId": "approvals_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/approvals/count": {
      "get": {
        "tags": [
          "requests"
        ],
        "summary": "Pending-review badge count across all three queues.\n`GET /api/v3/requests/approvals/count`. Admin only.",
        "operationId": "approvals_count_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveCountResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/approvals/{musicbrainz_id}/approve": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Approve one waiting ask and dispatch it.\n`POST /api/v3/requests/approvals/{musicbrainz_id}/approve`. Admin only.",
        "operationId": "approve_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Album or recording MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "`album` (default) or `track`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RequestKind"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/approvals/{musicbrainz_id}/reject": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Reject one waiting ask.\n`POST /api/v3/requests/approvals/{musicbrainz_id}/reject`. Admin only.",
        "operationId": "reject_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Album or recording MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "`album` (default) or `track`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RequestKind"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/auto-download-approval-batches": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "List pending requests grouped per user.",
        "operationId": "list_approval_batches_handler",
        "responses": {
          "200": {
            "description": "Approval batches",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalBatchListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/auto-download-approval-batches/{batch_id}/approve": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Approve one bulk batch.\n`POST /api/v3/requests/auto-download-approval-batches/{batch_id}/approve`.\nAdmin only.",
        "operationId": "approve_auto_download_batch_handler",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "description": "Batch id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/auto-download-approval-batches/{batch_id}/reject": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Reject one bulk batch.\n`POST /api/v3/requests/auto-download-approval-batches/{batch_id}/reject`.\nAdmin only.",
        "operationId": "reject_auto_download_batch_handler",
        "parameters": [
          {
            "name": "batch_id",
            "in": "path",
            "description": "Batch id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/auto-download-approvals": {
      "get": {
        "tags": [
          "collections"
        ],
        "summary": "List pending auto-download requests.",
        "operationId": "list_approvals_handler",
        "responses": {
          "200": {
            "description": "Pending approvals",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoDownloadApprovalListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/auto-download-approvals/{user_id}/{artist_mbid}/approve": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Approve one auto-download grant.\n`POST /api/v3/requests/auto-download-approvals/{user_id}/{artist_mbid}/approve`.\nAdmin only.",
        "operationId": "approve_auto_download_handler",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "description": "Requesting user id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/auto-download-approvals/{user_id}/{artist_mbid}/reject": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Reject one auto-download ask, keeping the follow.\n`POST /api/v3/requests/auto-download-approvals/{user_id}/{artist_mbid}/reject`.\nAdmin only.",
        "operationId": "reject_auto_download_handler",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "description": "Requesting user id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/auto-download-approvals/{user_id}/{artist_mbid}/revoke": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Revoke one auto-download grant, keeping the follow.\n`POST /api/v3/requests/auto-download-approvals/{user_id}/{artist_mbid}/revoke`.\nAdmin only.",
        "operationId": "revoke_auto_download_handler",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "description": "Requesting user id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "artist_mbid",
            "in": "path",
            "description": "Artist MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/batches": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Ask for a batch of albums. `POST /api/v3/requests/batches`. At most 500\nrows; dupes, live rows, and unresolvable rows skip. Answers 202.",
        "operationId": "request_batch_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchIntake"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchIntakeResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/batches/cancel": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Cancel a batch of asks. `POST /api/v3/requests/batches/cancel`.\nNon-admins detach from shared rows and cancel their own; admins cancel\nanything live.",
        "operationId": "cancel_batch_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchCancelBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchCancelResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/history": {
      "get": {
        "tags": [
          "requests"
        ],
        "summary": "Paged history. `GET /api/v3/requests/history`. Admins see every row.",
        "operationId": "history_handler",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "1-based page.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "Rows per page (1..=100).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Status filter: a request status, or `reimportable` (admins only)\nfor the failed requests whose downloaded files can be imported again.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "`newest` (default), `oldest`, or `status`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "`album` or `track`; unset means both.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RequestKind"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/history/{musicbrainz_id}": {
      "delete": {
        "tags": [
          "requests"
        ],
        "summary": "Clear one history row. `DELETE /api/v3/requests/history/{musicbrainz_id}`.\nAdmins delete the row; users dismiss it from their own view.",
        "operationId": "clear_history_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Album or recording MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "`album` (default) or `track`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RequestKind"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClearHistoryResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such request on the caller's list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/personal-mix-approvals": {
      "get": {
        "tags": [
          "requests"
        ],
        "summary": "Pending personal-mix approvals.\n`GET /api/v3/requests/personal-mix-approvals`. Admin only.",
        "operationId": "mix_approvals_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonalMixApprovalsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/personal-mix-approvals/{user_id}/approve": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Approve one mix auto-request grant.\n`POST /api/v3/requests/personal-mix-approvals/{user_id}/approve`.\nAdmin only.",
        "operationId": "approve_mix_handler",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "description": "Requesting user id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/personal-mix-approvals/{user_id}/reject": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Reject one mix auto-request ask.\n`POST /api/v3/requests/personal-mix-approvals/{user_id}/reject`.\nAdmin only.",
        "operationId": "reject_mix_handler",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "description": "Requesting user id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/personal-mix-approvals/{user_id}/revoke": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Revoke one mix auto-request grant.\n`POST /api/v3/requests/personal-mix-approvals/{user_id}/revoke`.\nAdmin only.",
        "operationId": "revoke_mix_handler",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "description": "Requesting user id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/personal-mix/refresh": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Refresh one user's personal mix.\n`POST /api/v3/requests/personal-mix/refresh`. Repeat calls while a build\nruns answer `already_running`; unlinked users get 400.",
        "operationId": "refresh_mix_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestsRefreshResponse"
                }
              }
            }
          },
          "400": {
            "description": "ListenBrainz is not connected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/retry/{musicbrainz_id}": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Retry one terminal ask. `POST /api/v3/requests/retry/{musicbrainz_id}`.\nPlain users rejoin the queue unless the generation already carries\napproval provenance.",
        "operationId": "retry_one_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Album or recording MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "description": "`album` (default) or `track`.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RequestKind"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such request on the caller's list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/tracks": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Ask for one exact recording. `POST /api/v3/requests/tracks`. Same\napproval gate as albums. Answers 202.",
        "operationId": "request_track_handler",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackIntake"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackIntakeResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/tracks/{musicbrainz_id}/from-album": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Take a single from its album.\n`POST /api/v3/requests/tracks/{musicbrainz_id}/from-album`. For a failed\ntrack request whose download found only the album's version of the\nsong: it is fetched again, and the album's track imports as the song\nwhen it is the right track. A requester or an admin.",
        "operationId": "from_album_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Recording MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActionResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such track request on the caller's list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "No album version to take, or the request needs approval",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/wanted": {
      "get": {
        "tags": [
          "requests"
        ],
        "summary": "Wanted watches plus the still-retrying set.\n`GET /api/v3/requests/wanted`. Admins see every row.",
        "operationId": "wanted_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WantedResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/wanted/clear-finished": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Remove every stopped or fulfilled watch the caller can see.\n`POST /api/v3/requests/wanted/clear-finished`. An admin's covers everyone's.",
        "operationId": "wanted_clear_finished_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WantedRemovalResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/wanted/{musicbrainz_id}": {
      "delete": {
        "tags": [
          "requests"
        ],
        "summary": "Remove one wanted watch, stopping it first if it is active.\n`DELETE /api/v3/requests/wanted/{musicbrainz_id}`.",
        "operationId": "wanted_remove_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WantedRemovalResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/wanted/{musicbrainz_id}/resume": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Resume one wanted watch.\n`POST /api/v3/requests/wanted/{musicbrainz_id}/resume`.",
        "operationId": "wanted_resume_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WantedActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/wanted/{musicbrainz_id}/seen": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Clear one watch's unseen candidates.\n`POST /api/v3/requests/wanted/{musicbrainz_id}/seen`.",
        "operationId": "wanted_seen_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WantedActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/requests/wanted/{musicbrainz_id}/stop": {
      "post": {
        "tags": [
          "requests"
        ],
        "summary": "Pause one wanted watch. `POST /api/v3/requests/wanted/{musicbrainz_id}/stop`.",
        "operationId": "wanted_stop_handler",
        "parameters": [
          {
            "name": "musicbrainz_id",
            "in": "path",
            "description": "Release-group MBID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WantedActionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/scrobble/now-playing": {
      "post": {
        "tags": [
          "playback"
        ],
        "summary": "Forward one native now-playing report to the linked accounts.",
        "operationId": "forward_now_playing",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrobbleNowPlayingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Forward outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScrobbleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/scrobble/submit": {
      "post": {
        "tags": [
          "playback"
        ],
        "summary": "Submit one native scrobble by name.",
        "operationId": "submit_scrobble",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScrobbleSubmitRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Scrobble counted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScrobbleResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/search": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Ranked hits across the selected buckets plus each bucket's standout.",
        "operationId": "unified_search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search text. Required; blank is a 400.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit_artists",
            "in": "query",
            "description": "Max artists (0-100, default 10).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "limit_albums",
            "in": "query",
            "description": "Max albums (0-100, default 10).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "limit_tracks",
            "in": "query",
            "description": "Max tracks (0-100, default 10).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "buckets",
            "in": "query",
            "description": "Comma-separated subset (`artists,albums,tracks`); absent means all.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Where to look; absent means `all`.",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Where a unified search looks.",
              "enum": [
                "all",
                "library"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked hits per bucket",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Blank query or bad limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/search/enrich/batch": {
      "post": {
        "tags": [
          "search"
        ],
        "summary": "The single enrich-batch method: one POST enriches a mixed batch of\nartists and albums. GET on this path is a 405. Provider failures degrade\ninto typed notes, never a 5xx.",
        "operationId": "enrich_batch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnrichmentBatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Batch counts plus degradations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnrichmentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Malformed batch body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/search/suggest": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Merged typeahead across buckets. Queries under two characters return\nan empty 200, so typing never errors.",
        "operationId": "suggest",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search text. Queries shorter than two characters return an empty\n200, so the typeahead never errors mid-typing.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Max suggestions (1-10, default 5).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Merged suggestions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuggestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/search/{bucket}": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "One page of one bucket for drill-down views.",
        "operationId": "search_bucket",
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "description": "Bucket name: artists, albums or tracks",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Search text. Required; blank is a 400.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (1-100, default 50).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Pagination offset (default 0).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the bucket",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchBucketResponse"
                }
              }
            }
          },
          "400": {
            "description": "Blank query or bad limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown bucket",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/advanced": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the advanced tunables (AudioDB key masked unless unset).",
        "operationId": "get_advanced",
        "responses": {
          "200": {
            "description": "Advanced tunables",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvancedSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the advanced tunables (a masked AudioDB key keeps the stored one,\na blank one stores the free default).",
        "operationId": "put_advanced",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdvancedSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved tunables",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdvancedSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/app-connect": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the apps that may sign in through the browser and get an app password.",
        "operationId": "get_app_connect",
        "responses": {
          "200": {
            "description": "App connect apps",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppConnect"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Replace the apps that may sign in through the browser. An empty list turns\nnative app sign-in off.",
        "operationId": "put_app_connect",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppConnect"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The list as stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppConnect"
                }
              }
            }
          },
          "400": {
            "description": "An app's id, name or return address is not allowed, or there are more than eight",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/appearance": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the site CSS and whether people may add their own.",
        "operationId": "get_site_appearance",
        "responses": {
          "200": {
            "description": "Site appearance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Appearance"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the site CSS and whether people may add their own. The site CSS\npasses the same check as a person's, with a longer limit.",
        "operationId": "put_site_appearance",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Appearance"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved site appearance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Appearance"
                }
              }
            }
          },
          "400": {
            "description": "The CSS is refused (`CUSTOM_CSS_REFUSED`, its problems in `details`) or too long (`CUSTOM_CSS_TOO_LONG`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/connect-apps": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the inbound Connect Apps config.",
        "operationId": "get_connect_apps",
        "responses": {
          "200": {
            "description": "Connect Apps config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectApps"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the inbound Connect Apps config.",
        "operationId": "put_connect_apps",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectApps"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved config",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectApps"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/download-client/config": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the slskd connection (key masked unless unset).",
        "operationId": "get_slskd",
        "responses": {
          "200": {
            "description": "slskd connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlskdConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the slskd connection (a masked key keeps the stored one).",
        "operationId": "put_slskd",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlskdConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SlskdConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/download-client/test": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted slskd values (a masked key tests the stored one).",
        "operationId": "test_slskd",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SlskdConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestConnectionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/download-clients/nzbget": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the NZBGet connection (password masked unless unset).",
        "operationId": "get_nzbget",
        "responses": {
          "200": {
            "description": "NZBGet connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NzbgetConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the NZBGet connection (a masked password keeps the stored one).",
        "operationId": "put_nzbget",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NzbgetConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NzbgetConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/download-clients/nzbget/test": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted NZBGet values (a masked password tests the stored\none). The submitted downloads mount is diagnosed, not the stored one.",
        "operationId": "test_nzbget",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NzbgetConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsenetClientTestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/download-clients/policy": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the acquisition policy plus its recipe verdict.",
        "operationId": "get_policy",
        "responses": {
          "200": {
            "description": "Acquisition policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadPolicyView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the acquisition policy. Read-only verdict fields in the body are\nignored.",
        "operationId": "put_policy",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DownloadPolicy"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved policy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DownloadPolicyView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/download-clients/sabnzbd": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the SABnzbd connection (key masked unless unset).",
        "operationId": "get_sabnzbd",
        "responses": {
          "200": {
            "description": "SABnzbd connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SabnzbdConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the SABnzbd connection (a masked key keeps the stored one).",
        "operationId": "put_sabnzbd",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SabnzbdConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SabnzbdConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/download-clients/sabnzbd/test": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted SABnzbd values (a masked key tests the stored\none). The submitted downloads mount is diagnosed, not the stored one.",
        "operationId": "test_sabnzbd",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SabnzbdConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsenetClientTestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/download-clients/source-priority": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the acquisition source try-order.",
        "operationId": "get_source_priority",
        "responses": {
          "200": {
            "description": "Source try-order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourcePriorityOrder"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the acquisition source try-order.",
        "operationId": "put_source_priority",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SourcePriorityOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved try-order",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourcePriorityOrder"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/download-clients/wanted": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the wanted watcher toggles.",
        "operationId": "get_wanted",
        "responses": {
          "200": {
            "description": "Wanted watcher toggles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WantedWatcher"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the wanted watcher toggles.",
        "operationId": "put_wanted",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WantedWatcher"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved toggles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WantedWatcher"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/edition-preferences": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the edition preferences.",
        "operationId": "get_edition_preferences",
        "responses": {
          "200": {
            "description": "Edition preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionPreferences"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the edition preferences.",
        "operationId": "put_edition_preferences",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditionPreferences"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EditionPreferences"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/events": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the events sources (keys masked unless unset).",
        "operationId": "get_events",
        "responses": {
          "200": {
            "description": "Events sources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventsSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the events sources (masked keys keep the stored ones) and kick\nthe sweep.",
        "operationId": "put_events",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventsSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved sources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventsSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/events/test-skiddle": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted Skiddle key (a masked key tests the stored one).",
        "operationId": "test_skiddle",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventsSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyConnectionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/events/test-ticketmaster": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted Ticketmaster key (a masked key tests the stored one).",
        "operationId": "test_ticketmaster",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventsSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyConnectionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/get-it": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the store-region settings.",
        "operationId": "get_get_it",
        "responses": {
          "200": {
            "description": "Store-region settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetIt"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the store-region settings.",
        "operationId": "put_get_it",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetIt"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetIt"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/indexers": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "List the configured Newznab indexers (keys masked unless unset).",
        "operationId": "list_indexers",
        "responses": {
          "200": {
            "description": "Configured indexers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NewznabIndexer"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Save one indexer (create when the id is blank, else update).",
        "operationId": "create_indexer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewznabIndexer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved indexer id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndexerSavedResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/indexers/reorder": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Persist a dragged-card priority order.",
        "operationId": "reorder_indexers",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IndexerReorderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Reordered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationResult"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/indexers/search-backend": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the active Usenet search backend.",
        "operationId": "get_search_backend",
        "responses": {
          "200": {
            "description": "Search backend",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsenetSearchBackend"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the active Usenet search backend. Unknown values are a 400.",
        "operationId": "put_search_backend",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsenetSearchBackend"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved backend",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsenetSearchBackend"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/indexers/test": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test one indexer's caps with the submitted URL and key (a masked key\ntests the stored one).",
        "operationId": "test_indexer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewznabIndexer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Caps verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndexerTestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/indexers/{id}": {
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save one indexer; the path id wins over the body id.",
        "operationId": "update_indexer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Indexer id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewznabIndexer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved indexer id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndexerSavedResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "settings"
        ],
        "summary": "Delete one indexer. Unknown ids are a silent no-op.",
        "operationId": "delete_indexer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Indexer id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationResult"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/jellyfin": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the Jellyfin connection (key masked unless unset).",
        "operationId": "get_jellyfin",
        "responses": {
          "200": {
            "description": "Jellyfin connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JellyfinConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the Jellyfin connection (a masked key keeps the stored one).",
        "operationId": "put_jellyfin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JellyfinConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JellyfinConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/jellyfin/verify": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted Jellyfin values (a masked key tests the stored\none). The user list rides along on success for the admin picker.",
        "operationId": "verify_jellyfin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JellyfinConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JellyfinVerifyResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/lastfm": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the Last.fm switch and the instance app key pair (masked unless\nunset).",
        "operationId": "get_lastfm",
        "responses": {
          "200": {
            "description": "Last.fm settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LastFmSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the Last.fm switch and the instance app key pair (a masked value\nkeeps the stored one).",
        "operationId": "put_lastfm",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LastFmSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LastFmSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/lastfm/verify": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted Last.fm key pair (a masked value tests the stored one).",
        "operationId": "verify_lastfm",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LastFmSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyConnectionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the typed library settings with the policy revision.",
        "operationId": "get_library",
        "responses": {
          "200": {
            "description": "Library settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibrarySettingsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the typed library settings. The expected revision must match\nthe stored one or the save is a 409. Dropping every root while the\ncatalog holds tracks is a 400.",
        "operationId": "put_library",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibrarySettingsSaveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved library settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibrarySettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid settings, or every root removed while the catalog holds tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Expected revision is stale",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the Library Management settings with their revision.",
        "operationId": "get_library_management",
        "responses": {
          "200": {
            "description": "Library Management settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementSettingsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the Library Management settings under CAS. Giving an automatic\nroot new write scope needs a current confirmed dry run.",
        "operationId": "put_library_management",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryManagementSaveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid settings, or a dry run is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Expected revision is stale",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/activation-confirmations": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Save settings that turn automatic management on, with their dry runs.",
        "operationId": "confirm_management_activation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementActivationConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settings saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementSettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing confirmation or proof, or a dry run token that is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown dry run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "A dry run is stale or settings changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/activation-health": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Dry-run activation health for the active automatic roots.",
        "operationId": "get_library_management_activation_health",
        "responses": {
          "200": {
            "description": "Activation health",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementActivationHealthResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/activation-previews": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Dry-run a library folder under proposed settings. Nothing changes.",
        "operationId": "create_management_activation_preview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementActivationPreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Dry run queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPreviewCreatedResponse"
                }
              }
            }
          },
          "400": {
            "description": "The folder has no automatic trigger, or invalid settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Settings or library folders changed, or the library is off",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/activation-previews/{job_id}": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "One dry run.",
        "operationId": "get_management_activation_preview",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "description": "Dry run job id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dry run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementJobView"
                }
              }
            }
          },
          "400": {
            "description": "Not a dry run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/impact": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Classify a candidate without saving it.",
        "operationId": "preview_library_management_impact",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryManagementSettingsImpactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Change impact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementChangeImpact"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/placement": {
      "get": {
        "tags": [
          "library management"
        ],
        "summary": "How safely each library folder can be written to, as last checked.\nReading this checks nothing.",
        "operationId": "get_management_placement",
        "responses": {
          "200": {
            "description": "Placement mode of each library folder",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPlacementView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/placement/{root_id}/check": {
      "post": {
        "tags": [
          "library management"
        ],
        "summary": "Check one library folder now. The check creates a folder named\n`.droppedneedle-management-probe` at the top of the library folder\nand removes it again.",
        "operationId": "check_management_placement",
        "parameters": [
          {
            "name": "root_id",
            "in": "path",
            "description": "Library root id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The folder's placement mode now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementPlacementCheckView"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or excluded library folder",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The library folders cannot be opened right now",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/profile-imports": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Import a reviewed shared profile.",
        "operationId": "import_library_management_profile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryManagementProfileImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Imported profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementProfileImportResponse"
                }
              }
            }
          },
          "409": {
            "description": "Settings or the bundle changed since review",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/profile-imports/preview": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Preview importing a shared profile (document or share code).",
        "operationId": "preview_library_management_profile_import",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryManagementProfileImportPreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Import preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementProfileImportPreviewResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/profiles/{profile_id}": {
      "delete": {
        "tags": [
          "settings"
        ],
        "summary": "Delete one custom profile that is neither the default nor assigned.",
        "operationId": "delete_library_management_profile",
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "description": "Profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryManagementProfileDeleteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Settings after the delete",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementSettingsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/profiles/{profile_id}/copy": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Copy one profile under a new name.",
        "operationId": "copy_library_management_profile",
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "description": "Profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryManagementProfileCopyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Copied profile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementProfileMutationResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/profiles/{profile_id}/export": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Export one profile as a share bundle.",
        "operationId": "export_library_management_profile",
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "description": "Profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryManagementProfileExportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Share bundle",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementProfileExportResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/profiles/{profile_id}/preset-diff": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Which groups of a preset-tracking profile differ from the preset.",
        "operationId": "get_library_management_preset_diff",
        "parameters": [
          {
            "name": "profile_id",
            "in": "path",
            "description": "Profile id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preset diff",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementPresetDiff"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library-management/validate": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Validate a candidate: the same check and verdict as the impact\npreview (v2 serves both paths).",
        "operationId": "validate_library_management",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryManagementSettingsImpactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Change impact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryManagementChangeImpact"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/import-folder": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the import folder setting.",
        "operationId": "get_import_folder",
        "responses": {
          "200": {
            "description": "Import folder",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportFolder"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the import folder. Music copied there is imported, then\nremoved from it.",
        "operationId": "put_import_folder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportFolder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved import folder",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportFolder"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/import-folder/status": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "What the import folder is doing now, or why it waits.\n`GET /api/v3/settings/library/import-folder/status`.",
        "operationId": "import_folder_status_handler",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportFolderStatusResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/policy-apply-preview": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Preview a reconcile of saved policy scopes: how many catalog files\nit would revisit.",
        "operationId": "preview_library_policy_apply",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryPolicyApplyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Apply preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryPolicyApplyPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "A scope id no longer exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Expected revision is stale",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/policy-impact": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Preview what saving candidate library settings would change. Nothing\nis saved; a stale expected revision only sets `stale`.",
        "operationId": "preview_library_policy_impact",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryPolicyImpactRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Impact preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryPolicyImpactResponse"
                }
              }
            }
          },
          "400": {
            "description": "Candidate settings are invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/policy-tree": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "The saved roots and their path rules as a tree, with catalog file\ncounts per node.",
        "operationId": "get_library_policy_tree",
        "responses": {
          "200": {
            "description": "Policy tree",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryPolicyTreeResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/restorable-roots": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Roots the catalog still holds tracks for that the settings no longer\nlist.",
        "operationId": "get_restorable_library_roots",
        "responses": {
          "200": {
            "description": "Restorable roots",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryRestorableRootsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/restore-roots": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Put every removed root back into the settings.",
        "operationId": "restore_library_roots",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryRestoreRootsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved library settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibrarySettingsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Nothing to restore, or a restored path is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Expected revision is stale",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/schedule": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the scan schedule plus the server timezone label.",
        "operationId": "get_schedule",
        "responses": {
          "200": {
            "description": "Scan schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryScanScheduleResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the scan schedule.",
        "operationId": "put_schedule",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LibraryScanSchedule"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LibraryScanScheduleResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/script-preview": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Show a naming or tagging script on the built-in example albums while\nit is written. Nothing is saved; a script that fails answers why in\nthe 200 body.",
        "operationId": "preview_library_script",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScriptPreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The script on each example album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScriptPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "The script is too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/library/watcher": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the filesystem poller knobs.",
        "operationId": "get_watcher",
        "responses": {
          "200": {
            "description": "Filesystem poller knobs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilesystemWatcher"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the filesystem poller knobs.",
        "operationId": "put_watcher",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FilesystemWatcher"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved poller knobs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FilesystemWatcher"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/listenbrainz": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the ListenBrainz reads switch.",
        "operationId": "get_listenbrainz",
        "responses": {
          "200": {
            "description": "ListenBrainz reads switch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListenBrainzSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the ListenBrainz reads switch.",
        "operationId": "put_listenbrainz",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListenBrainzSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved switch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListenBrainzSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/lyrics": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the online lyrics lookup switch.",
        "operationId": "get_lyrics_settings",
        "responses": {
          "200": {
            "description": "Lyrics lookup switch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LyricsSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the online lyrics lookup switch.",
        "operationId": "put_lyrics_settings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LyricsSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved switch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LyricsSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/musicbrainz": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the settled MusicBrainz connection plus the transient pending echo.",
        "operationId": "get_musicbrainz",
        "responses": {
          "200": {
            "description": "MusicBrainz settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicBrainzSettingsView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Persist one normalized source change (BrainzMash moves through the\nconsent-bound flow, never a direct update).",
        "operationId": "put_musicbrainz",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MusicBrainzSettingsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicBrainzSettingsView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/musicbrainz/activate": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Promote the exact verified proposal to the active binding.",
        "operationId": "activate_brainzmash",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MusicBrainzBindingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Activated settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicBrainzSettingsView"
                }
              }
            }
          },
          "409": {
            "description": "Proposal is stale, unconsented, or unverified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/musicbrainz/brainzmash/consent": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Record consent for the exact staged proposal. A stale proposal or\nan outdated disclosure is a 409.",
        "operationId": "consent_brainzmash",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MusicBrainzBindingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Consented settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicBrainzSettingsView"
                }
              }
            }
          },
          "409": {
            "description": "Proposal is stale or outdated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/musicbrainz/brainzmash/stage": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Stage a BrainzMash proposal without probing upstream.",
        "operationId": "stage_brainzmash",
        "responses": {
          "200": {
            "description": "Staged settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicBrainzSettingsView"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/musicbrainz/verify": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Verify a BrainzMash binding or probe a plain tier. A failed probe is\na 502; alternative probes are a 409 while BrainzMash is active.",
        "operationId": "verify_musicbrainz",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MusicBrainzVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verified settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicBrainzSettingsView"
                }
              }
            }
          },
          "409": {
            "description": "Proposal is stale, or BrainzMash is active",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "502": {
            "description": "Probe failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "MusicBrainz is down (PROVIDER_UNAVAILABLE, with retry_after when known)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/navidrome": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the Navidrome connection (password masked unless unset).",
        "operationId": "get_navidrome",
        "responses": {
          "200": {
            "description": "Navidrome connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NavidromeConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the Navidrome connection (a masked password keeps the stored one).",
        "operationId": "put_navidrome",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NavidromeConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NavidromeConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/navidrome/playlist-sync": {
      "post": {
        "tags": [
          "remotes"
        ],
        "summary": "Run one Navidrome playlist sync now.",
        "operationId": "sync_now",
        "responses": {
          "200": {
            "description": "Sync report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistSyncResult"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Admin role required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/navidrome/verify": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted Navidrome values (a masked password tests the\nstored one).",
        "operationId": "verify_navidrome",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NavidromeConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyConnectionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/oidc": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the OIDC connection (secret masked unless unset).",
        "operationId": "get_oidc",
        "responses": {
          "200": {
            "description": "OIDC connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OidcConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the OIDC connection (a masked secret keeps the stored one).",
        "operationId": "put_oidc",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OidcConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OidcConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/oidc/verify": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted OIDC issuer (fetches its discovery document).",
        "operationId": "verify_oidc",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OidcConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyConnectionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/plex": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the Plex connection (token masked unless unset).",
        "operationId": "get_plex",
        "responses": {
          "200": {
            "description": "Plex connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlexConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the Plex connection (a masked token keeps the stored one).",
        "operationId": "put_plex",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlexConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlexConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/plex/libraries": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "List Plex music libraries over the stored connection. Unconfigured\nis a 400; an unreachable Plex is a 502.",
        "operationId": "get_plex_libraries",
        "responses": {
          "200": {
            "description": "Music libraries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlexLibrarySectionInfo"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Plex is not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "502": {
            "description": "Plex is unreachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/plex/verify": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted Plex values (a masked token tests the stored\none). Music libraries ride along on success.",
        "operationId": "verify_plex",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlexConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlexVerifyResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/preferences": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the release-type filters.",
        "operationId": "get_preferences",
        "responses": {
          "200": {
            "description": "Release-type filters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserPreferences"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the release-type filters.",
        "operationId": "put_preferences",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserPreferences"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved filters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserPreferences"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/prowlarr/config": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the Prowlarr connection (key masked unless unset).",
        "operationId": "get_prowlarr",
        "responses": {
          "200": {
            "description": "Prowlarr connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProwlarrConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the Prowlarr connection (a masked key keeps the stored one).",
        "operationId": "put_prowlarr",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProwlarrConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProwlarrConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/prowlarr/test": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted Prowlarr values (a masked key tests the stored one).",
        "operationId": "test_prowlarr",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProwlarrConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProwlarrTestResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/public-address": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the addresses stated as this server's own.",
        "operationId": "get_public_address",
        "responses": {
          "200": {
            "description": "Stated public addresses",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicAddress"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Replace the addresses stated as this server's own. The session origin\ncheck accepts a change from a page at one of them.",
        "operationId": "put_public_address",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicAddress"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The list as stored",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicAddress"
                }
              }
            }
          },
          "400": {
            "description": "An entry is not an address, or there are more than eight",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/security": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the security posture settings.",
        "operationId": "get_security",
        "responses": {
          "200": {
            "description": "Security settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecuritySettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the security posture settings.",
        "operationId": "put_security",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecuritySettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecuritySettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/security/verify-hibp": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Check the submitted HIBP hash-list path (must exist and start with\na `40-char-SHA1:count` line).",
        "operationId": "verify_hibp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecuritySettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyConnectionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/wrapped": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the wrapped settings (key masked unless unset).",
        "operationId": "get_wrapped",
        "responses": {
          "200": {
            "description": "Wrapped settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WrappedSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the wrapped settings (a masked key keeps the stored one).",
        "operationId": "put_wrapped",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WrappedSettings"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved settings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WrappedSettings"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/youtube": {
      "get": {
        "tags": [
          "settings"
        ],
        "summary": "Read the YouTube connection (key masked unless unset).",
        "operationId": "get_youtube",
        "responses": {
          "200": {
            "description": "YouTube connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YouTubeConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "settings"
        ],
        "summary": "Save the YouTube connection (a masked key keeps the stored one).",
        "operationId": "put_youtube",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YouTubeConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved connection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YouTubeConnection"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/settings/youtube/verify": {
      "post": {
        "tags": [
          "settings"
        ],
        "summary": "Test the submitted YouTube key (a masked key tests the stored one).",
        "operationId": "verify_youtube",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YouTubeConnection"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Verify verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyConnectionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "admin"
            ]
          }
        ]
      }
    },
    "/api/v3/stream/{source}/{*key}": {
      "get": {
        "tags": [
          "stream"
        ],
        "summary": "Full or ranged audio bytes.",
        "operationId": "stream_get",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Audio source: local, jellyfin, navidrome, plex, or plugin",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "*key",
            "in": "path",
            "description": "Local file id, remote item id, Plex part key, or recording MBID for plugin. A wildcard: Plex part keys keep their slashes",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Requested output codec: mp3, opus, flac, or raw",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_bitrate",
            "in": "query",
            "description": "Client bitrate cap in kbps (0 or unset means uncapped)",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "start_seconds",
            "in": "query",
            "description": "Seek offset in seconds for a transcode",
            "required": false,
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "estimate_content_length",
            "in": "query",
            "description": "Ask a transcode landing for its estimated Content-Length",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full audio bytes or transcode output"
          },
          "206": {
            "description": "Ranged audio bytes"
          },
          "400": {
            "description": "Unknown source or unsupported format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Playback refused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Unknown audio id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "A format was asked for and the server is not converting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "416": {
            "description": "Range not satisfiable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Stream capacity exhausted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "502": {
            "description": "Remote source failed the read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "head": {
        "tags": [
          "stream"
        ],
        "summary": "Same headers as GET, no body.",
        "operationId": "stream_head",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "description": "Audio source: local, jellyfin, navidrome, plex, or plugin",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "*key",
            "in": "path",
            "description": "Local file id, remote item id, Plex part key, or recording MBID for plugin. A wildcard: Plex part keys keep their slashes",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "Requested output codec: mp3, opus, flac, or raw",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_bitrate",
            "in": "query",
            "description": "Client bitrate cap in kbps (0 or unset means uncapped)",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "start_seconds",
            "in": "query",
            "description": "Seek offset in seconds for a transcode",
            "required": false,
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "estimate_content_length",
            "in": "query",
            "description": "Ask a transcode landing for its estimated Content-Length",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stream headers, no body"
          },
          "400": {
            "description": "Unknown source or unsupported format"
          },
          "401": {
            "description": "Not authenticated"
          },
          "403": {
            "description": "Playback refused"
          },
          "404": {
            "description": "Unknown audio id"
          },
          "409": {
            "description": "A format was asked for and the server is not converting"
          },
          "429": {
            "description": "Stream capacity exhausted"
          },
          "502": {
            "description": "Remote source failed the read"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/system/health": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Which external services are degraded right now.",
        "operationId": "system_health",
        "responses": {
          "200": {
            "description": "Degraded services",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemHealthResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/upgrade/continue": {
      "post": {
        "tags": [
          "upgrade"
        ],
        "summary": "Open the app: the upgrade page stops and the normal app starts in its\nplace. The next request reaches the app, which shows its own sign-in.",
        "operationId": "upgrade_continue",
        "responses": {
          "202": {
            "description": "The app is starting"
          },
          "401": {
            "description": "Not signed in to the upgrade page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "A run is under way, the folders do not hold v3 data, or another program is using them",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "upgrade_session": []
          }
        ]
      }
    },
    "/api/v3/upgrade/fresh": {
      "post": {
        "tags": [
          "upgrade"
        ],
        "summary": "Start fresh: v2's files move into the `v2-backup` folders, nothing is\nimported, and v3 starts empty. Going back to v2 still works.",
        "operationId": "upgrade_fresh",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeFreshBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "The fresh start began",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeProgressBody"
                }
              }
            }
          },
          "400": {
            "description": "Not confirmed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in to the upgrade page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "A run is under way, or the folders already hold v3 data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "upgrade_session": []
          }
        ]
      }
    },
    "/api/v3/upgrade/preflight": {
      "post": {
        "tags": [
          "upgrade"
        ],
        "summary": "Run every check the upgrade runs before it moves anything, changing\nnothing, and wait for it.",
        "operationId": "upgrade_preflight",
        "responses": {
          "200": {
            "description": "What the check found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradePreflightBody"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in to the upgrade page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "A run is under way, the folders already hold v3 data, or an upgrade did not finish",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "upgrade_session": []
          }
        ]
      }
    },
    "/api/v3/upgrade/progress": {
      "get": {
        "tags": [
          "upgrade"
        ],
        "summary": "The latest upgrade, fresh start or undo: its step, how far along, and\nits result or failure once it has ended.",
        "operationId": "upgrade_progress",
        "responses": {
          "200": {
            "description": "The latest run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeProgressBody"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in to the upgrade page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "upgrade_session": []
          }
        ]
      }
    },
    "/api/v3/upgrade/sign-in": {
      "post": {
        "tags": [
          "upgrade"
        ],
        "summary": "Sign in to the upgrade page with a v2 admin's password or the one-time\ncode from the server's log. Attempts are limited per address, and\npasswords per username too.",
        "operationId": "upgrade_sign_in",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeSignInBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Signed in; the upgrade cookie is set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeStateBody"
                }
              }
            }
          },
          "401": {
            "description": "The sign-in did not pass",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many attempts from this address or for this username",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/upgrade/start": {
      "post": {
        "tags": [
          "upgrade"
        ],
        "summary": "Start the upgrade. On v2 data it needs a pre-flight with nothing to fix\nand every address change it listed acknowledged. An interrupted upgrade\nis finished: the tool puts the v2 files back first, then upgrades.",
        "operationId": "upgrade_start",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeStartBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "The upgrade started",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeProgressBody"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in to the upgrade page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "No pre-flight, something to fix, an address change not acknowledged, a run under way, or nothing to upgrade",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "upgrade_session": []
          }
        ]
      }
    },
    "/api/v3/upgrade/state": {
      "get": {
        "tags": [
          "upgrade"
        ],
        "summary": "Where the upgrade stands, and whether this caller is signed in to the\nupgrade page.",
        "operationId": "upgrade_state",
        "responses": {
          "200": {
            "description": "Where the upgrade stands",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeStateBody"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/api/v3/upgrade/undo": {
      "post": {
        "tags": [
          "upgrade"
        ],
        "summary": "Go back to v2: the v3 data is deleted and v2's files come back from the\nbackup. Also finishes going back from an interrupted upgrade.",
        "operationId": "upgrade_undo",
        "responses": {
          "202": {
            "description": "Going back to v2 began",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeProgressBody"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in to the upgrade page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "A run is under way, or the folders already hold v2 data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "upgrade_session": []
          }
        ]
      }
    },
    "/api/v3/users/directory": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "The id and display name of every user who set a display name, for\npicking whom to share with.",
        "operationId": "user_directory",
        "responses": {
          "200": {
            "description": "Users by display name",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserDirectoryResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/users/{id}/avatar": {
      "get": {
        "tags": [
          "users"
        ],
        "summary": "Serve one user's avatar. Self-or-admin; the `v` query is ignored.",
        "operationId": "get_avatar",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Avatar bytes"
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/version": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Running version.",
        "operationId": "get_version",
        "responses": {
          "200": {
            "description": "Running build identity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionInfo"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/version/check-update": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Update check against the latest known release.",
        "operationId": "check_update",
        "responses": {
          "200": {
            "description": "Update check result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateCheckResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/version/releases": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Release history, newest first.",
        "operationId": "get_releases",
        "responses": {
          "200": {
            "description": "Release history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GitHubRelease"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/wrapped/server": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Server-wide year-in-review summary.",
        "operationId": "get_wrapped_server",
        "responses": {
          "200": {
            "description": "Server summary",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerWrappedResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing wrapped API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "wrapped_key": []
          }
        ]
      }
    },
    "/api/v3/wrapped/user/{user_id}": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Per-user year-in-review summary.",
        "operationId": "get_wrapped_user",
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "description": "User id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Per-user summary, possibly empty",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWrappedResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing wrapped API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "wrapped_key": []
          }
        ]
      }
    },
    "/api/v3/wrapped/users": {
      "get": {
        "tags": [
          "platform"
        ],
        "summary": "Every user with its ListenBrainz link status. Callers match users by\nemail and request `/user/{user_id}` only for `has_listenbrainz` ones.",
        "operationId": "get_wrapped_users",
        "responses": {
          "200": {
            "description": "User listing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WrappedUsersResponse"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing wrapped API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "wrapped_key": []
          }
        ]
      }
    },
    "/api/v3/youtube/generate": {
      "post": {
        "tags": [
          "youtube"
        ],
        "summary": "Find and save a full-album video. A saved one answers without a search.",
        "operationId": "generate_link",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YouTubeLinkGenerateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved link and today's budget",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YouTubeLinkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "YouTube had no video for the album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "YouTube search is not set up (NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Today's search budget is spent (RATE_LIMITED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "502": {
            "description": "YouTube failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "YouTube is down or its daily quota is spent (PROVIDER_UNAVAILABLE, with retry_after)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/youtube/generate-track": {
      "post": {
        "tags": [
          "youtube"
        ],
        "summary": "Find and save one track's video. A saved one answers without a search.",
        "operationId": "generate_track_link",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YouTubeTrackLinkGenerateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved track link and today's budget",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YouTubeTrackLinkResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "YouTube had no video for the track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "YouTube search is not set up (NOT_CONFIGURED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Today's search budget is spent (RATE_LIMITED)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "502": {
            "description": "YouTube failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "YouTube is down or its daily quota is spent (PROVIDER_UNAVAILABLE, with retry_after)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/youtube/generate-tracks": {
      "post": {
        "tags": [
          "youtube"
        ],
        "summary": "Find and save videos for many tracks. Tracks YouTube has nothing for,\nor that could not be searched, come back under `failed`.",
        "operationId": "generate_track_links",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YouTubeTrackLinkBatchGenerateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved track links, failures and today's budget",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YouTubeTrackLinkBatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request body or too many tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/youtube/link/{album_id}": {
      "get": {
        "tags": [
          "youtube"
        ],
        "summary": "One album's saved link. 204 when there is none.",
        "operationId": "get_link",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Saved link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YouTubeLink"
                }
              }
            }
          },
          "204": {
            "description": "No link saved for the album"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "youtube"
        ],
        "summary": "Edit a saved link: video, names or cover.",
        "operationId": "update_link",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YouTubeLinkUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Edited link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YouTubeLink"
                }
              }
            }
          },
          "400": {
            "description": "Bad body or not a YouTube URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No link saved for the album",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "youtube"
        ],
        "summary": "Remove an album link and its track links.",
        "operationId": "delete_link",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed, or nothing was saved"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/youtube/links": {
      "get": {
        "tags": [
          "youtube"
        ],
        "summary": "Every saved album link, newest first.",
        "operationId": "list_links",
        "responses": {
          "200": {
            "description": "Saved links",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/YouTubeLink"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/youtube/manual": {
      "post": {
        "tags": [
          "youtube"
        ],
        "summary": "Save a video a person pasted, for a known album or a made-up one.",
        "operationId": "save_manual_link",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/YouTubeManualLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Saved link",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/YouTubeLink"
                }
              }
            }
          },
          "400": {
            "description": "Bad body or not a YouTube URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/api/v3/youtube/track-links/{album_id}": {
      "get": {
        "tags": [
          "youtube"
        ],
        "summary": "One album's track links, in disc then track order.",
        "operationId": "list_track_links",
        "parameters": [
          {
            "name": "album_id",
            "in": "path",
            "description": "Album id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Saved track links",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/YouTubeTrackLink"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": [
              "user"
            ]
          }
        ]
      }
    },
    "/health": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Liveness probe. Public, unauthenticated, cheap.",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "Server is running",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "The generated OpenAPI document feeding the TypeScript pipeline.",
        "operationId": "openapi_json",
        "responses": {
          "200": {
            "description": "This API document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptRecycleBinFolderBody": {
        "type": "object",
        "description": "The folder an admin chooses as the recycle bin.",
        "required": [
          "path"
        ],
        "properties": {
          "path": {
            "type": "string",
            "description": "The recycle bin path the warning was shown for."
          }
        }
      },
      "AccountMode": {
        "type": "string",
        "description": "Whose account a source is reached through.",
        "enum": [
          "linked",
          "shared"
        ]
      },
      "AcknowledgedWarning": {
        "type": "object",
        "description": "An address change the caller has made at the outside service, as the\npre-flight listed it.",
        "required": [
          "feature"
        ],
        "properties": {
          "feature": {
            "$ref": "#/components/schemas/UpgradeCallbackFeature",
            "description": "The feature the change concerns."
          },
          "new_address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeAddress"
              }
            ],
            "description": "The address v3 uses, as the pre-flight gave it."
          },
          "old_address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeAddress"
              }
            ],
            "description": "The address v2 registered, as the pre-flight gave it."
          }
        }
      },
      "ActionResponse": {
        "type": "object",
        "description": "Mutation outcome for approve/reject/cancel/retry/clear.",
        "required": [
          "success",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human outcome."
          },
          "success": {
            "type": "boolean",
            "description": "Whether the action applied."
          }
        }
      },
      "ActiveCountResponse": {
        "type": "object",
        "description": "Bare count shape for badges.",
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32",
            "description": "Row count.",
            "minimum": 0
          }
        }
      },
      "ActiveRequestsResponse": {
        "type": "object",
        "description": "Active-requests list.",
        "required": [
          "items",
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32",
            "description": "Row count.",
            "minimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestItem"
            },
            "description": "Active rows."
          }
        }
      },
      "ActivityChanged": {
        "type": "object",
        "description": "`activity.changed`: the library's activity revisions moved. Sent to\neveryone; the web UI refetches library activity, or the catalog when\n`catalog` moved.",
        "required": [
          "id",
          "revisions"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable id of this revision set (`activity:` plus 16 hex digits). The\nstream also sends it as the SSE `id:` line."
          },
          "revisions": {
            "type": "object",
            "description": "Revision per stream: `scan`, `identification`, `operation` and\n`catalog`.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ActivityItem": {
        "type": "object",
        "description": "One activity strip card.",
        "required": [
          "kind",
          "state",
          "label",
          "processed",
          "total",
          "indeterminate",
          "updated_at",
          "started_at",
          "waiting_count",
          "identified_count",
          "kept_local_count",
          "needs_review_count",
          "failed_count",
          "deferred_count",
          "deferred_reason_counts",
          "deferred_jobs",
          "attention_count",
          "priority_band",
          "oldest_backlog_at",
          "provider_unavailable",
          "control_revision",
          "failure_event_id",
          "failure_at",
          "foreground_operation_count"
        ],
        "properties": {
          "attention_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "control_revision": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Pause switch revision to send back with pause or resume.",
            "minimum": 0
          },
          "deferred_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "deferred_jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeferredJobView"
            }
          },
          "deferred_reason_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "failed_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "failure_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "failure_event_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "foreground_operation_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "identified_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "indeterminate": {
            "type": "boolean",
            "description": "True when the total is not known yet."
          },
          "kept_local_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "kind": {
            "$ref": "#/components/schemas/ActivityKind"
          },
          "label": {
            "type": "string"
          },
          "needs_review_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "oldest_backlog_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "priority_band": {
            "type": [
              "string",
              "null"
            ],
            "description": "The queue band the next job comes from."
          },
          "processed": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "provider_unavailable": {
            "type": "boolean",
            "description": "True while MusicBrainz is unreachable."
          },
          "started_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "state": {
            "$ref": "#/components/schemas/ActivityState"
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          },
          "waiting_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ActivityKind": {
        "type": "string",
        "description": "What one activity card describes.",
        "enum": [
          "scan",
          "identification"
        ]
      },
      "ActivityState": {
        "type": "string",
        "description": "What a card's work is doing: a scan run's state, or identification's.",
        "enum": [
          "queued",
          "discovering",
          "indexing",
          "reconciling",
          "running",
          "pausing",
          "paused",
          "stopping",
          "idle",
          "completed",
          "cancelled",
          "superseded_policy_changed",
          "failed"
        ]
      },
      "AddTracksBody": {
        "type": "object",
        "description": "Add-tracks body.",
        "required": [
          "tracks"
        ],
        "properties": {
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Insert position. Missing appends; past-the-end clamps.",
            "minimum": 0
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackInput"
            },
            "description": "Tracks to append or insert."
          }
        }
      },
      "AddTracksResponse": {
        "type": "object",
        "description": "Added-tracks answer.",
        "required": [
          "tracks"
        ],
        "properties": {
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaylistTrack"
            },
            "description": "The added tracks with their ids and positions."
          }
        }
      },
      "AdminAppPasswordListResponse": {
        "type": "object",
        "description": "Every active app password across users.",
        "required": [
          "app_passwords"
        ],
        "properties": {
          "app_passwords": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdminAppPasswordView"
            },
            "description": "Active app passwords, by owner then age."
          }
        }
      },
      "AdminAppPasswordView": {
        "type": "object",
        "description": "One app password with its owner, for admin oversight.",
        "required": [
          "id",
          "user_id",
          "owner_username",
          "owner_display_name",
          "name",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time, unix seconds."
          },
          "id": {
            "type": "string",
            "description": "Row id."
          },
          "last_client": {
            "type": [
              "string",
              "null"
            ],
            "description": "Client label from the last verification, when sent."
          },
          "last_used_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Last verification time, unix seconds."
          },
          "name": {
            "type": "string",
            "description": "Name."
          },
          "owner_display_name": {
            "type": "string",
            "description": "Owner display name."
          },
          "owner_username": {
            "type": "string",
            "description": "Owner username or display fallback."
          },
          "user_id": {
            "type": "string",
            "description": "Owning user id."
          }
        }
      },
      "AdminUserCreate": {
        "type": "object",
        "description": "Admin user creation.",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name; defaults to the username casing."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional email."
          },
          "password": {
            "type": "string",
            "description": "Initial password, at least 12 chars."
          },
          "role": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Role"
              }
            ],
            "description": "Defaults to `user`."
          },
          "username": {
            "type": "string",
            "description": "Login username, 3-32 chars."
          }
        }
      },
      "AdminUserListResponse": {
        "type": "object",
        "description": "Admin user listing.",
        "required": [
          "users",
          "total"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total user count.",
            "minimum": 0
          },
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserResponse"
            },
            "description": "One page of users."
          }
        }
      },
      "AdvancedSettings": {
        "type": "object",
        "description": "Advanced tuning: discover queue, AudioDB, images and retention.",
        "properties": {
          "audiodb_api_key": {
            "type": "string",
            "description": "AudioDB key (encrypted at rest; v2 stored it plaintext). A missing\nfield reads as empty (then the read path falls back to the \"123\"\ndefault); only an explicitly stored value decrypts.",
            "default": ""
          },
          "audiodb_enabled": {
            "type": "boolean",
            "description": "AudioDB master switch.",
            "default": true
          },
          "audiodb_name_search_fallback": {
            "type": "boolean",
            "description": "AudioDB name-search fallback.",
            "default": false
          },
          "direct_remote_images_enabled": {
            "type": "boolean",
            "description": "Direct remote images.",
            "default": true
          },
          "discover_blend_listening_services": {
            "type": "boolean",
            "description": "Whether Discover blends Last.fm and ListenBrainz for a user who\nlinks both, instead of following only their primary service.",
            "default": true
          },
          "discover_picks_count": {
            "type": "integer",
            "format": "int64",
            "description": "Discover picks count.",
            "default": 12
          },
          "discover_picks_genre_affinity_weight": {
            "type": "number",
            "format": "double",
            "description": "Discover genre-affinity weight.",
            "default": 0.7
          },
          "discover_queue_albums_per_similar": {
            "type": "integer",
            "format": "int64",
            "description": "Albums taken per similar artist.",
            "default": 5
          },
          "discover_queue_auto_generate": {
            "type": "boolean",
            "description": "Discover queue auto-generate.",
            "default": true
          },
          "discover_queue_lastfm_mbid_max_lookups": {
            "type": "integer",
            "format": "int64",
            "description": "MusicBrainz lookups one Last.fm album batch may spend.",
            "default": 10
          },
          "discover_queue_seed_artists": {
            "type": "integer",
            "format": "int64",
            "description": "Discover seed artists.",
            "default": 3
          },
          "discover_queue_similar_artists_limit": {
            "type": "integer",
            "format": "int64",
            "description": "Similar artists fetched per seed artist.",
            "default": 15
          },
          "discover_queue_size": {
            "type": "integer",
            "format": "int64",
            "description": "Discover queue size.",
            "default": 10
          },
          "discover_queue_warm_cycle_build": {
            "type": "boolean",
            "description": "Whether the background warm cycle may build queue decks.",
            "default": true
          },
          "discover_queue_wildcard_slots": {
            "type": "integer",
            "format": "int64",
            "description": "Discover wildcard slots.",
            "default": 2
          },
          "ignored_releases_retention_days": {
            "type": "integer",
            "format": "int64",
            "description": "Ignored-releases retention days.",
            "default": 365
          },
          "prefer_local_cover_art": {
            "type": "boolean",
            "description": "Prefer local cover art.",
            "default": true
          },
          "request_history_retention_days": {
            "type": "integer",
            "format": "int64",
            "description": "Request-history retention days.",
            "default": 180
          },
          "store_prune_interval_hours": {
            "type": "integer",
            "format": "int64",
            "description": "Store-prune cadence hours.",
            "default": 6
          }
        }
      },
      "AggregateScope": {
        "type": "string",
        "description": "Which roots a scan run covers.",
        "enum": [
          "all",
          "selected"
        ]
      },
      "AlbumBasicInfo": {
        "type": "object",
        "description": "`GET /albums/{album_id}/basic`: the album header.",
        "required": [
          "title",
          "musicbrainz_id",
          "artist_name",
          "artist_id",
          "in_library",
          "requested",
          "source",
          "service_status"
        ],
        "properties": {
          "album_thumb_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album thumbnail already cached from TheAudioDB."
          },
          "artist_id": {
            "type": "string",
            "description": "Artist MBID, empty when the credit has none."
          },
          "artist_name": {
            "type": "string",
            "description": "Credited artist."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The album's cover, served by the covers route."
          },
          "disambiguation": {
            "type": [
              "string",
              "null"
            ],
            "description": "Disambiguation comment."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when the library holds this album."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Canonical release-group MBID."
          },
          "release_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "First release date."
          },
          "requested": {
            "type": "boolean",
            "description": "True when an acquisition request is open for it."
          },
          "service_status": {
            "$ref": "#/components/schemas/Option",
            "description": "Sources that degraded while building the page."
          },
          "source": {
            "$ref": "#/components/schemas/CatalogSource",
            "description": "Where the page came from."
          },
          "title": {
            "type": "string",
            "description": "Album title."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary type (`Album`, `EP`, ...)."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "First release year."
          }
        }
      },
      "AlbumDetailView": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AlbumView"
          },
          {
            "type": "object",
            "required": [
              "row_revision",
              "listing_revision"
            ],
            "properties": {
              "listing_revision": {
                "type": "integer",
                "format": "int64",
                "description": "Moves when the album is renamed or a track joins or leaves it. A\nremoval sends it back beside `row_revision`."
              },
              "management_hold": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ManagementHoldView"
                  }
                ],
                "description": "Set when library management leaves this album's files alone."
              },
              "pending_review_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The album's pending identification review, if any."
              },
              "row_revision": {
                "type": "integer",
                "format": "int64",
                "description": "The album row's revision, which a change to its grouping and its\nremoval echo."
              }
            }
          }
        ],
        "description": "One catalog album with what its own page shows."
      },
      "AlbumEditionItem": {
        "type": "object",
        "description": "One edition (MusicBrainz release) of an album.",
        "required": [
          "release_mbid",
          "track_count",
          "is_owned",
          "is_pinned"
        ],
        "properties": {
          "barcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Barcode, when known."
          },
          "catalog_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "First catalog number, when known."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release country."
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release date."
          },
          "disambiguation": {
            "type": [
              "string",
              "null"
            ],
            "description": "Disambiguation (`deluxe edition`, `remaster`)."
          },
          "disc_count": {
            "type": "integer",
            "format": "int32",
            "description": "Number of discs (media), when known.",
            "minimum": 0
          },
          "is_owned": {
            "type": "boolean",
            "description": "True when the library's copy is this edition."
          },
          "is_pinned": {
            "type": "boolean",
            "description": "True when a person chose this edition for the library's copy."
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "First label, when known."
          },
          "media_formats": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Media formats (`CD`, `Digital Media`, `12\" Vinyl`), in disc order."
          },
          "packaging": {
            "type": [
              "string",
              "null"
            ],
            "description": "Packaging."
          },
          "release_mbid": {
            "type": "string",
            "description": "Release MBID."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Status (`Official`, `Promotion`, ...)."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release title."
          },
          "track_count": {
            "type": "integer",
            "format": "int32",
            "description": "Tracks across all media.",
            "minimum": 0
          }
        }
      },
      "AlbumEditionsResponse": {
        "type": "object",
        "description": "`GET /albums/{album_id}/editions`.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumEditionItem"
            },
            "description": "Every edition MusicBrainz lists."
          },
          "owned_release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owned edition, if identified."
          },
          "pinned_release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The edition a person chose for the library's copy, if any."
          },
          "selected_basis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why that edition: `chosen` (by a person), `owned` (the best fit for\nthe library's files), `file_count` or `preferred` (the edition\npreferences, for an album the library does not hold)."
          },
          "selected_release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The edition the album page shows."
          }
        }
      },
      "AlbumEnrichment": {
        "type": "object",
        "description": "Enriched album counts. Absent counts mean unknown, never zero.",
        "required": [
          "musicbrainz_id"
        ],
        "properties": {
          "listen_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Listen count, when the provider reported one."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Echoed provider release-group id."
          },
          "track_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Known track count, when the provider reported one."
          }
        }
      },
      "AlbumEnrichmentRequest": {
        "type": "object",
        "description": "One album row to enrich.",
        "required": [
          "musicbrainz_id"
        ],
        "properties": {
          "album_name": {
            "type": "string",
            "description": "Album name, a fallback key for providers without the id."
          },
          "artist_name": {
            "type": "string",
            "description": "Album artist name, a fallback key for providers without the id."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Provider release-group id."
          }
        }
      },
      "AlbumFormatCount": {
        "type": "object",
        "description": "How many albums one primary format has.",
        "required": [
          "format",
          "album_count"
        ],
        "properties": {
          "album_count": {
            "type": "integer",
            "format": "int64",
            "description": "Listed albums whose most common track format it is.",
            "minimum": 0
          },
          "format": {
            "type": "string",
            "description": "Lowercased format, e.g. `flac`."
          }
        }
      },
      "AlbumFormatCounts": {
        "type": "object",
        "description": "Every primary format the album list has, for its format filter.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumFormatCount"
            },
            "description": "Formats by descending album count, name tiebreak."
          }
        }
      },
      "AlbumHistoryByView": {
        "type": "string",
        "description": "Who asked for a join or an undo.",
        "enum": [
          "you",
          "person"
        ]
      },
      "AlbumHistoryEntryView": {
        "type": "object",
        "description": "One line of an album's history.",
        "required": [
          "kind",
          "at",
          "track_count",
          "track_titles"
        ],
        "properties": {
          "at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix milliseconds."
          },
          "by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AlbumHistoryByView"
              }
            ],
            "description": "Who asked, for `retag_joined` and the undo entries; null when the\napp did it."
          },
          "kind": {
            "$ref": "#/components/schemas/AlbumHistoryKindView"
          },
          "other_album_title": {
            "type": [
              "string",
              "null"
            ],
            "description": "The other album's title, for a join, a fold or its undo; null when\nits row is gone."
          },
          "track_count": {
            "type": "integer",
            "description": "How many tracks the entry is about; 0 for album entries.",
            "minimum": 0
          },
          "track_titles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The first five of those tracks' titles, in album order."
          },
          "undo_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a `leftover_joined`, `copies_joined` or `artist_from_tracks`\nentry that can be undone now, the id to undo it by; null otherwise."
          }
        }
      },
      "AlbumHistoryKindView": {
        "type": "string",
        "description": "What one history entry tells.",
        "enum": [
          "tracks_continued",
          "tracks_replaced",
          "retag_joined",
          "retag_half_left_alone",
          "retag_dismissal_ended",
          "leftover_joined",
          "copies_joined",
          "marks_followed",
          "tracks_other_music",
          "tracks_new_copy",
          "artist_from_tracks",
          "edition_changed",
          "edition_chosen",
          "match_withdrawn",
          "edition_change_undone",
          "fold_undone",
          "unfolded_from",
          "hand_back_given_up"
        ]
      },
      "AlbumHistoryView": {
        "type": "object",
        "description": "An album's history, newest first: at most ten entries, none older than\n180 days.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumHistoryEntryView"
            }
          }
        }
      },
      "AlbumIntake": {
        "type": "object",
        "description": "Album intake body. Names may be omitted only when they resolve; intake\nhas no catalog lookup, so blank or literal-\"Unknown\" names are\nrejected.",
        "required": [
          "musicbrainz_id"
        ],
        "properties": {
          "album": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title."
          },
          "artist": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist name."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist MBID."
          },
          "auto_download_artist": {
            "type": "boolean",
            "description": "Auto-download the artist's future releases (approval-gated for users)."
          },
          "monitor_artist": {
            "type": "boolean",
            "description": "Follow the artist for new releases."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Release-group MBID."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The edition (release MBID) the page showed. An album the library\nholds is always fetched in its chosen edition; this fills in for\none it does not hold."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year."
          }
        }
      },
      "AlbumListSort": {
        "type": "string",
        "description": "How the album list is sorted.",
        "enum": [
          "name",
          "date_added",
          "year",
          "artist",
          "random",
          "rediscover"
        ]
      },
      "AlbumPage": {
        "type": "object",
        "description": "One page of catalog albums.",
        "required": [
          "items",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumView"
            },
            "description": "This page of albums."
          },
          "next": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `after` for the next page; absent on the last page."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Albums matching the filter, all pages.",
            "minimum": 0
          }
        }
      },
      "AlbumPreviewResponse": {
        "type": "object",
        "description": "Ordered 30-second samples of an album's first tracks.",
        "properties": {
          "provider": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provider that served the previews, when found."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PreviewTrackItem"
            },
            "description": "Sampled tracks in album order."
          }
        }
      },
      "AlbumRef": {
        "type": "object",
        "description": "One album as a row in a list: discover shelves, charts and the\ncatalog's discovery rows share it. Absent means unknown.",
        "required": [
          "title",
          "in_library",
          "requested"
        ],
        "properties": {
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The artist's MusicBrainz id, when known."
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Credited artist, when known."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover URL, when known."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when the library holds this album."
          },
          "listen_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Listen or play count behind the row, when known."
          },
          "local_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Native library id, when the album is owned."
          },
          "musicbrainz_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz release-group id, when known."
          },
          "release_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release date (`YYYY-MM-DD` or coarser), when known."
          },
          "requested": {
            "type": "boolean",
            "description": "True when an acquisition request is open for it."
          },
          "title": {
            "type": "string",
            "description": "Album title."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "First release year, when known."
          }
        }
      },
      "AlbumRemovalView": {
        "type": "object",
        "description": "One removal of an album whose files can be put back.",
        "required": [
          "id",
          "kind",
          "removed_at",
          "files",
          "held"
        ],
        "properties": {
          "files": {
            "type": "integer",
            "format": "int32",
            "description": "Files whose copies are still in the recycle bin.",
            "minimum": 0
          },
          "held": {
            "type": "boolean",
            "description": "A file write of the removal waits for an admin under \"Some file\nwrites need you\"; it can be put back once that is settled."
          },
          "id": {
            "type": "string",
            "description": "The removal's id, which Put back names."
          },
          "kind": {
            "$ref": "#/components/schemas/RemovalKind"
          },
          "removed_at": {
            "type": "integer",
            "format": "int64",
            "description": "When the files were removed, unix milliseconds."
          }
        }
      },
      "AlbumRemovalsView": {
        "type": "object",
        "description": "An album's removals whose files can be put back, newest first.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumRemovalView"
            }
          }
        }
      },
      "AlbumRescanResponse": {
        "type": "object",
        "description": "The rescan request's answer.",
        "required": [
          "run_id",
          "disposition",
          "state"
        ],
        "properties": {
          "disposition": {
            "$ref": "#/components/schemas/ScanDisposition"
          },
          "queued_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the run waits, when it does."
          },
          "run_id": {
            "type": "string",
            "description": "Run id (fresh or merged into a waiting run)."
          },
          "state": {
            "$ref": "#/components/schemas/ScanState",
            "description": "Run state after the request."
          }
        }
      },
      "AlbumTrack": {
        "type": "object",
        "description": "One track on an album page.",
        "required": [
          "position",
          "title",
          "disc_number"
        ],
        "properties": {
          "disc_number": {
            "type": "integer",
            "format": "int32",
            "description": "Disc number, starting at 1.",
            "minimum": 0
          },
          "length": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Length in milliseconds.",
            "minimum": 0
          },
          "media_format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Medium format (`CD`, `Digital Media`, `DVD`, ...)."
          },
          "position": {
            "type": "integer",
            "format": "int32",
            "description": "Position within its disc.",
            "minimum": 0
          },
          "recording_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recording MBID."
          },
          "release_track_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release-track MBID."
          },
          "title": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "AlbumTracksInfo": {
        "type": "object",
        "description": "`GET /albums/{album_id}/tracks`: the tracklist of the edition the page\nshows (pinned, owned, or MusicBrainz's best).",
        "required": [
          "tracks",
          "total_tracks"
        ],
        "properties": {
          "barcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Barcode."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release country."
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "First label."
          },
          "pick_basis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why that edition: `chosen` (by a person), `owned` (the best fit for\nthe library's files), `file_count` or `preferred` (the edition\npreferences, for an album the library does not hold)."
          },
          "selected_release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The edition shown."
          },
          "total_length": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Total length in milliseconds, when any track has one.",
            "minimum": 0
          },
          "total_tracks": {
            "type": "integer",
            "format": "int32",
            "description": "Track count.",
            "minimum": 0
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumTrack"
            },
            "description": "Tracks in disc and position order."
          }
        }
      },
      "AlbumView": {
        "type": "object",
        "description": "One catalog album.",
        "required": [
          "id",
          "title",
          "artist_name",
          "artist_id",
          "identity_state",
          "guess_contradicted",
          "track_count",
          "total_duration_seconds",
          "total_size_bytes",
          "is_compilation",
          "cover_available",
          "art_missing",
          "favorite"
        ],
        "properties": {
          "art_missing": {
            "type": "boolean",
            "description": "True when the server knows the cover routes the web UI would ask\nanswer 404: no art of its own, and no release group, or one whose\ncover is known missing with no other copy's art standing in. False\nmeans ask."
          },
          "artist_id": {
            "type": "string",
            "description": "Local album-artist id."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz artist id, when the artist is identified."
          },
          "artist_name": {
            "type": "string",
            "description": "Album artist display name."
          },
          "contribution_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The album's open MusicBrainz contribution, if any."
          },
          "contribution_state": {
            "type": [
              "string",
              "null"
            ],
            "description": "That contribution's state: `draft`, `ready`, `seeded`, `verifying`\nor `needs_review`."
          },
          "cover_available": {
            "type": "boolean",
            "description": "True when the album has art of its own: a folder image or an\nembedded picture."
          },
          "date_added": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Import time, unix seconds."
          },
          "expected_track_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Tracks the album's edition has: the matched MusicBrainz release's\ntracklist while the catalog holds it, else the totals its files'\ntags give; a guess the files' tags contradict counts by its tags.\n`None` when neither tells.",
            "minimum": 0
          },
          "favorite": {
            "type": "boolean",
            "description": "True when the caller favorited this album."
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Most common track format, when any track exists."
          },
          "guess_contradicted": {
            "type": "boolean",
            "description": "True when the match is a guess its files' tags contradict\n(`NAMED_GROUP_DIFFERS`). It owns no group through that guess, so the\nalbum opens as its own page, not as `release_group_mbid`'s."
          },
          "id": {
            "type": "string",
            "description": "Local album id."
          },
          "identity_state": {
            "type": "string",
            "description": "`local_only` or `linked`."
          },
          "is_compilation": {
            "type": "boolean",
            "description": "True for compilations and various-artists sets."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz release group, when identified."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz release, when an exact release is known."
          },
          "title": {
            "type": "string",
            "description": "Album title."
          },
          "total_duration_seconds": {
            "type": "number",
            "format": "double",
            "description": "Summed streamable-track duration, seconds."
          },
          "total_size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Summed streamable-track size, bytes."
          },
          "track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Streamable tracks on this album.",
            "minimum": 0
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Release year, when known."
          }
        }
      },
      "AlignmentClassification": {
        "type": "string",
        "description": "Track alignment classes from Discogs selection.",
        "enum": [
          "exact",
          "partial",
          "conflicting",
          "unmatched"
        ]
      },
      "AnalyticsItem": {
        "type": "object",
        "description": "One row of a listening top list.",
        "required": [
          "name",
          "subtitle",
          "play_count"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Artist, album, or track name."
          },
          "play_count": {
            "type": "integer",
            "format": "int64",
            "description": "Plays counted."
          },
          "subtitle": {
            "type": "string",
            "description": "Artist name for album and track rows, empty for artists."
          }
        }
      },
      "AnalyticsView": {
        "type": "object",
        "description": "Listening analytics over the server's history (Plex).",
        "required": [
          "top_artists",
          "top_albums",
          "top_tracks",
          "total_listens",
          "listens_last_7_days",
          "listens_last_30_days",
          "total_hours",
          "is_complete",
          "entries_analyzed"
        ],
        "properties": {
          "entries_analyzed": {
            "type": "integer",
            "format": "int64",
            "description": "Entries read."
          },
          "is_complete": {
            "type": "boolean",
            "description": "False when the history was longer than the analysis window."
          },
          "listens_last_30_days": {
            "type": "integer",
            "format": "int64",
            "description": "Plays in the last 30 days."
          },
          "listens_last_7_days": {
            "type": "integer",
            "format": "int64",
            "description": "Plays in the last 7 days."
          },
          "top_albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsItem"
            },
            "description": "Most-played albums."
          },
          "top_artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsItem"
            },
            "description": "Most-played artists."
          },
          "top_tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsItem"
            },
            "description": "Most-played tracks."
          },
          "total_hours": {
            "type": "number",
            "format": "double",
            "description": "Listening time in hours, one decimal."
          },
          "total_listens": {
            "type": "integer",
            "format": "int64",
            "description": "History entries counted."
          }
        }
      },
      "AppConnect": {
        "type": "object",
        "description": "Native app sign-in (\"app connect\"): the apps that may get an app\npassword for the signed-in user after the user confirms it in the\nbrowser (OAuth 2.0 authorization code with PKCE, RFC 6749/7636/8252).\nOff while the list is empty, which is the default.\n\nA section of its own, so that saving another one can never empty it.",
        "required": [
          "clients"
        ],
        "properties": {
          "clients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppConnectClient"
            },
            "description": "Up to eight apps."
          }
        }
      },
      "AppConnectClient": {
        "type": "object",
        "description": "One native app that may ask for an app password through the browser.",
        "required": [
          "client_id",
          "name",
          "redirect_uris"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "description": "What the app sends as `client_id`: 1-64 of `a-z`, `0-9`, `.`, `_`\nand `-`, starting with a letter or digit."
          },
          "name": {
            "type": "string",
            "description": "The name the confirmation page shows and the app password is\nnamed after, such as `My Player`. Never taken from the request."
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The addresses the browser may hand the result to, matched exactly:\na private-use scheme named after a domain the app's maker owns\n(`com.example.player:/connect`, RFC 8252 section 7.1) or an `https`\naddress. Up to four."
          }
        }
      },
      "AppConnectRedirect": {
        "type": "object",
        "description": "Where \"Allow\" sends the browser.",
        "required": [
          "redirect"
        ],
        "properties": {
          "redirect": {
            "type": "string",
            "description": "The app's address with the one-time `code` and the `state`."
          }
        }
      },
      "AppConnectRequestView": {
        "type": "object",
        "description": "What the confirmation page shows.",
        "required": [
          "client_id",
          "client_name",
          "password_name",
          "replaces_existing",
          "at_limit",
          "cancel_redirect"
        ],
        "properties": {
          "at_limit": {
            "type": "boolean",
            "description": "The user holds the most app passwords allowed under other names, so\nallowing would be refused until one is revoked."
          },
          "cancel_redirect": {
            "type": "string",
            "description": "Where \"Cancel\" sends the browser: the app's address with\n`error=access_denied`."
          },
          "client_id": {
            "type": "string",
            "description": "The app's id."
          },
          "client_name": {
            "type": "string",
            "description": "The app's name from the settings."
          },
          "device_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The device name the app reported, cleaned up; absent when it sent\nnone."
          },
          "password_name": {
            "type": "string",
            "description": "The name the new app password will carry."
          },
          "replaces_existing": {
            "type": "boolean",
            "description": "The user already has a live app password of that name, which\nallowing replaces."
          }
        }
      },
      "AppConnectTokenError": {
        "type": "object",
        "description": "A refused trade (400).",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/AppConnectTokenErrorCode",
            "description": "What was wrong."
          }
        }
      },
      "AppConnectTokenErrorCode": {
        "type": "string",
        "description": "Why a trade was refused, as RFC 6749 section 5.2 names it.",
        "enum": [
          "invalid_request",
          "invalid_client",
          "invalid_grant",
          "unsupported_grant_type"
        ]
      },
      "AppConnectTokenRequest": {
        "type": "object",
        "description": "The app's code trade, sent form-encoded.",
        "required": [
          "grant_type",
          "code",
          "redirect_uri",
          "client_id",
          "code_verifier"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "description": "The app's id, as in the authorization request."
          },
          "code": {
            "type": "string",
            "description": "The one-time code the browser handed back."
          },
          "code_verifier": {
            "type": "string",
            "description": "The PKCE verifier the challenge was made from."
          },
          "grant_type": {
            "type": "string",
            "description": "Must be `authorization_code`."
          },
          "redirect_uri": {
            "type": "string",
            "description": "The return address, exactly as in the authorization request."
          }
        }
      },
      "AppConnectTokenResponse": {
        "type": "object",
        "description": "The app password a trade mints.",
        "required": [
          "access_token",
          "token_type",
          "username"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "The app password, shown this once. Subsonic takes it as `apiKey`,\nor as the password next to `username`."
          },
          "token_type": {
            "$ref": "#/components/schemas/AppConnectTokenType",
            "description": "Always `Bearer`."
          },
          "username": {
            "type": "string",
            "description": "The login name of the user who allowed it."
          }
        }
      },
      "AppConnectTokenType": {
        "type": "string",
        "description": "The kind of token handed out. Libraries expect `Bearer`; the token is\nan app password, used the way any app password is.",
        "enum": [
          "Bearer"
        ]
      },
      "AppPasswordCreate": {
        "type": "object",
        "description": "Create an app password.",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name; defaults to `App password`."
          }
        }
      },
      "AppPasswordCreatedResponse": {
        "type": "object",
        "description": "A created app password. The secret appears here once, never again.",
        "required": [
          "id",
          "name",
          "secret",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time, unix seconds."
          },
          "id": {
            "type": "string",
            "description": "Row id."
          },
          "name": {
            "type": "string",
            "description": "Name."
          },
          "secret": {
            "type": "string",
            "description": "Raw secret. Shown once."
          }
        }
      },
      "AppPasswordListResponse": {
        "type": "object",
        "description": "Own app passwords.",
        "required": [
          "app_passwords"
        ],
        "properties": {
          "app_passwords": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppPasswordView"
            },
            "description": "Active app passwords, oldest first."
          }
        }
      },
      "AppPasswordView": {
        "type": "object",
        "description": "One app password, without secret material.",
        "required": [
          "id",
          "name",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time, unix seconds."
          },
          "id": {
            "type": "string",
            "description": "Row id."
          },
          "last_client": {
            "type": [
              "string",
              "null"
            ],
            "description": "Client label from the last verification, when sent."
          },
          "last_used_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Last verification time, unix seconds."
          },
          "name": {
            "type": "string",
            "description": "User-given name."
          }
        }
      },
      "Appearance": {
        "type": "object",
        "description": "Site-wide appearance. The server's appearance routes check the sheet\nbefore it is saved; the kernel only holds it.",
        "properties": {
          "allow_user_css": {
            "type": "boolean",
            "description": "Let people add their own CSS on top of the site's.",
            "default": true
          },
          "site_css": {
            "type": "string",
            "description": "CSS every signed-in page loads on top of the app's own styles.",
            "default": ""
          }
        }
      },
      "AppearanceImported": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MyAppearance",
            "description": "The caller's appearance as stored now."
          },
          {
            "type": "object",
            "required": [
              "imported"
            ],
            "properties": {
              "imported": {
                "type": "boolean",
                "description": "True when this call wrote it; false when the account already held\none and nothing changed."
              }
            }
          }
        ],
        "description": "The answer to the one-time move from the browser."
      },
      "AppearanceUpdate": {
        "type": "object",
        "description": "A change to the caller's appearance. A field left out keeps its value.",
        "properties": {
          "custom_css": {
            "$ref": "#/components/schemas/CustomCssUpdate",
            "description": "The caller's own CSS."
          },
          "theme": {
            "$ref": "#/components/schemas/ThemeChoice",
            "description": "The theme to use."
          }
        }
      },
      "ApplyResult": {
        "type": "string",
        "description": "What Apply did with a finding.",
        "enum": [
          "DETACHED",
          "MAPPINGS_ACCEPTED",
          "EDITION_ACCEPTED",
          "EDITION_AUTO_ACCEPTED",
          "STALE_SUBJECT"
        ]
      },
      "ApprovalBatchItem": {
        "type": "object",
        "description": "One grouped approval card: a user's pending requests as a batch.",
        "required": [
          "batch_id",
          "user_id",
          "artist_count",
          "sample_names",
          "requested_at",
          "source"
        ],
        "properties": {
          "artist_count": {
            "type": "integer",
            "description": "Pending artist count.",
            "minimum": 0
          },
          "batch_id": {
            "type": "string",
            "description": "Batch id, stable per user while requests stay pending."
          },
          "requested_at": {
            "type": "integer",
            "format": "int64",
            "description": "Oldest request time, epoch seconds.",
            "minimum": 0
          },
          "sample_names": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "First few artist names for the card preview."
          },
          "source": {
            "type": "string",
            "description": "What produced the requests."
          },
          "user_id": {
            "type": "string",
            "description": "Requesting user id."
          },
          "user_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Requesting user display name."
          }
        }
      },
      "ApprovalBatchListResponse": {
        "type": "object",
        "description": "Approval-batch list answer.",
        "required": [
          "batches",
          "count"
        ],
        "properties": {
          "batches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalBatchItem"
            },
            "description": "Batches."
          },
          "count": {
            "type": "integer",
            "description": "Batch count.",
            "minimum": 0
          }
        }
      },
      "ApproveBody": {
        "type": "object",
        "description": "Approve a review with the curator's chosen candidate.",
        "required": [
          "candidate_key",
          "expected_revision"
        ],
        "properties": {
          "candidate_key": {
            "type": "string",
            "description": "Candidate key from the review."
          },
          "expected_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The review's `row_revision` when it was read."
          }
        }
      },
      "ArtistCreditEvidence": {
        "type": "object",
        "description": "A MusicBrainz credit proof behind one record's credit.",
        "required": [
          "subject_kind",
          "subject_id",
          "subject_name",
          "local_artist_id",
          "artist_mbid",
          "canonical_name",
          "credited_name",
          "join_phrase",
          "release_mbid",
          "album_identity_revision",
          "evidence_hash"
        ],
        "properties": {
          "album_identity_revision": {
            "type": "integer",
            "format": "int64"
          },
          "artist_mbid": {
            "type": "string"
          },
          "canonical_name": {
            "type": "string"
          },
          "credited_name": {
            "type": "string"
          },
          "evidence_hash": {
            "type": "string"
          },
          "join_phrase": {
            "type": "string"
          },
          "local_artist_id": {
            "type": "string"
          },
          "release_mbid": {
            "type": "string"
          },
          "release_track_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_local_artist_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "subject_id": {
            "type": "string"
          },
          "subject_kind": {
            "$ref": "#/components/schemas/ProofSubject"
          },
          "subject_name": {
            "type": "string"
          },
          "track_identity_revision": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "ArtistCreditSettings": {
        "type": "object",
        "description": "Artist-credit handling.",
        "properties": {
          "preferred_locales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Preferred locales.",
            "default": []
          },
          "standardization": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArtistStandardization"
              }
            ],
            "description": "Standardization level.",
            "default": "credited"
          },
          "translate_names": {
            "type": "boolean",
            "description": "Translate names.",
            "default": false
          }
        }
      },
      "ArtistDuplicateGroupDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ArtistDuplicateGroupSummary"
          },
          {
            "type": "object",
            "required": [
              "evidence",
              "releases",
              "tracks",
              "reference_counts",
              "member_revisions"
            ],
            "properties": {
              "evidence": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ArtistCreditEvidence"
                }
              },
              "member_revisions": {
                "type": "object",
                "description": "Each member's revision, to send back when dismissing.",
                "additionalProperties": {
                  "type": "integer",
                  "format": "int64"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "reference_counts": {
                "type": "object",
                "description": "Reference totals over every member, by kind.",
                "additionalProperties": {
                  "type": "integer",
                  "format": "int64"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "releases": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ArtistOwnedReference"
                }
              },
              "tracks": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ArtistOwnedReference"
                }
              }
            }
          }
        ],
        "description": "One duplicate artist group with its evidence and references."
      },
      "ArtistDuplicateGroupDismissRequest": {
        "type": "object",
        "description": "Mark a group's records as distinct people.",
        "required": [
          "expected_member_revisions"
        ],
        "properties": {
          "expected_member_revisions": {
            "type": "object",
            "description": "Every member's `row_revision` as shown; a changed member refuses.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ArtistDuplicateGroupDismissResponse": {
        "type": "object",
        "required": [
          "group_id",
          "dismissed_pairs"
        ],
        "properties": {
          "dismissed_pairs": {
            "type": "integer",
            "description": "Pairs of records now marked distinct.",
            "minimum": 0
          },
          "group_id": {
            "type": "string"
          }
        }
      },
      "ArtistDuplicateGroupListResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Page_ArtistDuplicateGroupSummary"
          },
          {
            "type": "object",
            "required": [
              "counts"
            ],
            "properties": {
              "counts": {
                "type": "object",
                "description": "Every group by state, before the filters.",
                "additionalProperties": {
                  "type": "integer",
                  "minimum": 0
                },
                "propertyNames": {
                  "type": "string"
                }
              }
            }
          }
        ],
        "description": "One page of duplicate artist groups, with the groups matching the\nfilters as its total."
      },
      "ArtistDuplicateGroupSummary": {
        "type": "object",
        "description": "One duplicate artist group.",
        "required": [
          "id",
          "display_name",
          "state",
          "member_count",
          "members",
          "provider_mbids",
          "affected_reference_count",
          "reason_code",
          "reason",
          "can_undo"
        ],
        "properties": {
          "affected_reference_count": {
            "type": "integer",
            "format": "int64",
            "description": "Credits, favorites and plays a merge would move."
          },
          "can_undo": {
            "type": "boolean",
            "description": "The merge is a join by name an administrator can undo."
          },
          "display_name": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "description": "Stable for the same set of records."
          },
          "member_count": {
            "type": "integer",
            "minimum": 0
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistReconciliationMember"
            }
          },
          "merge_basis": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ArtistMergeBasis"
              }
            ],
            "description": "What that merge rested on."
          },
          "provider_mbids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reason": {
            "$ref": "#/components/schemas/ReasonView",
            "description": "Why the group is listed and what to do about it."
          },
          "reason_code": {
            "type": "string"
          },
          "recommended_survivor_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The record a merge would keep, when the evidence names one."
          },
          "resolved_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "When an automatic merge resolved the group (unix seconds)."
          },
          "state": {
            "$ref": "#/components/schemas/ArtistGroupState"
          }
        }
      },
      "ArtistDuplicateGroupUndoResponse": {
        "type": "object",
        "description": "What undoing a join put back.",
        "required": [
          "group_id",
          "surviving_artist_id",
          "restored_artist_ids",
          "put_back",
          "left_in_place"
        ],
        "properties": {
          "group_id": {
            "type": "string"
          },
          "left_in_place": {
            "type": "object",
            "description": "Rows the join moved that changed since and stay where they are.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "put_back": {
            "type": "object",
            "description": "Rows moved back, by kind (`album_credits`, `plays`, `favorites`, ...).",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "restored_artist_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The records split off again, each live once more."
          },
          "surviving_artist_id": {
            "type": "string",
            "description": "The record the join kept."
          }
        }
      },
      "ArtistEnrichment": {
        "type": "object",
        "description": "Enriched artist counts. Absent counts mean unknown, never zero.",
        "required": [
          "musicbrainz_id"
        ],
        "properties": {
          "listen_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Listen count, when the provider reported one."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Echoed provider artist id."
          },
          "release_group_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Known release-group count, when the provider reported one."
          }
        }
      },
      "ArtistEnrichmentRequest": {
        "type": "object",
        "description": "One artist row to enrich.",
        "required": [
          "musicbrainz_id"
        ],
        "properties": {
          "musicbrainz_id": {
            "type": "string",
            "description": "Provider artist id."
          },
          "name": {
            "type": "string",
            "description": "Artist name, a fallback key for providers without the id."
          }
        }
      },
      "ArtistExtendedInfo": {
        "type": "object",
        "description": "`GET /artists/{artist_mbid}/extended`: biography and portrait.",
        "required": [
          "images"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Wikipedia introduction."
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Portrait from Wikidata/Commons."
          },
          "images": {
            "$ref": "#/components/schemas/ArtistImages",
            "description": "Artist images from TheAudioDB, as far as they are cached. A miss\nqueues a background fetch, so a later call has them."
          }
        }
      },
      "ArtistGroupState": {
        "type": "string",
        "description": "What kind of duplicate group this is.",
        "enum": [
          "waiting_for_identity",
          "provider_conflict",
          "ambiguous_credit_structure",
          "same_name_only",
          "credits_moved",
          "shared_provider_identity",
          "resolved_automatically"
        ]
      },
      "ArtistImageCredit": {
        "type": "object",
        "description": "The credit an artist's picture asks for.",
        "required": [
          "credit"
        ],
        "properties": {
          "credit": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PhotoCredit"
              }
            ],
            "description": "`null` when the picture asks for none, or no picture is held."
          }
        }
      },
      "ArtistImages": {
        "type": "object",
        "description": "Artist images from TheAudioDB. Every field is optional.",
        "properties": {
          "banner_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Banner."
          },
          "clearart_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Clear art."
          },
          "cutout_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cutout."
          },
          "fanart_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fanart."
          },
          "fanart_url_2": {
            "type": [
              "string",
              "null"
            ],
            "description": "Second fanart."
          },
          "fanart_url_3": {
            "type": [
              "string",
              "null"
            ],
            "description": "Third fanart."
          },
          "fanart_url_4": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fourth fanart."
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Logo."
          },
          "thumb_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Thumbnail."
          },
          "wide_thumb_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Wide thumbnail."
          }
        }
      },
      "ArtistIndex": {
        "type": "object",
        "description": "Full artist index.",
        "required": [
          "index"
        ],
        "properties": {
          "index": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistIndexEntry"
            },
            "description": "Alphabetic buckets."
          }
        }
      },
      "ArtistIndexEntry": {
        "type": "object",
        "description": "One alphabetic bucket of the artist index.",
        "required": [
          "name",
          "artists"
        ],
        "properties": {
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesArtistView"
            },
            "description": "Artists in this bucket."
          },
          "name": {
            "type": "string",
            "description": "Bucket label, e.g. \"A\"."
          }
        }
      },
      "ArtistInfo": {
        "type": "object",
        "description": "`GET /artists/{artist_mbid}`: the artist header.",
        "required": [
          "name",
          "musicbrainz_id",
          "tags",
          "aliases",
          "external_links",
          "images",
          "in_library",
          "appears_in_library",
          "albums",
          "singles",
          "eps",
          "release_group_count",
          "followed",
          "auto_download",
          "auto_download_state",
          "source",
          "service_status"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseItem"
            },
            "description": "Albums, newest first, filtered by the release-type preferences."
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Up to ten aliases."
          },
          "appears_in_library": {
            "type": "boolean",
            "description": "True when the artist appears on a library album led by someone else\n(a guest or featured credit), whatever they lead themselves."
          },
          "auto_download": {
            "type": "boolean",
            "description": "Whether the caller asked for new releases to download on their own."
          },
          "auto_download_state": {
            "$ref": "#/components/schemas/AutoDownloadState",
            "description": "Approval state of that ask."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO country code."
          },
          "disambiguation": {
            "type": [
              "string",
              "null"
            ],
            "description": "Disambiguation comment."
          },
          "eps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseItem"
            },
            "description": "EPs, newest first."
          },
          "external_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalLink"
            },
            "description": "Known streaming, store, social and reference links."
          },
          "followed": {
            "type": "boolean",
            "description": "Whether the caller follows the artist."
          },
          "images": {
            "$ref": "#/components/schemas/ArtistImages",
            "description": "Artist images already cached from TheAudioDB. The extended route\nfetches them, so a first visit may show none."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when the library holds an album credited to this artist with\nat least one playable track."
          },
          "life_span": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LifeSpan"
              }
            ],
            "description": "Life span."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Canonical artist MBID (after any MusicBrainz merge redirect)."
          },
          "name": {
            "type": "string",
            "description": "Artist name."
          },
          "release_group_count": {
            "type": "integer",
            "format": "int64",
            "description": "Release groups MusicBrainz lists for the artist, before filtering.",
            "minimum": 0
          },
          "service_status": {
            "$ref": "#/components/schemas/Option",
            "description": "Sources that degraded while building the page."
          },
          "singles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseItem"
            },
            "description": "Singles, newest first."
          },
          "source": {
            "$ref": "#/components/schemas/CatalogSource",
            "description": "Where the page came from."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Up to ten tags, most voted first."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist type (`Person`, `Group`, ...)."
          }
        }
      },
      "ArtistLinkByView": {
        "type": "string",
        "description": "Who set an artist's link, as the caller may know it.",
        "enum": [
          "you",
          "person",
          "app",
          "v2"
        ]
      },
      "ArtistLinkSourceView": {
        "type": "string",
        "description": "Who decided an artist's link.",
        "enum": [
          "app",
          "person",
          "v2"
        ]
      },
      "ArtistLinkView": {
        "type": "object",
        "description": "An artist's MusicBrainz link.",
        "required": [
          "artist_id",
          "artist_revision"
        ],
        "properties": {
          "artist_id": {
            "type": "string"
          },
          "artist_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The revision a change must name."
          },
          "musicbrainz_artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The linked MusicBrainz artist id; null when there is none."
          },
          "selected_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "When it was set, unix milliseconds; null when there is no link."
          },
          "set_by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ArtistLinkByView"
              }
            ],
            "description": "Null when there is no link."
          },
          "source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ArtistLinkSourceView"
              }
            ],
            "description": "Null when there is no link."
          }
        }
      },
      "ArtistListScope": {
        "type": "string",
        "description": "Which artists the artist list covers.",
        "enum": [
          "all",
          "album_artists",
          "contributors"
        ]
      },
      "ArtistListSort": {
        "type": "string",
        "description": "How the artist list is sorted.",
        "enum": [
          "name",
          "album_count",
          "appearance_count",
          "date_added"
        ]
      },
      "ArtistMergeApplyBody": {
        "type": "object",
        "description": "A previewed artist merge to apply.",
        "required": [
          "source_artist_ids",
          "surviving_artist_id",
          "preview_token"
        ],
        "properties": {
          "expected_revisions": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "preview_token": {
            "type": "string",
            "description": "The token the preview returned."
          },
          "provider_choice": {
            "$ref": "#/components/schemas/ProviderChoiceBody"
          },
          "source_artist_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "surviving_artist_id": {
            "type": "string"
          }
        }
      },
      "ArtistMergeBasis": {
        "type": "string",
        "description": "What an automatic artist merge rested on.",
        "enum": [
          "musicbrainz_proof",
          "same_name",
          "v2_placeholder"
        ]
      },
      "ArtistMergePreviewBody": {
        "type": "object",
        "description": "An artist merge to preview.",
        "required": [
          "source_artist_ids",
          "surviving_artist_id"
        ],
        "properties": {
          "expected_revisions": {
            "type": "object",
            "description": "Artist revisions as the page showed them; zero or missing means\nunknown.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "provider_choice": {
            "$ref": "#/components/schemas/ProviderChoiceBody",
            "description": "What the survivor keeps when the artists name different MusicBrainz\nartists; the apply must send the same choice."
          },
          "source_artist_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The duplicates (the survivor may be listed too)."
          },
          "surviving_artist_id": {
            "type": "string",
            "description": "The artist everything moves to."
          }
        }
      },
      "ArtistMergePreviewResponse": {
        "type": "object",
        "description": "An artist merge preview.",
        "required": [
          "preview_token",
          "surviving_artist_id",
          "identity_conflicts",
          "aliases",
          "reference_counts"
        ],
        "properties": {
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Artist ids that will point at the survivor."
          },
          "identity_conflicts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Competing MusicBrainz artists."
          },
          "preview_token": {
            "type": "string",
            "description": "Send this back to apply exactly this merge (valid 15 minutes)."
          },
          "reference_counts": {
            "type": "object",
            "description": "References that move to the survivor, by kind.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "surviving_artist_id": {
            "type": "string",
            "description": "The artist everything moves to."
          }
        }
      },
      "ArtistOwnedReference": {
        "type": "object",
        "description": "An album or track the group's records are credited on.",
        "required": [
          "id",
          "name",
          "row_revision",
          "identity_ready",
          "exact_track_mapping_ready"
        ],
        "properties": {
          "exact_track_mapping_ready": {
            "type": "boolean",
            "description": "Every indexed file maps to a track of that release."
          },
          "id": {
            "type": "string"
          },
          "identity_ready": {
            "type": "boolean",
            "description": "The album is matched to a MusicBrainz release."
          },
          "name": {
            "type": "string"
          },
          "row_revision": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ArtistPage": {
        "type": "object",
        "description": "One page of catalog artists, with scope totals.",
        "required": [
          "items",
          "total",
          "album_artist_total",
          "contributor_total"
        ],
        "properties": {
          "album_artist_total": {
            "type": "integer",
            "format": "int64",
            "description": "Album artists in the catalog (ignores paging, honors `q`).",
            "minimum": 0
          },
          "contributor_total": {
            "type": "integer",
            "format": "int64",
            "description": "Contributors in the catalog (ignores paging, honors `q`).",
            "minimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistView"
            },
            "description": "This page of artists."
          },
          "next": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `after` for the next page; absent on the last page."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Artists matching the scope and filter, all pages.",
            "minimum": 0
          }
        }
      },
      "ArtistPurchaseOptionsResponse": {
        "type": "object",
        "description": "`GET /artists/{artist_mbid}/purchase-options`: the artist's own store\npages (Bandcamp, merch shop).",
        "required": [
          "links",
          "bandcamp_search_url"
        ],
        "properties": {
          "bandcamp_search_url": {
            "type": "string",
            "description": "Bandcamp search for the artist, empty when the name is unknown."
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchaseLink"
            },
            "description": "Store pages."
          }
        }
      },
      "ArtistReconciliationMember": {
        "type": "object",
        "description": "One artist record in a group, with how often it is referenced.",
        "required": [
          "id",
          "name",
          "row_revision",
          "album_credit_count",
          "track_credit_count",
          "primary_album_count",
          "favorite_count",
          "history_count",
          "proven_credit_count",
          "active_credit_count"
        ],
        "properties": {
          "active_credit_count": {
            "type": "integer",
            "format": "int64"
          },
          "album_credit_count": {
            "type": "integer",
            "format": "int64"
          },
          "disambiguation": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz's short note on the linked artist (\"US singer\"), set\nonly while another record has the same name."
          },
          "favorite_count": {
            "type": "integer",
            "format": "int64"
          },
          "history_count": {
            "type": "integer",
            "format": "int64"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "primary_album_count": {
            "type": "integer",
            "format": "int64"
          },
          "proven_credit_count": {
            "type": "integer",
            "format": "int64"
          },
          "provider_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "row_revision": {
            "type": "integer",
            "format": "int64"
          },
          "sort_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "track_credit_count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ArtistReconciliationProgress": {
        "type": "object",
        "description": "Automatic merges so far and open duplicate groups by state.",
        "required": [
          "automatically_resolved_count",
          "waiting_for_identity_count",
          "genuine_review_count",
          "provider_conflict_count",
          "ambiguous_credit_structure_count",
          "same_name_only_count"
        ],
        "properties": {
          "ambiguous_credit_structure_count": {
            "type": "integer",
            "minimum": 0
          },
          "automatically_resolved_count": {
            "type": "integer",
            "format": "int64",
            "description": "Artist records merged automatically so far."
          },
          "genuine_review_count": {
            "type": "integer",
            "description": "Groups that need an administrator's judgement.",
            "minimum": 0
          },
          "provider_conflict_count": {
            "type": "integer",
            "minimum": 0
          },
          "same_name_only_count": {
            "type": "integer",
            "minimum": 0
          },
          "waiting_for_identity_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ArtistRef": {
        "type": "object",
        "description": "One artist as a row in a list: discover shelves, charts and the\ncatalog's similar artists share it. Absent means unknown.",
        "required": [
          "name",
          "in_library"
        ],
        "properties": {
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Image URL, when known."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when the library holds this artist."
          },
          "listen_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Listen or play count behind the row, when known."
          },
          "local_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Native library id, when the artist is owned."
          },
          "musicbrainz_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz artist id, when known."
          },
          "name": {
            "type": "string",
            "description": "Artist name."
          }
        }
      },
      "ArtistReleases": {
        "type": "object",
        "description": "`GET /artists/{artist_mbid}/releases`: one page of the discography,\nfiltered by the release-type preferences. Pages run across albums, then\nEPs, then singles, each newest first.",
        "required": [
          "albums",
          "singles",
          "eps",
          "offset",
          "limit",
          "returned_count",
          "has_more",
          "warming",
          "source",
          "service_status"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseItem"
            },
            "description": "Albums on this page."
          },
          "eps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseItem"
            },
            "description": "EPs on this page."
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether another page exists."
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "description": "Echoed page size.",
            "minimum": 0
          },
          "next_offset": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Offset of the next page, when there is one.",
            "minimum": 0
          },
          "offset": {
            "type": "integer",
            "format": "int32",
            "description": "Echoed offset.",
            "minimum": 0
          },
          "returned_count": {
            "type": "integer",
            "format": "int32",
            "description": "Items on this page.",
            "minimum": 0
          },
          "service_status": {
            "$ref": "#/components/schemas/Option",
            "description": "Sources that degraded while building the page."
          },
          "singles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseItem"
            },
            "description": "Singles on this page."
          },
          "source": {
            "$ref": "#/components/schemas/CatalogSource",
            "description": "Where the list came from."
          },
          "source_total_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Total items after filtering. Absent while `warming`.",
            "minimum": 0
          },
          "warming": {
            "type": "boolean",
            "description": "True while the rest of a large discography is still being fetched\nin the background; ask again shortly for the full list."
          }
        }
      },
      "ArtistStandardization": {
        "type": "string",
        "description": "Artist credit standardization.",
        "enum": [
          "credited",
          "canonical"
        ]
      },
      "ArtistView": {
        "type": "object",
        "description": "One catalog artist.",
        "required": [
          "id",
          "name",
          "identity_state",
          "album_count",
          "track_count",
          "led_track_count",
          "appearance_album_count",
          "appearance_track_count",
          "art_missing",
          "favorite"
        ],
        "properties": {
          "album_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums where this artist is the album artist.",
            "minimum": 0
          },
          "appearance_album_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums where this artist appears without leading.",
            "minimum": 0
          },
          "appearance_track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Streamable tracks credited to this artist on albums led by someone\nelse.",
            "minimum": 0
          },
          "art_missing": {
            "type": "boolean",
            "description": "True when the server knows the picture route the web UI would ask\nanswers 404: a linked artist's picture is known missing, or an\nunlinked artist has no album art to draw from. False means ask."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz artist id, when identified."
          },
          "date_added": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "First import time, unix seconds."
          },
          "disambiguation": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz's short note on who this is (\"US singer\"), set only\nwhen another artist in the library has the same name."
          },
          "favorite": {
            "type": "boolean",
            "description": "True when the caller favorited this artist."
          },
          "id": {
            "type": "string",
            "description": "Local artist id."
          },
          "identity_state": {
            "type": "string",
            "description": "`local_only` or `linked`."
          },
          "led_track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Streamable tracks on albums this artist leads, whoever is credited\non them.",
            "minimum": 0
          },
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Streamable tracks credited to this artist.",
            "minimum": 0
          }
        }
      },
      "ArtworkKind": {
        "type": "string",
        "description": "How a genre's mosaic art is drawn.",
        "enum": [
          "collage",
          "gradient"
        ]
      },
      "ArtworkManagementSettings": {
        "type": "object",
        "description": "Artwork management block.",
        "properties": {
          "embedded_enabled": {
            "type": "boolean",
            "description": "Embed art in files.",
            "default": true
          },
          "embedded_format": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArtworkOutputFormat"
              }
            ],
            "description": "Embedded output format.",
            "default": "jpeg"
          },
          "embedded_maximum_size": {
            "type": "integer",
            "format": "int64",
            "description": "Embedded size cap (0 uncapped).",
            "default": 1200
          },
          "external_enabled": {
            "type": "boolean",
            "description": "Write external art files.",
            "default": true
          },
          "external_format": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArtworkOutputFormat"
              }
            ],
            "description": "External output format.",
            "default": "original"
          },
          "external_maximum_size": {
            "type": "integer",
            "format": "int64",
            "description": "External size cap (0 uncapped).",
            "default": 0
          },
          "local_file_patterns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Local filename patterns.",
            "default": [
              "cover.jpg",
              "cover.jpeg",
              "cover.png",
              "cover.webp",
              "folder.jpg",
              "folder.png",
              "front.jpg",
              "front.png"
            ]
          },
          "never_replace_with_smaller": {
            "type": "boolean",
            "description": "Never replace art with smaller art.",
            "default": true
          },
          "use_edition_cover": {
            "type": "boolean",
            "description": "Replace the album's cover (embedded, and its one `cover.*` file)\nwith the Cover Art Archive's front for an accepted exact release.\nThe replaced file goes to the recycle bin; Undo puts it back. Read\nonly while external artwork is on. Left out while off, so profiles\nand share codes saved before it keep their revisions and hashes.",
            "default": false
          }
        }
      },
      "ArtworkOutputFormat": {
        "type": "string",
        "description": "Artwork output format.",
        "enum": [
          "original",
          "jpeg",
          "png",
          "webp"
        ]
      },
      "AttachExistingBody": {
        "type": "object",
        "description": "Link the album to a release already on MusicBrainz.",
        "required": [
          "expected_row_revision",
          "release_mbid"
        ],
        "properties": {
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Row revision the caller last read."
          },
          "release_mbid": {
            "type": "string",
            "description": "A release from the duplicate-check result."
          }
        }
      },
      "AudioFormat": {
        "type": "string",
        "description": "Transcode target for remote playback.",
        "enum": [
          "flac",
          "mp3",
          "opus"
        ]
      },
      "AuthProvidersBody": {
        "type": "object",
        "description": "Sign-in methods the login page offers (v2 `AuthProvidersResponse`).",
        "required": [
          "local",
          "plex",
          "jellyfin",
          "oidc",
          "oidc_auto_redirect"
        ],
        "properties": {
          "jellyfin": {
            "type": "boolean",
            "description": "Jellyfin sign-in is switched on and the server is set up."
          },
          "local": {
            "type": "boolean",
            "description": "Username and password; false when `ALLOW_PASSWORD_LOGIN` is off."
          },
          "oidc": {
            "type": "boolean",
            "description": "OIDC sign-in is switched on with an issuer and client id."
          },
          "oidc_auto_redirect": {
            "type": "boolean",
            "description": "The login page starts OIDC sign-in at once (`/login?local` still\nshows the other methods); never true while `oidc` is false."
          },
          "plex": {
            "type": "boolean",
            "description": "Plex sign-in is switched on."
          }
        }
      },
      "AutoDownloadApprovalItem": {
        "type": "object",
        "description": "One pending auto-download request.",
        "required": [
          "user_id",
          "artist_mbid",
          "artist_name",
          "requested_at"
        ],
        "properties": {
          "artist_mbid": {
            "type": "string",
            "description": "Artist MBID."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "requested_at": {
            "type": "integer",
            "format": "int64",
            "description": "When it was requested, epoch seconds.",
            "minimum": 0
          },
          "user_id": {
            "type": "string",
            "description": "Requesting user id."
          },
          "user_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Requesting user display name."
          }
        }
      },
      "AutoDownloadApprovalListResponse": {
        "type": "object",
        "description": "Pending-approval list answer.",
        "required": [
          "items",
          "count",
          "granted"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "description": "Item count: pending requests only.",
            "minimum": 0
          },
          "granted": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutoDownloadApprovalItem"
            },
            "description": "Approvals already granted, which an admin may revoke."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutoDownloadApprovalItem"
            },
            "description": "Pending requests."
          }
        }
      },
      "AutoDownloadBody": {
        "type": "object",
        "description": "Auto-download-toggle body.",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "True requests auto-download; false turns it off."
          }
        }
      },
      "AutoDownloadEnqueued": {
        "type": "object",
        "description": "`auto_download_enqueued`: a followed artist's new release was queued.\nThe web UI de-duplicates on `task_id`.",
        "required": [
          "artist_mbid",
          "artist_name",
          "release_group_mbid",
          "title",
          "task_id"
        ],
        "properties": {
          "artist_mbid": {
            "type": "string",
            "description": "Followed artist."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name, empty when the poll did not carry one."
          },
          "release_group_mbid": {
            "type": "string",
            "description": "The new release group."
          },
          "task_id": {
            "type": "string",
            "description": "Download task started."
          },
          "title": {
            "type": "string",
            "description": "Release title."
          }
        }
      },
      "AutoDownloadState": {
        "type": "string",
        "description": "Auto-download state of one follow, as the routes show it.",
        "enum": [
          "none",
          "pending",
          "approved",
          "rejected",
          "revoked"
        ]
      },
      "AutomaticEditionUndoBody": {
        "type": "object",
        "description": "Undo the album's last automatic edition.",
        "required": [
          "expected_album_revision",
          "expected_identity_revision"
        ],
        "properties": {
          "expected_album_revision": {
            "type": "integer",
            "format": "int64"
          },
          "expected_identity_revision": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "AutomaticEditionUndoInfoView": {
        "type": "object",
        "description": "The revisions to echo when undoing the album's automatic edition.",
        "required": [
          "expected_album_revision",
          "expected_identity_revision"
        ],
        "properties": {
          "expected_album_revision": {
            "type": "integer",
            "format": "int64"
          },
          "expected_identity_revision": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "AutomaticEditionUndoOutcome": {
        "type": "string",
        "description": "How undoing an automatic edition ended.",
        "enum": [
          "restored",
          "cleared_to_review"
        ]
      },
      "AutomaticEditionUndoResponse": {
        "type": "object",
        "description": "What the undo did.",
        "required": [
          "local_album_id",
          "outcome"
        ],
        "properties": {
          "local_album_id": {
            "type": "string"
          },
          "outcome": {
            "$ref": "#/components/schemas/AutomaticEditionUndoOutcome"
          },
          "review_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The review the album went to, when there was no earlier identity."
          }
        }
      },
      "AutomaticGroupView": {
        "type": "object",
        "description": "Where a set of tracks ends up.",
        "required": [
          "title",
          "album_artist_name",
          "track_ids",
          "reason_code",
          "created"
        ],
        "properties": {
          "album_artist_name": {
            "type": "string"
          },
          "created": {
            "type": "boolean"
          },
          "local_album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The receiving album; null for an album the change creates."
          },
          "reason_code": {
            "type": "string",
            "description": "`MANUAL_SPLIT`, `MANUAL_MERGE`, `MANUAL_MOVE`, `AUTOMATIC_GROUPING`\nor `AUTOMATIC_NEW_ALBUM`."
          },
          "title": {
            "type": "string"
          },
          "track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AvatarUploadBody": {
        "type": "object",
        "description": "Avatar upload payload (parsed manually so the body cap applies).",
        "required": [
          "content_type",
          "image_base64"
        ],
        "properties": {
          "content_type": {
            "type": "string",
            "description": "Image content type."
          },
          "image_base64": {
            "type": "string",
            "description": "Base64 image bytes."
          }
        }
      },
      "BackupListResponse": {
        "type": "object",
        "description": "Backup listing, oldest first.",
        "required": [
          "backups",
          "keep",
          "database_in_memory"
        ],
        "properties": {
          "backups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BackupView"
            },
            "description": "Backups on disk, oldest first."
          },
          "database_in_memory": {
            "type": "boolean",
            "description": "True when the database sits on a filesystem held in memory (tmpfs\nor ramfs): it and these backups are lost when the server restarts."
          },
          "keep": {
            "type": "integer",
            "format": "int32",
            "description": "Rolling retention: the directory keeps this many.",
            "minimum": 0
          }
        }
      },
      "BackupRunResponse": {
        "type": "object",
        "description": "What one backup run produced.",
        "required": [
          "name",
          "sha256",
          "size_bytes",
          "user_version",
          "duration_ms"
        ],
        "properties": {
          "duration_ms": {
            "type": "integer",
            "format": "int64",
            "description": "How long the run took, in milliseconds.",
            "minimum": 0
          },
          "name": {
            "type": "string",
            "description": "File name of the new backup."
          },
          "sha256": {
            "type": "string",
            "description": "Hex SHA-256 of the new backup."
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "New backup size in bytes.",
            "minimum": 0
          },
          "user_version": {
            "type": "integer",
            "format": "int64",
            "description": "Schema stamp in the new backup."
          }
        }
      },
      "BackupView": {
        "type": "object",
        "description": "One backup on disk, with its manifest identity when present.",
        "required": [
          "name",
          "size_bytes"
        ],
        "properties": {
          "created_at_unix": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Manifest creation time as unix seconds, when present.",
            "minimum": 0
          },
          "name": {
            "type": "string",
            "description": "File name inside the backups directory."
          },
          "sha256": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hex SHA-256 from the manifest, when a manifest sits beside it."
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "File size in bytes.",
            "minimum": 0
          },
          "undo_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Size of the undo copies the backup holds beside it, from the\nmanifest, when present.",
            "minimum": 0
          },
          "user_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Schema stamp from the manifest, when present."
          }
        }
      },
      "BatchCancelBody": {
        "type": "object",
        "description": "Batch-cancel body. Dedupe is by exact string before lookup.",
        "required": [
          "musicbrainz_ids"
        ],
        "properties": {
          "kind": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RequestKind"
              }
            ],
            "description": "Request kind; defaults to album."
          },
          "musicbrainz_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "MBIDs to cancel."
          }
        }
      },
      "BatchCancelResponse": {
        "type": "object",
        "description": "Batch-cancel response.",
        "required": [
          "success",
          "cancelled",
          "failed",
          "message"
        ],
        "properties": {
          "cancelled": {
            "type": "integer",
            "format": "int32",
            "description": "Rows cancelled or detached.",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "format": "int32",
            "description": "Rows that failed.",
            "minimum": 0
          },
          "message": {
            "type": "string",
            "description": "Human outcome."
          },
          "success": {
            "type": "boolean",
            "description": "Whether anything was cancelled."
          }
        }
      },
      "BatchIntake": {
        "type": "object",
        "description": "Batch intake body (at most 500 rows).",
        "required": [
          "items"
        ],
        "properties": {
          "auto_download_artist": {
            "type": "boolean",
            "description": "Auto-download future releases (approval-gated for users)."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BatchItem"
            },
            "description": "Rows to request."
          },
          "monitor_artist": {
            "type": "boolean",
            "description": "Follow each artist for new releases."
          }
        }
      },
      "BatchIntakeResponse": {
        "type": "object",
        "description": "Batch intake response.",
        "required": [
          "success",
          "message",
          "requested",
          "skipped",
          "overflow",
          "status"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human outcome."
          },
          "overflow": {
            "type": "integer",
            "format": "int32",
            "description": "Rows over the batch cap; always zero (cap rejects the batch instead).",
            "minimum": 0
          },
          "requested": {
            "type": "integer",
            "format": "int32",
            "description": "Rows recorded (auto roles: rows dispatched).",
            "minimum": 0
          },
          "skipped": {
            "type": "integer",
            "format": "int32",
            "description": "Rows skipped (duplicates, in-progress, unresolvable).",
            "minimum": 0
          },
          "status": {
            "$ref": "#/components/schemas/BatchIntakeStatus",
            "description": "Batch decision."
          },
          "success": {
            "type": "boolean",
            "description": "Whether the batch recorded anything."
          }
        }
      },
      "BatchIntakeStatus": {
        "type": "string",
        "description": "What a batch ask did as a whole.",
        "enum": [
          "pending",
          "awaiting_approval",
          "already_requested",
          "failed"
        ]
      },
      "BatchItem": {
        "type": "object",
        "description": "One batch row.",
        "required": [
          "musicbrainz_id"
        ],
        "properties": {
          "album_title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist MBID."
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist name."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Release-group MBID."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year."
          }
        }
      },
      "BatchOutcome": {
        "type": "string",
        "description": "What a batch did with one album.",
        "enum": [
          "requested",
          "skipped_in_library",
          "skipped_duplicate",
          "not_requested"
        ]
      },
      "BecauseYouListenTo": {
        "type": "object",
        "description": "One \"because you listen to\" shelf: seed plus similar albums.",
        "required": [
          "seed_artist",
          "seed_artist_mbid",
          "section"
        ],
        "properties": {
          "banner_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Banner art URL, when resolved."
          },
          "fanart_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fanart URL, when resolved."
          },
          "listen_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Seed listen count backing the pick; null when the provider sent none."
          },
          "section": {
            "$ref": "#/components/schemas/ChartSection",
            "description": "Similar-albums shelf."
          },
          "seed_artist": {
            "type": "string",
            "description": "Seed artist name."
          },
          "seed_artist_mbid": {
            "type": "string",
            "description": "Seed MusicBrainz artist id."
          },
          "wide_thumb_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Wide thumbnail URL, when resolved."
          }
        }
      },
      "BinAlbumView": {
        "type": "object",
        "description": "The album a group of files came from.",
        "required": [
          "id",
          "title",
          "has_page",
          "cover_available"
        ],
        "properties": {
          "artist": {
            "type": [
              "string",
              "null"
            ]
          },
          "cover_available": {
            "type": "boolean",
            "description": "The album has art of its own, served by its artwork route."
          },
          "has_page": {
            "type": "boolean",
            "description": "The album has a page to open: it has files, or a MusicBrainz\nrelease group."
          },
          "id": {
            "type": "string",
            "description": "The local album id; the album page opens on it."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          }
        }
      },
      "BinKind": {
        "type": "string",
        "description": "What put a group of files in the bin.",
        "enum": [
          "album",
          "track",
          "extras",
          "replaced",
          "removed"
        ]
      },
      "BrainzmashActiveBinding": {
        "type": "object",
        "description": "Active BrainzMash binding (kept; the pending proposal is transient).",
        "properties": {
          "access_revision": {
            "type": "string",
            "description": "Access revision.",
            "default": ""
          },
          "consented": {
            "type": "boolean",
            "description": "Consent recorded.",
            "default": false
          },
          "disclosure_version": {
            "type": "string",
            "description": "Disclosure version.",
            "default": "brainzmash-v1"
          },
          "endpoint": {
            "type": "string",
            "description": "Pinned endpoint.",
            "default": "https://api.brainzmash.cc/ws/2"
          },
          "generation": {
            "type": "integer",
            "format": "int64",
            "description": "Source generation.",
            "default": 0
          },
          "source_id": {
            "type": "string",
            "description": "Source identity.",
            "default": ""
          },
          "verified": {
            "type": "boolean",
            "description": "Endpoint verified.",
            "default": false
          }
        }
      },
      "BrainzmashPendingProposal": {
        "type": "object",
        "description": "Transient pending BrainzMash proposal (process memory, echoed so the\nUI can drive consent/verify/activate).",
        "properties": {
          "access_revision": {
            "type": "string",
            "description": "Proposed access revision.",
            "default": ""
          },
          "consented": {
            "type": "boolean",
            "description": "Consent recorded.",
            "default": false
          },
          "disclosure_version": {
            "type": "string",
            "description": "Proposed disclosure version.",
            "default": "brainzmash-v1"
          },
          "endpoint": {
            "type": "string",
            "description": "Pinned endpoint.",
            "default": "https://api.brainzmash.cc/ws/2"
          },
          "generation": {
            "type": "integer",
            "format": "int64",
            "description": "Proposed source generation.",
            "default": 1
          },
          "source_id": {
            "type": "string",
            "description": "Proposed source identity.",
            "default": ""
          },
          "verified": {
            "type": "boolean",
            "description": "Endpoint verified.",
            "default": false
          }
        }
      },
      "BulkAction": {
        "type": "string",
        "description": "What a bulk action does to each selected review.",
        "enum": [
          "keep_tagged",
          "exclude",
          "accept"
        ]
      },
      "CacheClearBody": {
        "type": "object",
        "description": "Cache-clear request. No scope clears everything.",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/CacheClearScope",
            "description": "What to clear."
          }
        }
      },
      "CacheClearResponse": {
        "type": "object",
        "description": "What one cache clear dropped.",
        "required": [
          "message",
          "cleared_entries",
          "remaining_entries",
          "cleared_cover_images"
        ],
        "properties": {
          "cleared_cover_images": {
            "type": "integer",
            "format": "int64",
            "description": "Cover and artist images deleted from disk.",
            "minimum": 0
          },
          "cleared_entries": {
            "type": "integer",
            "format": "int64",
            "description": "Provider answers dropped.",
            "minimum": 0
          },
          "message": {
            "type": "string",
            "description": "Plain-language summary."
          },
          "remaining_entries": {
            "type": "integer",
            "format": "int64",
            "description": "Provider answers left behind.",
            "minimum": 0
          }
        }
      },
      "CacheClearScope": {
        "type": "string",
        "description": "What a cache clear drops.",
        "enum": [
          "all",
          "provider_data",
          "covers"
        ]
      },
      "CacheStatsResponse": {
        "type": "object",
        "description": "Provider data and image cache counters.",
        "required": [
          "entries",
          "sources",
          "provider_data_on",
          "cover_images",
          "cover_bytes",
          "database_bytes",
          "wal_bytes"
        ],
        "properties": {
          "cover_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Their total size in bytes.",
            "minimum": 0
          },
          "cover_images": {
            "type": "integer",
            "format": "int64",
            "description": "Cover and artist images on disk.",
            "minimum": 0
          },
          "database_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Size of the database file in bytes, 0 when it cannot be read.",
            "minimum": 0
          },
          "entries": {
            "type": "integer",
            "format": "int64",
            "description": "Provider answers held.",
            "minimum": 0
          },
          "provider_data_on": {
            "type": "boolean",
            "description": "Whether the provider cache file is working. When it is not, every\nprovider answer is fetched each time."
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderSourceStats"
            },
            "description": "Rows and bytes per provider."
          },
          "wal_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Size of its write-ahead log in bytes, 0 when there is none.",
            "minimum": 0
          }
        }
      },
      "CacheSyncCancelResponse": {
        "type": "object",
        "description": "`POST /cache/sync/cancel` answer.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "`cancelled`."
          }
        }
      },
      "CacheSyncProgress": {
        "type": "object",
        "description": "`cache.sync`: where the library image precache stands. Sent to\neveryone and replayed to new tabs, so the progress pill shows the live\nrun (or its last error) without a fetch. The same shape answers\n`GET /cache/sync/status`.",
        "required": [
          "is_syncing",
          "total_items",
          "processed_items",
          "progress_percent",
          "total_artists",
          "processed_artists",
          "total_albums",
          "processed_albums"
        ],
        "properties": {
          "current_item": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the run is working on, in words."
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the last run failed, when it did."
          },
          "is_syncing": {
            "type": "boolean",
            "description": "Whether a run is going."
          },
          "phase": {
            "type": [
              "string",
              "null"
            ],
            "description": "Current phase: `artists`, `discovery`, `albums` or\n`audiodb_prewarm`. A phase with zero items was skipped."
          },
          "processed_albums": {
            "type": "integer",
            "format": "int64",
            "description": "Albums done.",
            "minimum": 0
          },
          "processed_artists": {
            "type": "integer",
            "format": "int64",
            "description": "Artists done.",
            "minimum": 0
          },
          "processed_items": {
            "type": "integer",
            "format": "int64",
            "description": "Items done in the current phase.",
            "minimum": 0
          },
          "progress_percent": {
            "type": "integer",
            "format": "int32",
            "description": "`processed_items` as a whole percentage of `total_items`.",
            "minimum": 0
          },
          "started_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "When the run started, unix seconds."
          },
          "total_albums": {
            "type": "integer",
            "format": "int64",
            "description": "Library albums in this run.",
            "minimum": 0
          },
          "total_artists": {
            "type": "integer",
            "format": "int64",
            "description": "Library artists in this run.",
            "minimum": 0
          },
          "total_items": {
            "type": "integer",
            "format": "int64",
            "description": "Items in the current phase.",
            "minimum": 0
          }
        }
      },
      "CallOutcome": {
        "type": "string",
        "description": "What one call came back with.",
        "enum": [
          "ok",
          "not_found",
          "rate_limited",
          "failed"
        ]
      },
      "CandidateFile": {
        "type": "object",
        "description": "One file a candidate would fetch.",
        "required": [
          "filename",
          "size",
          "extension"
        ],
        "properties": {
          "bitrate": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Bitrate in kbps for lossy files."
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Advertised length in seconds."
          },
          "extension": {
            "type": "string",
            "description": "Lowercase extension."
          },
          "filename": {
            "type": "string",
            "description": "File path as the source names it."
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "description": "Size in bytes, 0 when unknown."
          }
        }
      },
      "CandidateNote": {
        "type": "object",
        "description": "Why a candidate sits where it does: one stable code and one sentence.",
        "required": [
          "code",
          "text"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/CandidateNoteCode",
            "description": "Stable code."
          },
          "text": {
            "type": "string",
            "description": "What the candidate looks like, in one sentence."
          }
        }
      },
      "CandidateNoteCode": {
        "type": "string",
        "description": "The stable code of a [`CandidateNote`].",
        "enum": [
          "complete",
          "incomplete",
          "title_conflict",
          "lengths",
          "quality",
          "no_tracklist",
          "names_album",
          "title_unclear",
          "strong",
          "weak",
          "turned_down_before"
        ]
      },
      "CandidateRefusal": {
        "type": "string",
        "description": "Why a candidate is outside the download settings. Declared in the order\nthe page names them: the first that applies is shown.",
        "enum": [
          "quality_outside_range",
          "over_size_cap",
          "ignored_term",
          "required_term_missing",
          "below_minimum_score"
        ]
      },
      "CandidateTier": {
        "type": "string",
        "description": "How strongly a candidate is recommended.",
        "enum": [
          "recommended",
          "possible",
          "refused"
        ]
      },
      "CandidateView": {
        "type": "object",
        "description": "One scored candidate inside a review.",
        "required": [
          "candidate_key",
          "release_group_mbid",
          "album_title",
          "album_artist_name",
          "score",
          "distance",
          "penalties",
          "reason_code",
          "supported_tracks",
          "contradictory_tracks",
          "track_evidence"
        ],
        "properties": {
          "album_artist_name": {
            "type": "string",
            "description": "Candidate album artist."
          },
          "album_title": {
            "type": "string",
            "description": "Candidate album title."
          },
          "candidate_key": {
            "type": "string",
            "description": "Candidate key (approve by this)."
          },
          "contradictory_tracks": {
            "type": "integer",
            "description": "Contradictory track count.",
            "minimum": 0
          },
          "distance": {
            "type": "number",
            "format": "double",
            "description": "Matcher distance, 0 for a perfect match. Albums identify on their\nown at 0.20 or less; reviews show candidates up to 0.35."
          },
          "penalties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PenaltyView"
            },
            "description": "What the distance is made of (`album`, `artist`, `tracks`,\n`missing_tracks`, `unmatched_tracks`, `album_id`, `year`,\n`media_count`), largest share first."
          },
          "reason_code": {
            "type": "string",
            "description": "Reason code."
          },
          "release_group_mbid": {
            "type": "string",
            "description": "Release-group MBID."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release MBID, when the candidate names an exact edition."
          },
          "score": {
            "type": "number",
            "format": "double",
            "description": "Match score: one minus the distance."
          },
          "supported_tracks": {
            "type": "integer",
            "description": "Supported track count.",
            "minimum": 0
          },
          "track_evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackEvidenceView"
            },
            "description": "How each of the album's files fits this release."
          }
        }
      },
      "CatalogCorrectionResponse": {
        "type": "object",
        "description": "An applied correction, as recorded in the audit row and returned.",
        "required": [
          "kind",
          "track_ids",
          "source_album_ids",
          "retired_artist_ids",
          "catalog_revision"
        ],
        "properties": {
          "catalog_revision": {
            "type": "integer",
            "format": "int64"
          },
          "kind": {
            "$ref": "#/components/schemas/CorrectionKind"
          },
          "retired_artist_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_album_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "surviving_artist_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_album_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CatalogSource": {
        "type": "string",
        "description": "Where a page's core data came from.",
        "enum": [
          "musicbrainz",
          "library"
        ]
      },
      "ChartPage_AlbumRef": {
        "type": "object",
        "description": "One page of a ranked chart.",
        "required": [
          "range_key",
          "label",
          "items",
          "offset",
          "limit",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean",
            "description": "True when more rows follow."
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One album as a row in a list: discover shelves, charts and the\ncatalog's discovery rows share it. Absent means unknown.",
              "required": [
                "title",
                "in_library",
                "requested"
              ],
              "properties": {
                "artist_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The artist's MusicBrainz id, when known."
                },
                "artist_name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Credited artist, when known."
                },
                "cover_url": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Cover URL, when known."
                },
                "in_library": {
                  "type": "boolean",
                  "description": "True when the library holds this album."
                },
                "listen_count": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int64",
                  "description": "Listen or play count behind the row, when known."
                },
                "local_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Native library id, when the album is owned."
                },
                "musicbrainz_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "MusicBrainz release-group id, when known."
                },
                "release_date": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Release date (`YYYY-MM-DD` or coarser), when known."
                },
                "requested": {
                  "type": "boolean",
                  "description": "True when an acquisition request is open for it."
                },
                "title": {
                  "type": "string",
                  "description": "Album title."
                },
                "year": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int32",
                  "description": "First release year, when known."
                }
              }
            },
            "description": "Ranked rows for the page."
          },
          "label": {
            "type": "string",
            "description": "Human range label."
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "description": "Limit behind this page."
          },
          "offset": {
            "type": "integer",
            "format": "int64",
            "description": "Offset behind this page."
          },
          "range_key": {
            "$ref": "#/components/schemas/StatsRange",
            "description": "Range behind this page."
          }
        }
      },
      "ChartPage_ArtistRef": {
        "type": "object",
        "description": "One page of a ranked chart.",
        "required": [
          "range_key",
          "label",
          "items",
          "offset",
          "limit",
          "has_more"
        ],
        "properties": {
          "has_more": {
            "type": "boolean",
            "description": "True when more rows follow."
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One artist as a row in a list: discover shelves, charts and the\ncatalog's similar artists share it. Absent means unknown.",
              "required": [
                "name",
                "in_library"
              ],
              "properties": {
                "image_url": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Image URL, when known."
                },
                "in_library": {
                  "type": "boolean",
                  "description": "True when the library holds this artist."
                },
                "listen_count": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int64",
                  "description": "Listen or play count behind the row, when known."
                },
                "local_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Native library id, when the artist is owned."
                },
                "musicbrainz_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "MusicBrainz artist id, when known."
                },
                "name": {
                  "type": "string",
                  "description": "Artist name."
                }
              }
            },
            "description": "Ranked rows for the page."
          },
          "label": {
            "type": "string",
            "description": "Human range label."
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "description": "Limit behind this page."
          },
          "offset": {
            "type": "integer",
            "format": "int64",
            "description": "Offset behind this page."
          },
          "range_key": {
            "$ref": "#/components/schemas/StatsRange",
            "description": "Range behind this page."
          }
        }
      },
      "ChartSection": {
        "type": "object",
        "description": "A titled shelf of rows: the unit both home and discover render.",
        "required": [
          "title",
          "type",
          "items"
        ],
        "properties": {
          "connect_service": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ShelfSource"
              }
            ],
            "description": "Service the user must connect for the full shelf, when gated."
          },
          "fallback_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Explanation shown in place of rows when the shelf could not fill."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SectionItem"
            },
            "description": "Shelf rows."
          },
          "radio_seed_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Radio seed id, when playable."
          },
          "radio_seed_type": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RadioSeedKind"
              }
            ],
            "description": "Radio seed kind, when the shelf is playable as radio."
          },
          "source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ShelfSource"
              }
            ],
            "description": "Where the rows came from, when the shelf names it."
          },
          "title": {
            "type": "string",
            "description": "Shelf title."
          },
          "type": {
            "$ref": "#/components/schemas/SectionKind",
            "description": "What the rows are."
          }
        }
      },
      "CheckTracksBody": {
        "type": "object",
        "description": "Membership-check body.",
        "required": [
          "tracks"
        ],
        "properties": {
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackIdentifier"
            },
            "description": "Tracks to look up."
          }
        }
      },
      "CheckTracksResponse": {
        "type": "object",
        "description": "Membership-check answer: each request index maps to the ids of the\ncaller's visible playlists holding that track.",
        "required": [
          "membership"
        ],
        "properties": {
          "membership": {
            "type": "object",
            "description": "Request index (as a string) to playlist ids.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "CheckpointMode": {
        "type": "string",
        "description": "Which checkpoint mode produced an outcome record.",
        "enum": [
          "passive",
          "truncate"
        ]
      },
      "CheckpointView": {
        "type": "object",
        "description": "One database checkpoint pass, for the queue stats.",
        "required": [
          "mode",
          "busy",
          "active_bytes",
          "wal_file_bytes",
          "suspended",
          "at_unix"
        ],
        "properties": {
          "active_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Uncheckpointed bytes, or -1 on an unmeasured pass."
          },
          "at_unix": {
            "type": "integer",
            "format": "int64",
            "description": "Pass time as unix seconds.",
            "minimum": 0
          },
          "busy": {
            "type": "boolean",
            "description": "True when a lock contender blocked the pass."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "`CHECKPOINT_FAILED` when the pass failed on something other than a\nlock. The cause is in the server log."
          },
          "mode": {
            "$ref": "#/components/schemas/CheckpointMode",
            "description": "Mode that ran."
          },
          "suspended": {
            "type": "boolean",
            "description": "True when background producers must yield."
          },
          "wal_file_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "`-wal` file allocation in bytes.",
            "minimum": 0
          }
        }
      },
      "ChooseEditionBody": {
        "type": "object",
        "description": "Choose an edition.",
        "required": [
          "release_mbid",
          "expected_identity_revision"
        ],
        "properties": {
          "expected_identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `identity_revision` the edition status showed."
          },
          "release_mbid": {
            "type": "string",
            "description": "Any MusicBrainz release, from this album's release group or another."
          },
          "use_anyway": {
            "type": "boolean",
            "description": "Take the release even when it fits none of the files (\"Use\nanyway\"): no file is placed, and each reaches a track only by a\nmatch by hand. A release that fits a file is chosen as without it."
          }
        }
      },
      "CitySearchResponse": {
        "type": "object",
        "description": "City suggestions. Empty means the geocoder knows no such place.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CitySearchResult"
            },
            "description": "Suggestions, best first."
          }
        }
      },
      "CitySearchResult": {
        "type": "object",
        "description": "One geocoder suggestion.",
        "required": [
          "name",
          "latitude",
          "longitude"
        ],
        "properties": {
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "Country name."
          },
          "country_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Country code."
          },
          "latitude": {
            "type": "number",
            "format": "double",
            "description": "Latitude in degrees."
          },
          "longitude": {
            "type": "number",
            "format": "double",
            "description": "Longitude in degrees."
          },
          "name": {
            "type": "string",
            "description": "City name."
          },
          "region": {
            "type": [
              "string",
              "null"
            ],
            "description": "First-level region."
          }
        }
      },
      "ClearDownloadsResponse": {
        "type": "object",
        "description": "Clear outcome.",
        "required": [
          "cleared"
        ],
        "properties": {
          "cleared": {
            "type": "integer",
            "format": "int64",
            "description": "Finished tasks removed."
          }
        }
      },
      "ClearHistoryResponse": {
        "type": "object",
        "description": "Clear-history outcome.",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Whether a row was cleared."
          }
        }
      },
      "Concert": {
        "type": "object",
        "description": "One upcoming gig in one of the caller's cities.",
        "required": [
          "artist_mbid",
          "artist_name",
          "event_name",
          "local_date",
          "status",
          "source",
          "source_event_id",
          "matched_city"
        ],
        "properties": {
          "artist_mbid": {
            "type": "string",
            "description": "Followed artist's MBID (lowercase in library sweep scope)."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name as followed."
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "description": "Venue town or city."
          },
          "country_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Venue country code."
          },
          "distance_km": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Distance from the matched city in km, one decimal; null when the\nvenue had no coordinates and matched by city name."
          },
          "event_name": {
            "type": "string",
            "description": "Event title from the source."
          },
          "local_date": {
            "type": "string",
            "description": "Venue-local date, `YYYY-MM-DD`."
          },
          "matched_city": {
            "type": "string",
            "description": "The saved city this gig matched."
          },
          "region": {
            "type": [
              "string",
              "null"
            ],
            "description": "Venue region."
          },
          "source": {
            "$ref": "#/components/schemas/EventSource",
            "description": "Source of the listing."
          },
          "source_event_id": {
            "type": "string",
            "description": "Listing id, unique per source."
          },
          "starts_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Start time, ISO, when the source gives one."
          },
          "status": {
            "$ref": "#/components/schemas/ConcertStatus",
            "description": "Whether the gig is still on."
          },
          "ticket_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ticket or listing link."
          },
          "venue_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Venue name."
          }
        }
      },
      "ConcertStatus": {
        "type": "string",
        "description": "Whether the gig is still on. Ticketmaster's `postponed` reads as\nrescheduled: the gig is not happening on its listed date.",
        "enum": [
          "scheduled",
          "cancelled",
          "rescheduled"
        ]
      },
      "ConcertsNew": {
        "type": "object",
        "description": "`concerts_new`: a sweep stored new concerts for a followed artist.",
        "required": [
          "artist_mbid",
          "artist_name",
          "new_events"
        ],
        "properties": {
          "artist_mbid": {
            "type": "string",
            "description": "Followed artist."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "new_events": {
            "type": "integer",
            "description": "Listings first seen in this sweep.",
            "minimum": 0
          }
        }
      },
      "ConcertsResponse": {
        "type": "object",
        "description": "The caller's concerts list.",
        "required": [
          "configured",
          "items",
          "total"
        ],
        "properties": {
          "configured": {
            "type": "boolean",
            "description": "False when the admin has no events source switched on with a key."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Concert"
            },
            "description": "Gigs, date ascending."
          },
          "total": {
            "type": "integer",
            "description": "Item count.",
            "minimum": 0
          }
        }
      },
      "Confidence": {
        "type": "string",
        "description": "How far a finding can be trusted, in the finding's `confidence`.",
        "enum": [
          "complete",
          "bounded"
        ]
      },
      "ConnectApps": {
        "type": "object",
        "description": "Inbound Connect Apps config. Both protocols default off.",
        "properties": {
          "advertise_server_name": {
            "type": "string",
            "description": "Advertised server name.",
            "default": "DroppedNeedle"
          },
          "advertise_server_version": {
            "type": "string",
            "description": "Advertised server version.",
            "default": "10.10.6"
          },
          "jellyfin_enabled": {
            "type": "boolean",
            "description": "Serve the Jellyfin API.",
            "default": false
          },
          "subsonic_enabled": {
            "type": "boolean",
            "description": "Serve the Subsonic API.",
            "default": false
          },
          "transcode_default_format": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AudioFormat"
              }
            ],
            "description": "Default transcode format.",
            "default": "mp3"
          },
          "transcode_max_bitrate_kbps": {
            "type": "integer",
            "format": "int64",
            "description": "Transcode ceiling in kbps (32-1411).",
            "default": 320
          },
          "transcoding_enabled": {
            "type": "boolean",
            "description": "Allow transcoding for compat clients.",
            "default": true
          }
        }
      },
      "ConnectRequest": {
        "type": "object",
        "description": "What the app asks for, as it put it in the `/connect` address. Every\nfield is checked here; nothing is trusted for being present.",
        "properties": {
          "client_id": {
            "type": "string",
            "description": "The app's id, one listed in the `app_connect` settings.",
            "default": ""
          },
          "code_challenge": {
            "type": "string",
            "description": "`BASE64URL(SHA256(code_verifier))`, 43 characters, no padding.",
            "default": ""
          },
          "code_challenge_method": {
            "type": "string",
            "description": "Must be `S256`.",
            "default": ""
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "The device name the app reports, such as `Pixel 9`. Optional.",
            "default": null
          },
          "redirect_uri": {
            "type": "string",
            "description": "Where the browser hands the result back; exactly one of the app's\nlisted addresses.",
            "default": ""
          },
          "response_type": {
            "type": "string",
            "description": "Must be `code`.",
            "default": ""
          },
          "state": {
            "type": "string",
            "description": "The app's own value, handed back unchanged; up to 512 bytes.",
            "default": ""
          }
        }
      },
      "ConnectionSave": {
        "type": "object",
        "description": "Link the caller's own Navidrome or Jellyfin account on the server the\nadmin configured. The password is checked live, then kept sealed\n(Navidrome) or traded for a user token and dropped (Jellyfin). It is\nnever echoed back.",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "password": {
            "type": "string",
            "description": "Password on the server."
          },
          "username": {
            "type": "string",
            "description": "Login name on the server."
          }
        }
      },
      "ConnectionStatus": {
        "type": "object",
        "description": "Connection status for one source. Never carries credential material.",
        "required": [
          "source",
          "connected",
          "account_mode",
          "account_label"
        ],
        "properties": {
          "account_label": {
            "type": "string",
            "description": "Display label, e.g. the login name."
          },
          "account_mode": {
            "$ref": "#/components/schemas/AccountMode",
            "description": "Whose account the source is reached through."
          },
          "connected": {
            "type": "boolean",
            "description": "True when a credential is stored and the source is enabled."
          },
          "server_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The configured server address. Set only when the caller's own account\nis linked to that server, so nobody else learns it."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          }
        }
      },
      "ContentSecurityPolicyMode": {
        "type": "string",
        "description": "How the web UI's content-security policy is sent.",
        "enum": [
          "enforce",
          "report_only",
          "off"
        ]
      },
      "ContributionDraftBody": {
        "type": "object",
        "description": "Save an edited draft.",
        "required": [
          "expected_row_revision",
          "draft"
        ],
        "properties": {
          "draft": {
            "$ref": "#/components/schemas/ReleaseDraft",
            "description": "The whole draft."
          },
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Row revision the caller last read."
          }
        }
      },
      "ContributionFieldSource": {
        "type": "string",
        "description": "Where a draft field value came from. The strings match v2's.",
        "enum": [
          "local",
          "discogs",
          "entered_here"
        ]
      },
      "ContributionNextAction": {
        "type": "string",
        "description": "Follow-up actions the UI may offer. The strings match v2's.",
        "enum": [
          "edit_draft",
          "refresh_discogs",
          "run_duplicate_check",
          "attach_existing",
          "seed_musicbrainz",
          "retry_verification",
          "rebuild",
          "cancel"
        ]
      },
      "ContributionReason": {
        "type": "object",
        "description": "One reason shown to the curator: stable code, plain sentence, action.",
        "required": [
          "code",
          "message",
          "action"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ContributionRecord": {
        "type": "object",
        "description": "What the service hands back: persisted row plus derived presentation.",
        "required": [
          "id",
          "local_album_id",
          "created_by_user_id",
          "updated_by_user_id",
          "state",
          "album_row_revision",
          "input_revision",
          "local_snapshot",
          "draft",
          "source_selection",
          "provider_snapshot_expires_at",
          "discogs_source",
          "duplicate_result",
          "duplicate_checked_at",
          "result_release_mbid",
          "result_source",
          "result_received_at",
          "seeded_at",
          "terminal_at",
          "created_at",
          "updated_at",
          "row_revision",
          "input_is_current",
          "validation",
          "next_actions",
          "review_reason"
        ],
        "properties": {
          "album_row_revision": {
            "type": "integer",
            "format": "int64"
          },
          "created_at": {
            "type": "number",
            "format": "double"
          },
          "created_by_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "discogs_source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DiscogsSourceView"
              }
            ]
          },
          "draft": {
            "$ref": "#/components/schemas/ReleaseDraft"
          },
          "duplicate_checked_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "duplicate_result": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DuplicateCheckResult"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "input_is_current": {
            "type": "boolean"
          },
          "input_revision": {
            "type": "string"
          },
          "local_album_id": {
            "type": "string"
          },
          "local_snapshot": {
            "$ref": "#/components/schemas/LocalReleaseSnapshot"
          },
          "next_actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContributionNextAction"
            }
          },
          "provider_snapshot_expires_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "result_received_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "result_release_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "result_source": {
            "type": [
              "string",
              "null"
            ]
          },
          "review_reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ContributionReason"
              }
            ],
            "description": "Why the contribution needs review, when it does: a stable code, a\nplain sentence, and what to do next."
          },
          "row_revision": {
            "type": "integer",
            "format": "int64"
          },
          "seeded_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "source_selection": {
            "$ref": "#/components/schemas/ContributionSourceSelection"
          },
          "state": {
            "$ref": "#/components/schemas/ContributionState"
          },
          "terminal_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          },
          "updated_by_user_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "validation": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContributionValidationIssue"
            }
          }
        }
      },
      "ContributionRevisionBody": {
        "type": "object",
        "description": "A revision guard alone (rebuild, cancel, remove Discogs, seed, verify).",
        "required": [
          "expected_row_revision"
        ],
        "properties": {
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Row revision the caller last read."
          }
        }
      },
      "ContributionSourceSelection": {
        "type": "object",
        "required": [
          "schema_version",
          "sources",
          "alignments"
        ],
        "properties": {
          "alignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackAlignment"
            }
          },
          "schema_version": {
            "type": "integer",
            "format": "int32"
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceReference"
            }
          }
        }
      },
      "ContributionState": {
        "type": "string",
        "description": "Contribution lifecycle states. The strings match v2's.",
        "enum": [
          "draft",
          "ready",
          "seeded",
          "verifying",
          "linked",
          "needs_review",
          "stale",
          "cancelled"
        ]
      },
      "ContributionValidationIssue": {
        "type": "object",
        "required": [
          "code",
          "field",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "field": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ControlRequest": {
        "type": "string",
        "description": "A control the running worker has not acted on yet.",
        "enum": [
          "none",
          "pause",
          "stop"
        ]
      },
      "Conversion": {
        "type": "string",
        "description": "Whether the server converts a stream that asks for a format.",
        "enum": [
          "on",
          "off",
          "unavailable"
        ]
      },
      "CorrectionKind": {
        "type": "string",
        "description": "Which correction was applied.",
        "enum": [
          "split",
          "merge",
          "move",
          "reset",
          "merge_artist"
        ]
      },
      "Counters": {
        "type": "object",
        "description": "A run's counters, one per column of the runs table.",
        "required": [
          "total_count",
          "discovered_count",
          "inspected_count",
          "new_count",
          "changed_count",
          "indexed_count",
          "unchanged_count",
          "excluded_count",
          "missing_count",
          "errored_count",
          "identification_enqueued_count"
        ],
        "properties": {
          "changed_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files changed since the last scan."
          },
          "discovered_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files the walk found."
          },
          "errored_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files that could not be read or written."
          },
          "excluded_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files a policy leaves out."
          },
          "identification_enqueued_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums offered for identification."
          },
          "indexed_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files written to the catalog."
          },
          "inspected_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files the index phase looked at."
          },
          "missing_count": {
            "type": "integer",
            "format": "int64",
            "description": "Catalog files the walk no longer found."
          },
          "new_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files new to the catalog."
          },
          "total_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files the run will look at."
          },
          "unchanged_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files unchanged since the last scan."
          }
        }
      },
      "CoverUploadBody": {
        "type": "object",
        "description": "Cover-upload body: the image as base64 in JSON.",
        "required": [
          "image_base64",
          "content_type"
        ],
        "properties": {
          "content_type": {
            "type": "string",
            "description": "Mime type of the image."
          },
          "image_base64": {
            "type": "string",
            "description": "Base64-encoded image bytes (png, jpeg, or webp, max 5 MiB decoded)."
          }
        }
      },
      "CoverUploadResponse": {
        "type": "object",
        "description": "Cover-upload answer.",
        "required": [
          "cover_url"
        ],
        "properties": {
          "cover_url": {
            "type": "string",
            "description": "URL serving the uploaded cover."
          }
        }
      },
      "CreatePlaylistBody": {
        "type": "object",
        "description": "Create-playlist body.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Display name. Must not be blank."
          },
          "source_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import provenance (`<source>:<id>`), when the playlist was imported."
          }
        }
      },
      "CssProblem": {
        "type": "object",
        "description": "One refused part of a sheet.",
        "required": [
          "what",
          "line"
        ],
        "properties": {
          "line": {
            "type": "integer",
            "format": "int32",
            "description": "The 1-based line it first appears on; 0 for `too_long`.",
            "minimum": 0
          },
          "what": {
            "type": "string",
            "description": "What is refused: `backslash`, `import`, `font_face`, `too_long`, or\n`function:<name>` with the name in lower case."
          }
        }
      },
      "CssRefusal": {
        "type": "object",
        "description": "What a refused sheet answers in the error's `details`.",
        "required": [
          "problems"
        ],
        "properties": {
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CssProblem"
            },
            "description": "Each refused part of the sheet, once, in the order the check reads\nthem."
          }
        }
      },
      "CssSave": {
        "type": "object",
        "description": "One kept save of a person's CSS.",
        "required": [
          "id",
          "css",
          "saved_at"
        ],
        "properties": {
          "css": {
            "type": "string",
            "description": "The sheet as saved."
          },
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "The save's id."
          },
          "saved_at": {
            "type": "integer",
            "format": "int64",
            "description": "When it was saved, unix milliseconds."
          }
        }
      },
      "CustomCssSummary": {
        "type": "object",
        "description": "What an admin sees of a person's CSS: never the text.",
        "required": [
          "has_css",
          "enabled",
          "length"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "The person's \"Use my CSS\" switch."
          },
          "has_css": {
            "type": "boolean",
            "description": "Whether the person has CSS saved."
          },
          "length": {
            "type": "integer",
            "format": "int64",
            "description": "The sheet's length in characters, as the limit counts them.",
            "minimum": 0
          },
          "saved_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "When the text last changed, unix milliseconds."
          }
        }
      },
      "CustomCssUpdate": {
        "type": "object",
        "description": "A change to a person's own CSS. A field left out keeps its value.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "The \"Use my CSS\" switch."
          },
          "text": {
            "type": "string",
            "description": "The new sheet; an empty one clears it."
          }
        }
      },
      "CustomEditionBody": {
        "type": "object",
        "description": "Seal a custom edition.",
        "required": [
          "release_mbid",
          "expected_identity_revision"
        ],
        "properties": {
          "expected_identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `identity_revision` the edition status showed."
          },
          "release_mbid": {
            "type": "string",
            "description": "A MusicBrainz release of the group the files are kept under."
          }
        }
      },
      "CutoffUnmetItem": {
        "type": "object",
        "description": "One album below the quality cutoff.",
        "required": [
          "release_group_mbid",
          "current_tier",
          "track_count"
        ],
        "properties": {
          "album_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "current_tier": {
            "type": "string",
            "description": "The album's worst file tier."
          },
          "release_group_mbid": {
            "type": "string"
          },
          "track_count": {
            "type": "integer",
            "format": "int64"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "CutoffUnmetResponse": {
        "type": "object",
        "description": "The upgrade worklist.",
        "required": [
          "items",
          "cutoff",
          "upgrade_allowed"
        ],
        "properties": {
          "cutoff": {
            "type": "string",
            "description": "The tier albums must reach."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CutoffUnmetItem"
            },
            "description": "Empty while upgrades are switched off."
          },
          "upgrade_allowed": {
            "type": "boolean"
          }
        }
      },
      "DecadeShelf": {
        "type": "object",
        "description": "One decade shelf. Shelves carry counts; fetch the shelf's albums\nthrough the album list with the same `decade` value.",
        "required": [
          "decade",
          "label",
          "album_count"
        ],
        "properties": {
          "album_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums dated to this decade.",
            "minimum": 0
          },
          "decade": {
            "type": "integer",
            "format": "int64",
            "description": "Decade start year, e.g. 1990."
          },
          "label": {
            "type": "string",
            "description": "Human label, e.g. `1990s`."
          }
        }
      },
      "DecadesResponse": {
        "type": "object",
        "description": "Decade listing, ascending.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DecadeShelf"
            },
            "description": "Shelves, oldest decade first."
          }
        }
      },
      "DecisionSource": {
        "type": "string",
        "description": "Who last set an identity row.",
        "enum": [
          "automatic",
          "manual",
          "legacy_import",
          "embedded"
        ]
      },
      "DeferredJobView": {
        "type": "object",
        "description": "One deferred identification job, named.",
        "required": [
          "job_id",
          "local_album_id",
          "album_title",
          "artist_name",
          "last_failure_code",
          "attempt_count",
          "not_before",
          "updated_at"
        ],
        "properties": {
          "album_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "attempt_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "job_id": {
            "type": "string"
          },
          "last_failure_code": {
            "type": "string",
            "description": "Why the last attempt did not finish."
          },
          "local_album_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "not_before": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Unix seconds before which the job will not run again."
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "Degradation": {
        "type": "object",
        "description": "One degraded source inside an otherwise successful batch. The recording\nis the error signal: optional enrichment degrades, never fails.",
        "required": [
          "source",
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Fixed machine code; provider detail never reaches the wire."
          },
          "message": {
            "type": "string",
            "description": "Fixed human message."
          },
          "source": {
            "type": "string",
            "description": "Source that degraded (`listenbrainz`, `lastfm`)."
          }
        }
      },
      "DeviceSessionMint": {
        "type": "object",
        "description": "Mint a named companion token.",
        "required": [
          "label"
        ],
        "properties": {
          "label": {
            "type": "string",
            "description": "Device label, 1-80 chars. Reminting a label revokes the prior token."
          }
        }
      },
      "DeviceSessionResponse": {
        "type": "object",
        "description": "A minted companion token. The raw token appears here once, never again.",
        "required": [
          "id",
          "label",
          "token",
          "expires_at"
        ],
        "properties": {
          "expires_at": {
            "type": "integer",
            "format": "int64",
            "description": "Absolute expiry, unix seconds."
          },
          "id": {
            "type": "string",
            "description": "Session id."
          },
          "label": {
            "type": "string",
            "description": "Device label."
          },
          "token": {
            "type": "string",
            "description": "Raw Bearer token. Shown once."
          }
        }
      },
      "DiscogsArtistCredit": {
        "type": "object",
        "required": [
          "name",
          "credited_name",
          "join_phrase",
          "artist_id",
          "canonical_url"
        ],
        "properties": {
          "artist_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "canonical_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "credited_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "join_phrase": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "DiscogsFormat": {
        "type": "object",
        "required": [
          "name",
          "quantity",
          "descriptions",
          "text"
        ],
        "properties": {
          "descriptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "quantity": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "DiscogsIdentifier": {
        "type": "object",
        "required": [
          "type",
          "value",
          "description"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "DiscogsLabel": {
        "type": "object",
        "required": [
          "name",
          "catalogue_number",
          "label_id",
          "canonical_url"
        ],
        "properties": {
          "canonical_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "catalogue_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "label_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          }
        }
      },
      "DiscogsMedium": {
        "type": "object",
        "required": [
          "position",
          "title",
          "format",
          "tracks"
        ],
        "properties": {
          "format": {
            "type": [
              "string",
              "null"
            ]
          },
          "position": {
            "type": "integer",
            "format": "int64"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscogsTrack"
            }
          }
        }
      },
      "DiscogsRelease": {
        "type": "object",
        "required": [
          "release_id",
          "master_id",
          "canonical_release_url",
          "canonical_master_url",
          "title",
          "artist_name",
          "artists",
          "released_date",
          "year",
          "country",
          "labels",
          "identifiers",
          "barcode",
          "formats",
          "media",
          "source_fetched_at"
        ],
        "properties": {
          "artist_name": {
            "type": "string"
          },
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscogsArtistCredit"
            }
          },
          "barcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "canonical_master_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "canonical_release_url": {
            "type": "string"
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "formats": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscogsFormat"
            }
          },
          "identifiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscogsIdentifier"
            }
          },
          "labels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscogsLabel"
            }
          },
          "master_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscogsMedium"
            }
          },
          "release_id": {
            "type": "string"
          },
          "released_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_fetched_at": {
            "type": "number",
            "format": "double"
          },
          "title": {
            "type": "string"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          }
        }
      },
      "DiscogsReleaseCandidate": {
        "type": "object",
        "required": [
          "release_id"
        ],
        "properties": {
          "artist_name": {
            "type": "string"
          },
          "canonical_url": {
            "type": "string"
          },
          "catalogue_number": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "fetched_at": {
            "type": "number",
            "format": "double"
          },
          "format_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "master_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "track_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          }
        }
      },
      "DiscogsSearchBody": {
        "type": "object",
        "description": "Search Discogs; an empty query searches the album's artist and title.",
        "properties": {
          "query": {
            "type": [
              "string",
              "null"
            ],
            "description": "Title, artist, barcode, URL or ID."
          }
        }
      },
      "DiscogsSearchResponse": {
        "type": "object",
        "description": "Discogs search results.",
        "required": [
          "results"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscogsReleaseCandidate"
            },
            "description": "Up to eight candidate releases."
          }
        }
      },
      "DiscogsSelectBody": {
        "type": "object",
        "description": "Use one Discogs release as the contribution's source.",
        "required": [
          "expected_row_revision",
          "release_id_or_url"
        ],
        "properties": {
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Row revision the caller last read."
          },
          "release_id_or_url": {
            "type": "string",
            "description": "Discogs release ID or release URL."
          }
        }
      },
      "DiscogsSourceView": {
        "type": "object",
        "required": [
          "release",
          "expired",
          "expires_at"
        ],
        "properties": {
          "expired": {
            "type": "boolean"
          },
          "expires_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "release": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DiscogsRelease"
              }
            ]
          }
        }
      },
      "DiscogsTrack": {
        "type": "object",
        "required": [
          "source_position",
          "number",
          "title",
          "duration_seconds",
          "heading",
          "artists"
        ],
        "properties": {
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscogsArtistCredit"
            }
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "heading": {
            "type": "boolean"
          },
          "number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "source_position": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          }
        }
      },
      "DiscoverActivityRequest": {
        "type": "object",
        "description": "Body recording one discover interaction for personalization.",
        "required": [
          "feature"
        ],
        "properties": {
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist the interaction concerned, when it had one."
          },
          "feature": {
            "type": "string",
            "description": "Surface the interaction happened on (`home`, `discover`, `queue`, `artist`)."
          },
          "provider": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ListenSource"
              }
            ],
            "description": "Provider behind the row, when it had one."
          },
          "section": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist-page section (`similar`, `top_songs`, `top_albums`), when it had one."
          }
        }
      },
      "DiscoverActivityResponse": {
        "type": "object",
        "description": "Personalization cursor after recording activity.",
        "required": [
          "source_mode",
          "source_id",
          "generation"
        ],
        "properties": {
          "generation": {
            "type": "integer",
            "format": "int64",
            "description": "The MusicBrainz source generation (bumps when the source changes)."
          },
          "source_id": {
            "type": "string",
            "description": "The MusicBrainz source id."
          },
          "source_mode": {
            "type": "string",
            "description": "The MusicBrainz source tier the activity was recorded under."
          }
        }
      },
      "DiscoverPreview": {
        "type": "object",
        "description": "A discover teaser on home: one seed artist plus similar artists.",
        "required": [
          "seed_artist",
          "seed_artist_mbid",
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistRef"
            },
            "description": "Similar artists."
          },
          "seed_artist": {
            "type": "string",
            "description": "Seed artist name."
          },
          "seed_artist_mbid": {
            "type": "string",
            "description": "Seed MusicBrainz artist id."
          }
        }
      },
      "DiscoverQueuePreview": {
        "type": "object",
        "description": "On-demand YouTube preview behind one queue card.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "$ref": "#/components/schemas/PreviewStatus",
            "description": "Whether a preview was found."
          },
          "youtube_search_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Search URL fallback, when there is one."
          },
          "youtube_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Watch URL, when available."
          }
        }
      },
      "DiscoverQueueResponse": {
        "type": "object",
        "description": "The queue deck: cards plus the build they came from.",
        "required": [
          "queue_id"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueueItemLight"
            },
            "description": "Deck cards in order."
          },
          "queue_id": {
            "type": "string",
            "description": "Build id behind the deck."
          }
        }
      },
      "DiscoverQueueStatusResponse": {
        "type": "object",
        "description": "Queue build state for polling.",
        "required": [
          "status"
        ],
        "properties": {
          "built_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Build timestamp (unix seconds), when built."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Build failure, when failed."
          },
          "item_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Card count, when there is one."
          },
          "queue_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Build id, when there is one."
          },
          "stale": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True when the deck is older than its TTL."
          },
          "status": {
            "$ref": "#/components/schemas/QueueBuildStatus",
            "description": "Build state. A saved queue past its age is `ready` with `stale` set."
          }
        }
      },
      "DiscoverResponse": {
        "type": "object",
        "description": "Discover: its sections, in page order, plus the page-level fields. A\nsection with no rows is left out.",
        "required": [
          "sections",
          "discover_queue_enabled",
          "service_prompts",
          "genre_artwork",
          "genre_artwork_schema_version",
          "refreshing"
        ],
        "properties": {
          "discover_queue_enabled": {
            "type": "boolean",
            "description": "Whether the queue deck is enabled for the user."
          },
          "generated_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Build timestamp (unix seconds), when built."
          },
          "genre_artwork": {
            "type": "object",
            "description": "Mosaic art keyed by genre name.",
            "additionalProperties": {
              "$ref": "#/components/schemas/GenreArtwork"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "genre_artwork_schema_version": {
            "type": "string",
            "description": "Genre artwork schema version."
          },
          "integration_status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IntegrationStatus"
              }
            ],
            "description": "Integration availability behind the shelves."
          },
          "refresh_started_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Refresh-start timestamp (unix seconds), when refreshing."
          },
          "refreshing": {
            "type": "boolean",
            "description": "True while a fuller build runs in the background (the UI polls)."
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageSection"
            },
            "description": "The sections, in page order."
          },
          "service_prompts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServicePrompt"
            },
            "description": "Connect-a-service cards."
          },
          "service_status": {
            "type": [
              "object",
              "null"
            ],
            "description": "Listening services that failed during the build, when any did.",
            "additionalProperties": {
              "$ref": "#/components/schemas/ServiceState"
            },
            "propertyNames": {
              "type": "string",
              "description": "A listening-data service: the one the discover shelves, charts, radio and\nenrichment answers name.",
              "enum": [
                "listenbrainz",
                "lastfm"
              ]
            }
          }
        }
      },
      "DiscoveryBatchCreate": {
        "type": "object",
        "description": "Body creating a discovery batch (one request per album).",
        "required": [
          "name"
        ],
        "properties": {
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "A UUID naming this create. Sending the same key again returns the\nbatch it made instead of filing the albums twice."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscoveryBatchItemIn"
            },
            "description": "Albums to request."
          },
          "name": {
            "type": "string",
            "description": "Batch name."
          },
          "source_section": {
            "type": "string",
            "description": "Discover section the batch came from."
          }
        }
      },
      "DiscoveryBatchDetail": {
        "type": "object",
        "description": "A batch plus its album outcomes.",
        "required": [
          "id",
          "name",
          "item_count",
          "imported_count",
          "pending_count"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "description": "Creation timestamp (RFC 3339)."
          },
          "id": {
            "type": "string",
            "description": "Batch id."
          },
          "imported_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums already imported."
          },
          "item_count": {
            "type": "integer",
            "format": "int64",
            "description": "Album count."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscoveryBatchItemStatus"
            },
            "description": "Per-album outcomes."
          },
          "name": {
            "type": "string",
            "description": "Batch name."
          },
          "pending_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums still pending."
          },
          "source_section": {
            "type": "string",
            "description": "Discover section the batch came from."
          }
        }
      },
      "DiscoveryBatchItemIn": {
        "type": "object",
        "description": "One album to request inside a new batch.",
        "required": [
          "musicbrainz_id"
        ],
        "properties": {
          "artist_id": {
            "type": "string",
            "description": "The artist's MusicBrainz id."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "MusicBrainz release-group id."
          },
          "title": {
            "type": "string",
            "description": "Album title."
          }
        }
      },
      "DiscoveryBatchItemStatus": {
        "type": "object",
        "description": "Per-album outcome inside a batch.",
        "required": [
          "musicbrainz_id",
          "outcome"
        ],
        "properties": {
          "artist_id": {
            "type": "string",
            "description": "The artist's MusicBrainz id."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when already owned."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "MusicBrainz release-group id."
          },
          "outcome": {
            "$ref": "#/components/schemas/BatchOutcome",
            "description": "What the batch did with the album."
          },
          "request_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Request state, when requested."
          },
          "title": {
            "type": "string",
            "description": "Album title."
          }
        }
      },
      "DiscoveryBatchListResponse": {
        "type": "object",
        "description": "The user's batches.",
        "required": [
          "batches"
        ],
        "properties": {
          "batches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscoveryBatchSummary"
            },
            "description": "Batches, newest first."
          }
        }
      },
      "DiscoveryBatchRemoveResult": {
        "type": "object",
        "description": "What removing a batch did.",
        "properties": {
          "cancelled_requests": {
            "type": "integer",
            "format": "int64",
            "description": "Requests cancelled with the batch."
          },
          "kept": {
            "type": "integer",
            "format": "int64",
            "description": "Albums kept (already landed or owned elsewhere)."
          },
          "removed_albums": {
            "type": "integer",
            "format": "int64",
            "description": "Albums removed with the batch."
          },
          "waiting": {
            "type": "integer",
            "format": "int64",
            "description": "Albums left in the batch because no recycle bin is known yet."
          },
          "waiting_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why those albums wait, when any do."
          }
        }
      },
      "DiscoveryBatchSummary": {
        "type": "object",
        "description": "A batch without its album outcomes.",
        "required": [
          "id",
          "name",
          "item_count",
          "imported_count",
          "pending_count"
        ],
        "properties": {
          "created_at": {
            "type": "string",
            "description": "Creation timestamp (RFC 3339)."
          },
          "id": {
            "type": "string",
            "description": "Batch id."
          },
          "imported_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums already imported."
          },
          "item_count": {
            "type": "integer",
            "format": "int64",
            "description": "Album count."
          },
          "name": {
            "type": "string",
            "description": "Batch name."
          },
          "pending_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums still pending."
          },
          "source_section": {
            "type": "string",
            "description": "Discover section the batch came from."
          }
        }
      },
      "DiscoveryHubView": {
        "type": "object",
        "description": "One Plex discovery shelf: a hub title over its album rows. Plex-only\n(from `/hubs/sections/{id}`), kept out of the unified [`HubView`] so\nother sources never ship an empty shelf shape.",
        "required": [
          "title",
          "hub_type",
          "albums"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesAlbumView"
            },
            "description": "Albums on this shelf."
          },
          "hub_type": {
            "type": "string",
            "description": "Hub kind; always `\"album\"`. Other hub kinds are dropped."
          },
          "title": {
            "type": "string",
            "description": "Hub title, e.g. \"Recommended for you\"."
          }
        }
      },
      "DiscoveryView": {
        "type": "object",
        "description": "Plex discovery shelves for the hub page.",
        "required": [
          "source",
          "hubs"
        ],
        "properties": {
          "hubs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscoveryHubView"
            },
            "description": "Album shelves, in upstream order."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          }
        }
      },
      "DismissSearchResponse": {
        "type": "object",
        "description": "\"None of these\": the album is on the watchlist.",
        "required": [
          "success",
          "state"
        ],
        "properties": {
          "state": {
            "type": "string",
            "description": "The album's watch state (`watching` normally)."
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "DispatchOrigin": {
        "type": "string",
        "description": "What started a download. Stored as the task's `origin`; origins decide\nquota exemptions and how a landing treats the files, never routing.\nA request row stores it too, in the order `request_history.origin`'s\nCHECK lists them.",
        "enum": [
          "user",
          "approval",
          "retry",
          "wanted",
          "upgrade",
          "edition",
          "follow"
        ]
      },
      "DisplayNameUpdate": {
        "type": "object",
        "description": "Change display name.",
        "required": [
          "display_name"
        ],
        "properties": {
          "display_name": {
            "type": "string",
            "description": "New display name, 1-64 chars after trimming."
          }
        }
      },
      "DownloadAccess": {
        "type": "string",
        "description": "Who may download library files. `trusted` admits trusted and admin.",
        "enum": [
          "everyone",
          "trusted",
          "admin"
        ]
      },
      "DownloadActionResponse": {
        "type": "object",
        "description": "Plain success.",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          }
        }
      },
      "DownloadActivitySummaryResponse": {
        "type": "object",
        "description": "Queue counters for the nav badge and live refresh.",
        "required": [
          "revision",
          "active_count",
          "held_count",
          "failed_count",
          "landed_release_group_mbids"
        ],
        "properties": {
          "active_count": {
            "type": "integer",
            "format": "int64"
          },
          "failed_count": {
            "type": "integer",
            "format": "int64"
          },
          "held_count": {
            "type": "integer",
            "format": "int64"
          },
          "landed_release_group_mbids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The 20 albums that landed most recently, newest first."
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "description": "Moves whenever the viewer's queue changes structurally (not on\nbyte progress). Refetch the list when it moves."
          }
        }
      },
      "DownloadListResponse": {
        "type": "object",
        "description": "One page of the queue.",
        "required": [
          "items",
          "page",
          "page_size"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadTaskResponse"
            }
          },
          "page": {
            "type": "integer",
            "format": "int64"
          },
          "page_size": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DownloadPolicy": {
        "type": "object",
        "description": "Download policy: quality tiers, recipe v2, timeouts, retry, retention,\nquotas, and the upgrade scan.",
        "properties": {
          "auto_retry_base_interval_minutes": {
            "type": "integer",
            "format": "int64",
            "description": "Retry base interval.",
            "default": 15
          },
          "auto_retry_enabled": {
            "type": "boolean",
            "description": "Automatic retry switch.",
            "default": true
          },
          "auto_retry_max_attempts": {
            "type": "integer",
            "format": "int64",
            "description": "Retry attempts.",
            "default": 6
          },
          "background_upgrade_max_per_run": {
            "type": "integer",
            "format": "int64",
            "description": "Sweep upgrades per run.",
            "default": 3
          },
          "background_upgrade_scan_enabled": {
            "type": "boolean",
            "description": "Background upgrade sweep switch.",
            "default": false
          },
          "background_upgrade_scan_interval_hours": {
            "type": "integer",
            "format": "int64",
            "description": "Sweep interval in hours.",
            "default": 12
          },
          "default_request_quota_count": {
            "type": "integer",
            "format": "int64",
            "description": "Default per-user request quota (0 unlimited).",
            "default": 0
          },
          "default_request_quota_days": {
            "type": "integer",
            "format": "int64",
            "description": "Request quota window in days.",
            "default": 7
          },
          "default_storage_quota_gb": {
            "type": "integer",
            "format": "int64",
            "description": "Default per-user storage quota in GB (0 unlimited).",
            "default": 0
          },
          "download_queued_timeout_minutes": {
            "type": "integer",
            "format": "int64",
            "description": "Remote-queue wait timeout.",
            "default": 120
          },
          "download_stall_timeout_minutes": {
            "type": "integer",
            "format": "int64",
            "description": "Frozen-transfer stall timeout.",
            "default": 30
          },
          "ignored_terms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Terms that reject a candidate.",
            "default": []
          },
          "max_concurrent_downloads": {
            "type": "integer",
            "format": "int64",
            "description": "Concurrent downloads.",
            "default": 3
          },
          "max_failover_attempts": {
            "type": "integer",
            "format": "int64",
            "description": "Failover attempts per request.",
            "default": 3
          },
          "max_library_size_gb": {
            "type": "integer",
            "format": "int64",
            "description": "Library size cap in GB (0 unlimited).",
            "default": 0
          },
          "max_size_mb": {
            "type": "integer",
            "format": "int64",
            "description": "Max download size in MB (0 unlimited).",
            "default": 0
          },
          "preferred_quality_wait_minutes": {
            "type": "integer",
            "format": "int64",
            "description": "Preferred-quality wait.",
            "default": 15
          },
          "preflight_score_auto_accept": {
            "type": "number",
            "format": "double",
            "description": "Preflight auto-accept score.",
            "default": 0.7
          },
          "preflight_score_manual_min": {
            "type": "number",
            "format": "double",
            "description": "Preflight manual-review floor.",
            "default": 0.5
          },
          "quality_cutoff": {
            "type": "string",
            "description": "Stop-upgrading tier label.",
            "default": "lossless"
          },
          "quality_max": {
            "type": "string",
            "description": "Best accepted tier label, set from the recipe.",
            "default": "lossless"
          },
          "quality_min": {
            "type": "string",
            "description": "Worst accepted tier label, set from the recipe.",
            "default": "mp3_320"
          },
          "quality_recipe": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QualityRecipeEntry"
            },
            "description": "Ordered quality recipe, earlier entries preferred. Automatic work takes\nonly what it lists. A save needs at least one entry."
          },
          "required_terms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Terms a candidate must carry.",
            "default": []
          },
          "search_review": {
            "type": "string",
            "description": "When an automatic download waits for a hand pick: `when_unsure`\n(no candidate looks like the whole album in an accepted quality),\n`always`, or `off` (grab the best guess).",
            "default": "when_unsure"
          },
          "upgrade_allowed": {
            "type": "boolean",
            "description": "Background upgrades switch.",
            "default": false
          },
          "usenet_retention_days": {
            "type": "integer",
            "format": "int64",
            "description": "Usenet retention in days (0 unknown).",
            "default": 0
          }
        }
      },
      "DownloadPolicyView": {
        "allOf": [
          {
            "$ref": "#/components/schemas/DownloadPolicy",
            "description": "The stored policy."
          },
          {
            "type": "object",
            "required": [
              "quality_recipe_status"
            ],
            "properties": {
              "quality_recipe_error": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Recipe verdict detail, when any."
              },
              "quality_recipe_status": {
                "$ref": "#/components/schemas/QualityRecipeStatus",
                "description": "Read-only recipe verdict."
              }
            }
          }
        ],
        "description": "GET view of the acquisition policy: the stored policy plus the\nread-only recipe verdict, recomputed on every read and never saved."
      },
      "DownloadProgress": {
        "type": "object",
        "description": "`download_progress`: the worker polled one of the user's live\ndownloads. Replaces v2's per-task `progress` stream; the web UI routes\nit to the task's card by `task_id`.",
        "required": [
          "task_id",
          "status",
          "bytes_downloaded",
          "bytes_total",
          "files_completed",
          "files_total",
          "progress_percent",
          "source",
          "remote_queued",
          "attempt_number",
          "attempt_total",
          "has_next_source"
        ],
        "properties": {
          "attempt_number": {
            "type": "integer",
            "format": "int64",
            "description": "Sources tried so far, this one included."
          },
          "attempt_total": {
            "type": "integer",
            "format": "int64",
            "description": "Sources the task may try in all."
          },
          "bytes_downloaded": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes downloaded so far."
          },
          "bytes_total": {
            "type": "integer",
            "format": "int64",
            "description": "Total bytes, 0 when the client does not know yet."
          },
          "candidate_index": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Picked candidate position."
          },
          "files_completed": {
            "type": "integer",
            "format": "int64",
            "description": "Files finished."
          },
          "files_total": {
            "type": "integer",
            "format": "int64",
            "description": "Files in the transfer."
          },
          "has_next_source": {
            "type": "boolean",
            "description": "Whether another source may still be tried."
          },
          "progress_percent": {
            "type": "integer",
            "format": "int64",
            "description": "0 to 100."
          },
          "quality_format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Picked candidate format."
          },
          "queue_position_end": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Newest observed queue rank."
          },
          "queue_position_start": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rank in the peer's upload queue, when queued."
          },
          "remote_queued": {
            "type": "boolean",
            "description": "True while the transfer waits in the peer's queue with no bytes."
          },
          "source": {
            "type": "string",
            "description": "`soulseek`, `usenet` or `plugin:<key>`."
          },
          "status": {
            "type": "string",
            "description": "Its status now."
          },
          "task_id": {
            "type": "string",
            "description": "The task that moved."
          }
        }
      },
      "DownloadReason": {
        "type": "object",
        "description": "Why a manual search failed or found nothing: one stable code, one\nplain sentence and what to do about it.",
        "required": [
          "code",
          "text",
          "action"
        ],
        "properties": {
          "action": {
            "type": "string",
            "description": "What the person can do about it."
          },
          "code": {
            "type": "string",
            "description": "Stable machine code."
          },
          "text": {
            "type": "string",
            "description": "What happened, in one sentence."
          }
        }
      },
      "DownloadTaskReason": {
        "type": "object",
        "description": "Why a download task sits where it does: the reason, its kind, one\nplain sentence and what to do about it.",
        "required": [
          "code",
          "kind",
          "text",
          "action"
        ],
        "properties": {
          "action": {
            "type": "string",
            "description": "What the person can do about it."
          },
          "code": {
            "$ref": "#/components/schemas/Reason"
          },
          "kind": {
            "$ref": "#/components/schemas/ReasonKind"
          },
          "text": {
            "type": "string",
            "description": "What happened, in one sentence."
          }
        }
      },
      "DownloadTaskResponse": {
        "type": "object",
        "description": "One download task as the queue shows it.",
        "required": [
          "id",
          "user_id",
          "download_type",
          "source",
          "origin",
          "release_group_mbid",
          "artist_name",
          "album_title",
          "status",
          "progress_percent",
          "downloaded_bytes",
          "files_total",
          "files_completed",
          "files_failed",
          "retry_count",
          "created_at",
          "updated_at",
          "retry_max",
          "retry_ladder_minutes",
          "acquisition_cleanup_state",
          "remote_queued",
          "attempt_number",
          "attempt_total",
          "has_next_source",
          "held_for_review"
        ],
        "properties": {
          "acquisition_cleanup_state": {
            "type": "string",
            "description": "`not_tracked`, `in_use`, `pending`, `complete`, `preserved` or\n`needs_attention`: how far cleanup of the source files got."
          },
          "advertised_queue_depth": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "album_title": {
            "type": "string"
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist_name": {
            "type": "string"
          },
          "attempt_number": {
            "type": "integer",
            "format": "int64",
            "description": "Sources tried so far."
          },
          "attempt_total": {
            "type": "integer",
            "format": "int64",
            "description": "Sources the task may try in all."
          },
          "candidate_index": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "completed_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "created_at": {
            "type": "number",
            "format": "double"
          },
          "decision": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ImportDecisionView"
              }
            ],
            "description": "The import's decision on the newest landing."
          },
          "download_type": {
            "type": "string",
            "description": "`album` or `track`."
          },
          "downloaded_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "files_completed": {
            "type": "integer",
            "format": "int64"
          },
          "files_failed": {
            "type": "integer",
            "format": "int64"
          },
          "files_total": {
            "type": "integer",
            "format": "int64"
          },
          "final_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "has_next_source": {
            "type": "boolean",
            "description": "Whether another source may still be tried."
          },
          "held_for_review": {
            "type": "boolean",
            "description": "Files of this task wait in the held list for a decision."
          },
          "id": {
            "type": "string"
          },
          "maybe_have": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MaybeHaveView"
              }
            ],
            "description": "A library album whose edition is a guess of this album, though its\nfiles name another: \"You may have this\"."
          },
          "next_retry_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "When the next automatic retry is due, if one will run."
          },
          "origin": {
            "$ref": "#/components/schemas/DispatchOrigin",
            "description": "What started the download."
          },
          "outcome_code": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Reason"
              }
            ],
            "description": "The worker's last outcome. Show `reason` instead."
          },
          "progress_percent": {
            "type": "integer",
            "format": "int64"
          },
          "quality_bit_depth": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "quality_bitrate": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "quality_format": {
            "type": [
              "string",
              "null"
            ]
          },
          "quality_sample_rate": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "queue_position_end": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "queue_position_start": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DownloadTaskReason"
              }
            ],
            "description": "Why the task sits where it does, when that needs saying."
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_group_mbid": {
            "type": "string"
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_track_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote_queued": {
            "type": "boolean",
            "description": "Waiting in the peer's upload queue with no bytes yet."
          },
          "retry_count": {
            "type": "integer",
            "format": "int64"
          },
          "retry_ladder_minutes": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "The whole retry backoff schedule in minutes."
          },
          "retry_max": {
            "type": "integer",
            "format": "int64",
            "description": "Automatic retries allowed in all (0 when auto-retry is off)."
          },
          "search_job_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "description": "`soulseek`, `usenet` or `plugin:<key>`."
          },
          "source_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus"
          },
          "total_size_bytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "track_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          },
          "user_id": {
            "type": "string"
          },
          "wrong_product_detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "wrong_product_verdict_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "DownloadsChanged": {
        "type": "object",
        "description": "`downloads.changed`: the download queue moved. Sent to everyone with\nno task details; each tab refetches its own (permission-scoped) queue\nsummary, and the full list when the summary's revision moved.",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Opaque id of this queue state (`downloads:` plus 16 hex digits).\nThe stream also sends it as the SSE `id:` line."
          }
        }
      },
      "DownloadsMountView": {
        "type": "object",
        "description": "The slskd downloads folder as DroppedNeedle sees it.",
        "required": [
          "ok",
          "move_supported",
          "reason",
          "path"
        ],
        "properties": {
          "move_supported": {
            "type": "boolean",
            "description": "Imports can move files into a library root in one step. When false\nthey copy and then delete, which is slower but still works."
          },
          "ok": {
            "type": "boolean",
            "description": "The folder exists and is writable."
          },
          "path": {
            "type": "string",
            "description": "The mount path inside DroppedNeedle's container."
          },
          "reason": {
            "$ref": "#/components/schemas/MountReason"
          }
        }
      },
      "DropImportItemResponse": {
        "type": "object",
        "description": "One album-shaped folder of an upload. Staged paths never leave the\nserver.",
        "required": [
          "id",
          "folder_name",
          "status",
          "updated_at",
          "files_total",
          "files_imported"
        ],
        "properties": {
          "album_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "What happened, as one plain sentence."
          },
          "files_imported": {
            "type": "integer",
            "format": "int64"
          },
          "files_total": {
            "type": "integer",
            "format": "int64"
          },
          "folder_name": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "reason_action": {
            "type": [
              "string",
              "null"
            ],
            "description": "What to do about it."
          },
          "reason_code": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Reason"
              }
            ],
            "description": "Why the item stopped short, when it did."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/DropItemStatus"
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "DropImportJobResponse": {
        "type": "object",
        "description": "One upload and its items.",
        "required": [
          "id",
          "status",
          "created_at",
          "upload_name",
          "user_id",
          "user_name",
          "items"
        ],
        "properties": {
          "created_at": {
            "type": "number",
            "format": "double"
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the job failed, or notes on what was skipped."
          },
          "id": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DropImportItemResponse"
            }
          },
          "status": {
            "$ref": "#/components/schemas/DropJobStatus"
          },
          "upload_name": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "user_name": {
            "type": "string"
          }
        }
      },
      "DropImportJobsResponse": {
        "type": "object",
        "description": "Newest jobs first.",
        "required": [
          "jobs"
        ],
        "properties": {
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DropImportJobResponse"
            }
          }
        }
      },
      "DropImportUpdated": {
        "type": "object",
        "description": "`drop_import_updated`: one of the user's drop-import jobs moved.",
        "required": [
          "event_id",
          "job_id"
        ],
        "properties": {
          "event_id": {
            "type": "string",
            "description": "Id for de-duplication."
          },
          "job_id": {
            "type": "string",
            "description": "The job that moved."
          }
        }
      },
      "DropItemStatus": {
        "type": "string",
        "description": "Item lifecycle. The `drop_import_items.status` CHECK lists exactly these\nvalues.",
        "enum": [
          "processing",
          "imported",
          "skipped",
          "needs_review",
          "failed",
          "discarded"
        ]
      },
      "DropJobStatus": {
        "type": "string",
        "description": "Job lifecycle. The `drop_import_jobs.status` CHECK lists exactly these\nvalues.",
        "enum": [
          "processing",
          "completed",
          "failed"
        ]
      },
      "DropUploadForm": {
        "type": "object",
        "description": "The upload form: one or more `files` parts (audio or `.zip`).",
        "required": [
          "files"
        ],
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "binary"
            }
          }
        }
      },
      "DuplicateCandidate": {
        "type": "object",
        "required": [
          "release_mbid",
          "release_group_mbid",
          "title",
          "artist_name",
          "evidence_kind",
          "exact",
          "differences"
        ],
        "properties": {
          "artist_name": {
            "type": "string"
          },
          "differences": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "evidence_kind": {
            "$ref": "#/components/schemas/DuplicateEvidenceKind"
          },
          "exact": {
            "type": "boolean"
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          }
        }
      },
      "DuplicateCheckBody": {
        "type": "object",
        "description": "Run the MusicBrainz duplicate check.",
        "required": [
          "expected_row_revision"
        ],
        "properties": {
          "different_edition_confirmed": {
            "type": "boolean",
            "description": "The curator confirmed the similar releases are other editions."
          },
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Row revision the caller last read."
          }
        }
      },
      "DuplicateCheckResult": {
        "type": "object",
        "required": [
          "schema_version",
          "checked_at",
          "input_revision",
          "candidates",
          "different_edition_confirmed"
        ],
        "properties": {
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DuplicateCandidate"
            }
          },
          "checked_at": {
            "type": "number",
            "format": "double"
          },
          "different_edition_confirmed": {
            "type": "boolean"
          },
          "input_revision": {
            "type": "string"
          },
          "schema_version": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "DuplicateClass": {
        "type": "string",
        "description": "What a group's copies show. A group lists every one that applies.",
        "enum": [
          "same_release",
          "different_releases",
          "incomplete_copy"
        ]
      },
      "DuplicateCopyView": {
        "type": "object",
        "description": "One album in a duplicate group.",
        "required": [
          "album_id",
          "title",
          "artist",
          "track_count",
          "total_size_bytes",
          "formats",
          "cover_available",
          "evidence",
          "doubted"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "The local album id; its page opens on it."
          },
          "artist": {
            "type": "string"
          },
          "cover_available": {
            "type": "boolean",
            "description": "It has cover art of its own; otherwise the group's cover stands in."
          },
          "decision_source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DecisionSource"
              }
            ],
            "description": "Who set that match."
          },
          "doubted": {
            "type": "boolean",
            "description": "Its match is a guess its files contradict."
          },
          "evidence": {
            "$ref": "#/components/schemas/DuplicateEvidence",
            "description": "How the copy names its group: its match row or its files' tags."
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The distinct file formats of its indexed tracks, sorted."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The release its match row names, when the row names this group."
          },
          "title": {
            "type": "string"
          },
          "total_size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Their bytes.",
            "minimum": 0
          },
          "track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Indexed tracks the album holds.",
            "minimum": 0
          }
        }
      },
      "DuplicateEvidence": {
        "type": "string",
        "description": "How one copy names its group.",
        "enum": [
          "stored_match",
          "file_tags"
        ]
      },
      "DuplicateEvidenceKind": {
        "type": "string",
        "description": "Duplicate evidence kinds, ordered weakest-last:\nexact_discogs_url < release_group < barcode < similar.",
        "enum": [
          "exact_discogs_url",
          "release_group",
          "barcode",
          "similar"
        ]
      },
      "DuplicateGroupView": {
        "type": "object",
        "description": "Albums the library lists more than once.",
        "required": [
          "id",
          "title",
          "artist",
          "classes",
          "copies"
        ],
        "properties": {
          "artist": {
            "type": "string",
            "description": "The first copy's artist."
          },
          "classes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DuplicateClass"
            },
            "description": "What the copies show: a shared release, different releases, a copy\nwith fewer tracks. Empty when none applies."
          },
          "copies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DuplicateCopyView"
            }
          },
          "id": {
            "type": "string",
            "description": "The release group the copies share."
          },
          "title": {
            "type": "string",
            "description": "The first copy's title, to name the group by."
          }
        }
      },
      "EditionAcquireResponse": {
        "type": "object",
        "description": "Edition-acquire outcome.",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human outcome."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The edition fetched."
          },
          "requested": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Missing tracks asked for: edition tracks no file holds and no file\nis another version of.",
            "minimum": 0
          },
          "status": {
            "$ref": "#/components/schemas/EditionAcquireStatus"
          },
          "task_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked download task, when dispatched."
          },
          "total_tracks": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Tracks on the edition (absent when the library's plan could not be\nread and the whole album was asked for).",
            "minimum": 0
          },
          "upgrades": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Owned tracks of the edition below the quality cutoff, asked for in\nthe same download; each is replaced only by a strictly better file.",
            "minimum": 0
          },
          "versions": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Tracks a file of the copy is another version of, asked for in this\nedition's version with `replace_versions`; each replaces that file\nwhen it is as good or better.",
            "minimum": 0
          }
        }
      },
      "EditionAcquireStatus": {
        "type": "string",
        "description": "What an edition acquire did.",
        "enum": [
          "started",
          "already_in_progress",
          "already_complete"
        ]
      },
      "EditionCandidateView": {
        "type": "object",
        "description": "One candidate the matcher scored, as the edition picker shows it.",
        "required": [
          "release_group_mbid",
          "album_title",
          "album_artist_name",
          "matched_files",
          "score",
          "distance",
          "penalties"
        ],
        "properties": {
          "album_artist_name": {
            "type": "string"
          },
          "album_title": {
            "type": "string"
          },
          "distance": {
            "type": "number",
            "format": "double",
            "description": "Matcher distance, 0 for a perfect match."
          },
          "matched_files": {
            "type": "integer",
            "description": "Files the release accounts for.",
            "minimum": 0
          },
          "penalties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PenaltyView"
            },
            "description": "What the distance is made of, largest share first."
          },
          "release_group_mbid": {
            "type": "string"
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "score": {
            "type": "number",
            "format": "double",
            "description": "One minus the distance."
          }
        }
      },
      "EditionChangeKind": {
        "type": "string",
        "description": "What happens to one album's edition.",
        "enum": [
          "kept",
          "moved",
          "cleared",
          "remap_queued"
        ]
      },
      "EditionChangeView": {
        "type": "object",
        "description": "What happens to one album's edition.",
        "required": [
          "local_album_id",
          "album_title",
          "change",
          "reason"
        ],
        "properties": {
          "album_title": {
            "type": "string"
          },
          "change": {
            "$ref": "#/components/schemas/EditionChangeKind"
          },
          "from_album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a moved edition, the album it came from."
          },
          "local_album_id": {
            "type": "string"
          },
          "reason": {
            "$ref": "#/components/schemas/ReasonView"
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EditionChoiceView": {
        "type": "object",
        "description": "What choosing an edition did.",
        "required": [
          "album_id",
          "release_group_mbid",
          "release_mbid",
          "retag_files",
          "extra_track_ids",
          "missing_titles",
          "status"
        ],
        "properties": {
          "album_id": {
            "type": "string"
          },
          "extra_track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Files the edition has no track for. They keep their recording."
          },
          "missing_titles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Titles of the edition's tracks no file holds."
          },
          "release_group_mbid": {
            "type": "string"
          },
          "release_mbid": {
            "type": "string"
          },
          "retag_files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RetagFileView"
            },
            "description": "Files placed on a track of the edition: pass these to a retag\npreview to write the edition's tags into them."
          },
          "status": {
            "$ref": "#/components/schemas/EditionStatusView",
            "description": "The album's edition as it now stands."
          }
        }
      },
      "EditionDatePreference": {
        "type": "string",
        "description": "Which release date wins when editions otherwise tie.",
        "enum": [
          "earliest",
          "latest",
          "any"
        ]
      },
      "EditionFactsView": {
        "type": "object",
        "description": "What MusicBrainz says about the planned edition.",
        "required": [
          "title",
          "formats",
          "disc_count",
          "track_count"
        ],
        "properties": {
          "barcode": {
            "type": [
              "string",
              "null"
            ]
          },
          "catalog_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first catalog number."
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release date as MusicBrainz gives it (`YYYY`, `YYYY-MM` or\n`YYYY-MM-DD`)."
          },
          "disambiguation": {
            "type": [
              "string",
              "null"
            ]
          },
          "disc_count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "One format per medium that names one, in medium order."
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "The first label."
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "track_count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "EditionFetchResponse": {
        "type": "object",
        "description": "The album's current or last edition fetch.",
        "properties": {
          "latest": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EditionFetchView"
              }
            ],
            "description": "Absent when the album has no edition fetch on record (none was\nstarted, or its download was cleared from the queue)."
          }
        }
      },
      "EditionFetchState": {
        "type": "string",
        "description": "Where an edition fetch is.",
        "enum": [
          "waiting",
          "fetching",
          "done",
          "failed",
          "stopped"
        ]
      },
      "EditionFetchTrack": {
        "type": "object",
        "description": "One edition position an edition fetch asked for.",
        "required": [
          "disc",
          "position",
          "state"
        ],
        "properties": {
          "disc": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "position": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "state": {
            "$ref": "#/components/schemas/EditionFetchTrackState"
          }
        }
      },
      "EditionFetchTrackState": {
        "type": "string",
        "description": "Where one asked-for track is.",
        "enum": [
          "waiting",
          "fetching",
          "landed",
          "failed",
          "held"
        ]
      },
      "EditionFetchView": {
        "type": "object",
        "description": "One edition fetch: the download asking for the edition's tracks.",
        "required": [
          "task_id",
          "state",
          "tracks",
          "replace_versions",
          "can_retry",
          "can_stop"
        ],
        "properties": {
          "can_retry": {
            "type": "boolean",
            "description": "A new fetch may be started for what is still missing."
          },
          "can_stop": {
            "type": "boolean",
            "description": "The download can be stopped."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The edition fetched."
          },
          "replace_versions": {
            "type": "boolean",
            "description": "The fetch also replaces tracks the copy holds in another version;\na retry asks the same way."
          },
          "state": {
            "$ref": "#/components/schemas/EditionFetchState"
          },
          "task_id": {
            "type": "string",
            "description": "The download fetching the tracks: the one started for them, or the\nretry the queue started by itself after it."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EditionFetchTrack"
            },
            "description": "Each position asked for. Empty when the whole album was asked for\nbecause the edition's plan could not be read."
          }
        }
      },
      "EditionFileFate": {
        "type": "string",
        "description": "What happens to one file when the album takes the edition. Choosing\nnever deletes a file.",
        "enum": [
          "keep",
          "duplicate",
          "other_version",
          "extra"
        ]
      },
      "EditionKind": {
        "type": "string",
        "description": "What kind of edition the album has.",
        "enum": [
          "release",
          "custom",
          "group_only",
          "none"
        ]
      },
      "EditionPlacingView": {
        "type": "object",
        "description": "The chosen edition's files are still being placed on it.",
        "required": [
          "attempts"
        ],
        "properties": {
          "attempts": {
            "type": "integer",
            "format": "int32",
            "description": "Failed tries so far; above 0 means MusicBrainz did not answer.",
            "minimum": 0
          }
        }
      },
      "EditionPlanFileView": {
        "type": "object",
        "description": "One of the album's files and what the edition makes of it.",
        "required": [
          "local_track_id",
          "title",
          "disc_number",
          "track_number",
          "fate",
          "matched_by_hand",
          "match_written"
        ],
        "properties": {
          "disc_number": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "edition_disc_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The edition track the file keeps, duplicates or is another version\nof.",
            "minimum": 0
          },
          "edition_position": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "fate": {
            "$ref": "#/components/schemas/EditionFileFate",
            "description": "An `other_version` file's edition track still counts as missing."
          },
          "length_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "The file's length, when the scan read it.",
            "minimum": 0
          },
          "local_track_id": {
            "type": "string"
          },
          "match_written": {
            "type": "boolean",
            "description": "DroppedNeedle has written this file since a person matched it by\nhand, so \"Undo match\" is refused until that write is undone from\nHistory. False whenever `matched_by_hand` is false."
          },
          "matched_by_hand": {
            "type": "boolean",
            "description": "A person matched this file to its edition track by hand, and the\nmatch stands: \"Undo match\" can take it back."
          },
          "note": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReasonView"
              }
            ],
            "description": "A sentence about the file's tags, when they need one:\n`TRACK_ID_CORRECTED` on a kept file whose track ID belongs to\nanother edition (it is matched by its recording, and the ID is\ncorrected when the album's MusicBrainz tags are written), or\n`TRACK_ID_ELSEWHERE` on a file that is not kept because its track ID\nbelongs to another edition and it has no recording ID. Absent\notherwise."
          },
          "suggested": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EditionSuggestionView"
              }
            ],
            "description": "The edition track no file holds that this file may be matched to\nby hand: the one its disc and track number name, or on a whole\nalbum its place in file order. Set only on a file the edition does\nnot place; nothing applies it by itself."
          },
          "title": {
            "type": "string"
          },
          "track_number": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "EditionPlanTrackView": {
        "type": "object",
        "description": "One track of the planned edition.",
        "required": [
          "disc_number",
          "position",
          "title",
          "recording_mbid",
          "release_track_mbid"
        ],
        "properties": {
          "disc_number": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "length_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "local_track_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The file that holds this track; absent when the track is missing."
          },
          "position": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "recording_mbid": {
            "type": "string"
          },
          "release_track_mbid": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "EditionPlanView": {
        "type": "object",
        "description": "What taking an edition would do to the album, before anything changes.",
        "required": [
          "album_id",
          "release_group_mbid",
          "release_mbid",
          "title",
          "artist_name",
          "is_current",
          "same_album",
          "identity_revision",
          "edition",
          "kept_count",
          "missing_count",
          "duplicate_count",
          "other_version_count",
          "extra_count",
          "tracks",
          "files"
        ],
        "properties": {
          "album_id": {
            "type": "string"
          },
          "artist_name": {
            "type": "string"
          },
          "duplicate_count": {
            "type": "integer",
            "minimum": 0
          },
          "edition": {
            "$ref": "#/components/schemas/EditionFactsView"
          },
          "extra_count": {
            "type": "integer",
            "minimum": 0
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EditionPlanFileView"
            }
          },
          "identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The album identity's row revision the plan was read at, 0 when the\nalbum has none. Matching a file by hand echoes it."
          },
          "is_current": {
            "type": "boolean",
            "description": "The edition is already the album's edition."
          },
          "kept_count": {
            "type": "integer",
            "minimum": 0
          },
          "missing_count": {
            "type": "integer",
            "description": "Edition tracks no file holds, including those a file is another\nversion of.",
            "minimum": 0
          },
          "other_version_count": {
            "type": "integer",
            "minimum": 0
          },
          "release_group_mbid": {
            "type": "string"
          },
          "release_mbid": {
            "type": "string"
          },
          "same_album": {
            "type": "boolean",
            "description": "The edition belongs to the album's current release group (false\nfor an album with none)."
          },
          "title": {
            "type": "string"
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EditionPlanTrackView"
            }
          }
        }
      },
      "EditionPreferences": {
        "type": "object",
        "description": "How DroppedNeedle picks between editions of one album when the files\ndo not settle it, and which edition it fetches for an album you do\nnot have yet. A person's choice always wins, then the best fit for the\nfiles, then these preferences, in this order.",
        "properties": {
          "avoid_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Release types to avoid unless nothing else fits (`live`,\n`compilation`, `remix`, `soundtrack`, `demo`).",
            "default": [
              "live",
              "compilation"
            ]
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Release countries, most wanted first, as two-letter codes (`XW` is\nworldwide). Empty means your store region, then worldwide.",
            "default": []
          },
          "date": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EditionDatePreference"
              }
            ],
            "description": "Earliest, latest, or any release date.",
            "default": "earliest"
          },
          "format_order": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Media formats, most wanted first (`digital media`, `cd`, `vinyl`,\n`cassette`). A format matches when its name contains the entry.",
            "default": [
              "digital media",
              "cd",
              "vinyl",
              "cassette"
            ]
          },
          "manage_unconfirmed": {
            "type": "boolean",
            "description": "Let file tagging and organizing work on albums whose match is still\nunconfirmed. Off: those albums wait until someone confirms them.",
            "default": false
          },
          "status_order": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Release statuses, most wanted first (`official`, `promotion`,\n`bootleg`, `pseudo-release`). Unlisted statuses come last.",
            "default": [
              "official",
              "promotion",
              "bootleg",
              "pseudo-release"
            ]
          },
          "version": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EditionVersionPreference"
              }
            ],
            "description": "Standard, deluxe, or either.",
            "default": "standard"
          }
        }
      },
      "EditionRevisionBody": {
        "type": "object",
        "description": "The edition revision a change was decided on.",
        "required": [
          "expected_identity_revision"
        ],
        "properties": {
          "expected_identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `identity_revision` the edition status showed."
          }
        }
      },
      "EditionState": {
        "type": "string",
        "description": "Where an album's edition stands.",
        "enum": [
          "chosen",
          "confirmed",
          "unconfirmed",
          "unmatched",
          "unidentified"
        ]
      },
      "EditionStatusView": {
        "type": "object",
        "description": "Where one album's edition stands.",
        "required": [
          "album_id",
          "state",
          "reason",
          "candidates",
          "undo_available",
          "identity_revision",
          "edition_kind",
          "identifying",
          "files_by_itself",
          "writing",
          "keeps_own_tags",
          "disputed_tracks",
          "looks_wrong",
          "looks_wrong_count"
        ],
        "properties": {
          "album_id": {
            "type": "string"
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EditionCandidateView"
            },
            "description": "The closest candidates, best first (for a guess or no match)."
          },
          "chosen_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "When it was chosen (epoch seconds), for a chosen one."
          },
          "chosen_by_user_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who chose the edition, for a chosen one."
          },
          "disputed_tracks": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Titles of the files whose audio sounds like another track of the\nguess (`AUDIO_DISAGREES`)."
          },
          "edition_kind": {
            "$ref": "#/components/schemas/EditionKind",
            "description": "`release` (a MusicBrainz release), `custom` (a custom edition),\n`group_only` (a release group with no release chosen) or `none`."
          },
          "files_by_itself": {
            "type": "boolean",
            "description": "The app writes the edition's tags and file names by itself after a\nchoice: the album's folder manages it automatically and nothing\nholds it back."
          },
          "identifying": {
            "type": "boolean",
            "description": "An identification of the album is queued or running, as after\n\"Let DroppedNeedle choose\"."
          },
          "identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The identity's row revision, 0 when the album has none. A guarded\nwrite echoes it."
          },
          "keeps_own_tags": {
            "type": "boolean",
            "description": "A file of the album sits in a folder that keeps its own tags (the\nLocal metadata policy, of the folder or a path rule): the app\nwrites no tags or names there, and downloads land as they came."
          },
          "looks_wrong": {
            "type": "boolean",
            "description": "The caller marked the album's match \"Looks wrong\"."
          },
          "looks_wrong_count": {
            "type": "integer",
            "format": "int32",
            "description": "How many people marked it.",
            "minimum": 0
          },
          "named_release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The release group every file's tags name, when the guess fits\nanother (`NAMED_GROUP_DIFFERS`): its editions are worth a look."
          },
          "placing": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EditionPlacingView"
              }
            ],
            "description": "Set while the chosen edition's files are still being placed on it."
          },
          "reason": {
            "$ref": "#/components/schemas/ReasonView",
            "description": "Why the edition is what it is, and what to do about it."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/EditionState",
            "description": "`chosen` (by a person), `confirmed`, `unconfirmed` (a best guess),\n`unmatched` (keeps its own tags), or `unidentified`."
          },
          "undo_available": {
            "type": "boolean",
            "description": "The last edition change can still be taken back."
          },
          "writing": {
            "type": "boolean",
            "description": "That write is still to happen."
          }
        }
      },
      "EditionSuggestionView": {
        "type": "object",
        "description": "An edition track suggested for a file.",
        "required": [
          "disc_number",
          "position",
          "release_track_mbid"
        ],
        "properties": {
          "disc_number": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "position": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "release_track_mbid": {
            "type": "string"
          }
        }
      },
      "EditionTagChangeView": {
        "type": "object",
        "description": "One tag that changes. Several values are joined with \"; \"; absent\nmeans the tag is not there.",
        "required": [
          "field"
        ],
        "properties": {
          "field": {
            "type": "string",
            "description": "Tag field name, or `musicbrainz_ids` for the MusicBrainz ids,\ncounted in `to`."
          },
          "from": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EditionTagFileView": {
        "type": "object",
        "description": "One file of a tag write and what it changes there.",
        "required": [
          "path",
          "changes",
          "removed_tags",
          "artwork_changed",
          "added_files"
        ],
        "properties": {
          "added_files": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Files written next to it (a cover, a lyrics file), by path."
          },
          "artwork_changed": {
            "type": "boolean",
            "description": "The embedded cover art changes."
          },
          "blocked": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReasonView"
              }
            ],
            "description": "Why the file is left alone, when it is."
          },
          "changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EditionTagChangeView"
            }
          },
          "path": {
            "type": "string",
            "description": "The file's path in its library folder."
          },
          "removed_tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tags outside the profile's fields that the write removes."
          },
          "track_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "EditionTagsApplyBody": {
        "type": "object",
        "description": "Apply a planned tag write, or its undo.",
        "required": [
          "preview_token",
          "expected_row_revision",
          "idempotency_key"
        ],
        "properties": {
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `row_revision` the job showed."
          },
          "idempotency_key": {
            "type": "string",
            "description": "Makes a retried apply answer with the same job."
          },
          "preview_token": {
            "type": "string"
          }
        }
      },
      "EditionTagsBody": {
        "type": "object",
        "description": "Preview the edition's tags in the album's files.",
        "required": [
          "release_mbid",
          "expected_identity_revision"
        ],
        "properties": {
          "expected_identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `identity_revision` the edition status showed."
          },
          "release_mbid": {
            "type": "string",
            "description": "The album's edition, as the edition status showed it."
          }
        }
      },
      "EditionTagsJobView": {
        "type": "object",
        "description": "A tag write as the edition sheet shows it.",
        "required": [
          "job_id",
          "step",
          "undo",
          "undo_available",
          "row_revision",
          "ready_to_apply",
          "expired",
          "stale_reasons",
          "files"
        ],
        "properties": {
          "expired": {
            "type": "boolean"
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EditionTagFileView"
            },
            "description": "Every planned file, once planning is done."
          },
          "job_id": {
            "type": "string"
          },
          "ready_to_apply": {
            "type": "boolean",
            "description": "Planned, current and not expired."
          },
          "reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReasonView"
              }
            ],
            "description": "Why the job ended without writing, when it did."
          },
          "row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Echo this on apply and undo."
          },
          "stale_reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why a planned write can no longer be applied, in words."
          },
          "step": {
            "$ref": "#/components/schemas/EditionTagsStep"
          },
          "undo": {
            "type": "boolean",
            "description": "This job puts an earlier tag write back."
          },
          "undo_available": {
            "type": "boolean",
            "description": "A finished write, whole or partial, that `.../undo` can still put\nback."
          }
        }
      },
      "EditionTagsQueuedView": {
        "type": "object",
        "description": "A tag write or its undo, queued, and the token that applies it.",
        "required": [
          "job_id",
          "preview_token",
          "expires_at"
        ],
        "properties": {
          "expires_at": {
            "type": "number",
            "format": "double",
            "description": "When the preview can no longer be applied (epoch seconds)."
          },
          "job_id": {
            "type": "string"
          },
          "preview_token": {
            "type": "string",
            "description": "Pass to `.../apply`; it is shown once."
          }
        }
      },
      "EditionTagsStep": {
        "type": "string",
        "description": "Where a tag write stands.",
        "enum": [
          "waiting",
          "planning",
          "ready",
          "writing",
          "done",
          "failed"
        ]
      },
      "EditionTagsUndoBody": {
        "type": "object",
        "description": "Plan putting a tag write back.",
        "required": [
          "expected_row_revision",
          "idempotency_key"
        ],
        "properties": {
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `row_revision` the written job showed."
          },
          "idempotency_key": {
            "type": "string",
            "description": "Makes a retried undo answer with the same job."
          }
        }
      },
      "EditionVersionPreference": {
        "type": "string",
        "description": "Standard or expanded editions.",
        "enum": [
          "standard",
          "deluxe",
          "any"
        ]
      },
      "EffectivePolicy": {
        "type": "string",
        "description": "Effective policy for one scope or inventory row.",
        "enum": [
          "local_metadata",
          "automatic",
          "excluded"
        ]
      },
      "Eligibility": {
        "type": "string",
        "description": "Whether a planned file will be written.",
        "enum": [
          "eligible",
          "warning",
          "blocked",
          "stale"
        ]
      },
      "EmailUpdate": {
        "type": "object",
        "description": "Change email. Null or blank clears it.",
        "properties": {
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "New email, or null to clear."
          }
        }
      },
      "Emptied": {
        "type": "object",
        "description": "What the last finished run did.",
        "required": [
          "at",
          "deleted",
          "freed_bytes",
          "older_folders",
          "kept",
          "kept_files",
          "waited"
        ],
        "properties": {
          "at": {
            "type": "integer",
            "format": "int64",
            "description": "When it finished, unix milliseconds."
          },
          "by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who asked, while the account exists."
          },
          "deleted": {
            "type": "integer",
            "format": "int32",
            "description": "Copies deleted, or found already gone.",
            "minimum": 0
          },
          "freed_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "kept": {
            "type": "integer",
            "format": "int32",
            "description": "Copies kept: changed in the bin, or not where it may delete.",
            "minimum": 0
          },
          "kept_files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeptName"
            },
            "description": "Up to 20 of them, with why."
          },
          "older_folders": {
            "type": "integer",
            "format": "int32",
            "description": "Old bin folders no row named, emptied.",
            "minimum": 0
          },
          "waited": {
            "type": "integer",
            "format": "int32",
            "description": "Copies left for later: held by a put-back, or a bin that looked\nempty.",
            "minimum": 0
          }
        }
      },
      "EmptyRecycleBinBody": {
        "type": "object",
        "description": "Empty the bin of what it held at `before`.",
        "required": [
          "before"
        ],
        "properties": {
          "before": {
            "type": "integer",
            "format": "int64",
            "description": "The summary's `as_of`: only copies in the bin by then are deleted."
          }
        }
      },
      "EmptyRecycleBinView": {
        "type": "object",
        "description": "Empty was queued.",
        "required": [
          "joined"
        ],
        "properties": {
          "joined": {
            "type": "boolean",
            "description": "A run was already waiting; it goes ahead with its own moment."
          }
        }
      },
      "EmptyingState": {
        "type": "string",
        "description": "Whether the bin is being emptied.",
        "enum": [
          "idle",
          "emptying",
          "stopped"
        ]
      },
      "EnrichmentBatchRequest": {
        "type": "object",
        "description": "The single enrich-batch body: both enrichable buckets in one call.",
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumEnrichmentRequest"
            },
            "description": "Albums to enrich (capped per bucket, extras ignored)."
          },
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistEnrichmentRequest"
            },
            "description": "Artists to enrich (capped per bucket, extras ignored)."
          }
        }
      },
      "EnrichmentManagementSettings": {
        "type": "object",
        "description": "Enrichment management block.",
        "properties": {
          "lyrics": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/LyricsManagementSettings"
              }
            ],
            "description": "Lyrics.",
            "default": {
              "enabled": false,
              "preserve_existing": false,
              "required": false,
              "write_plain": true,
              "write_synced": true
            }
          },
          "replaygain": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReplayGainManagementSettings"
              }
            ],
            "description": "ReplayGain.",
            "default": {
              "album_aware": true,
              "enabled": false,
              "mode": "preserve",
              "required": false
            }
          }
        }
      },
      "EnrichmentResponse": {
        "type": "object",
        "description": "Enrich-batch response for both buckets plus degradation notes.",
        "required": [
          "artists",
          "albums",
          "degradations"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumEnrichment"
            },
            "description": "Album counts, same order as the request."
          },
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistEnrichment"
            },
            "description": "Artist counts, same order as the request."
          },
          "degradations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Degradation"
            },
            "description": "Sources that degraded while answering; usually empty."
          },
          "source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ListenSource"
              }
            ],
            "description": "Provider that answered; `null` when none did, and the counts are\nthen absent, never zero-filled."
          }
        }
      },
      "EntryOrigin": {
        "type": "string",
        "description": "Where an entry's files came from.",
        "enum": [
          "download",
          "upload",
          "import_folder"
        ]
      },
      "EntryState": {
        "type": "string",
        "description": "Where an entry is in its life.",
        "enum": [
          "held",
          "placing",
          "resolved",
          "expired"
        ]
      },
      "ErrorBody": {
        "type": "object",
        "description": "The `error` object inside every error response.",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "SCREAMING_SNAKE machine code."
          },
          "details": {
            "description": "Extra detail, or null when there is none."
          },
          "message": {
            "type": "string",
            "description": "Human message. Fixed for 5xx, descriptive for 4xx."
          }
        }
      },
      "ErrorEnvelope": {
        "type": "object",
        "description": "Top-level error envelope.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorBody",
            "description": "The single error payload."
          }
        }
      },
      "EventCitiesResponse": {
        "type": "object",
        "description": "The caller's saved cities, in picker order.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventCity"
            },
            "description": "Cities in order."
          }
        }
      },
      "EventCitiesUpdate": {
        "type": "object",
        "description": "Replace-all body: the picker sends its whole list in order.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventCityInput"
            },
            "description": "Cities in order. At most 50 are kept."
          }
        }
      },
      "EventCity": {
        "type": "object",
        "description": "One saved city. Its coordinates are in range and its radius is\nwithin 1-500 km.",
        "required": [
          "city_name",
          "latitude",
          "longitude",
          "radius_km"
        ],
        "properties": {
          "city_name": {
            "type": "string",
            "description": "Display name."
          },
          "country_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Country code, when known."
          },
          "latitude": {
            "type": "number",
            "format": "double",
            "description": "Latitude in degrees."
          },
          "longitude": {
            "type": "number",
            "format": "double",
            "description": "Longitude in degrees."
          },
          "radius_km": {
            "type": "number",
            "format": "double",
            "description": "Match radius in km."
          }
        }
      },
      "EventCityInput": {
        "type": "object",
        "description": "One city as the picker submits it.",
        "required": [
          "city_name",
          "latitude",
          "longitude"
        ],
        "properties": {
          "city_name": {
            "type": "string",
            "description": "Display name; blank entries are dropped."
          },
          "country_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Country code, when known."
          },
          "latitude": {
            "type": "number",
            "format": "double",
            "description": "Latitude, -90 to 90."
          },
          "longitude": {
            "type": "number",
            "format": "double",
            "description": "Longitude, -180 to 180."
          },
          "radius_km": {
            "type": "number",
            "format": "double",
            "description": "Match radius in km, clamped to 1-500.",
            "default": 30.0
          }
        }
      },
      "EventSource": {
        "type": "string",
        "description": "Where a feed row came from.",
        "enum": [
          "ticketmaster",
          "skiddle"
        ]
      },
      "EventsSettings": {
        "type": "object",
        "description": "Upcoming-events sources. The sweep runs daily at `poll_time`.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "poll_time": {
            "type": "string",
            "description": "Daily sweep time, server-local `HH:MM`.",
            "default": "06:00"
          },
          "skiddle_api_key": {
            "type": "string",
            "description": "Skiddle key (encrypted at rest).",
            "default": ""
          },
          "skiddle_enabled": {
            "type": "boolean",
            "description": "Skiddle switch.",
            "default": false
          },
          "sweep_scope": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventsSweepScope"
              }
            ],
            "description": "Sweep scope.",
            "default": "followed"
          },
          "ticketmaster_api_key": {
            "type": "string",
            "description": "Ticketmaster key (encrypted at rest).",
            "default": ""
          },
          "ticketmaster_enabled": {
            "type": "boolean",
            "description": "Ticketmaster switch.",
            "default": false
          }
        }
      },
      "EventsSweepScope": {
        "type": "string",
        "description": "Events sweep scope.",
        "enum": [
          "followed",
          "library"
        ]
      },
      "EvidenceClass": {
        "type": "string",
        "description": "Per-track verdict against one candidate.",
        "enum": [
          "supported",
          "unknown",
          "contradictory"
        ]
      },
      "ExampleAlbum": {
        "type": "string",
        "description": "The built-in example albums a script is shown against: one disc, two\ndiscs with an edition note, and an album artist whose name another\nartist shares, told apart by MusicBrainz's disambiguation.",
        "enum": [
          "one_disc",
          "two_discs",
          "name_shared"
        ]
      },
      "ExportFormat": {
        "type": "string",
        "description": "File a playlist export is written as.",
        "enum": [
          "m3u8",
          "csv"
        ]
      },
      "ExtensionCase": {
        "type": "string",
        "description": "Extension case policy.",
        "enum": [
          "preserve",
          "lower",
          "upper"
        ]
      },
      "ExternalLink": {
        "type": "object",
        "description": "One external link on an artist page.",
        "required": [
          "type",
          "url",
          "label",
          "category"
        ],
        "properties": {
          "category": {
            "type": "string",
            "description": "`music`, `social`, `info` or `other`."
          },
          "label": {
            "type": "string",
            "description": "Display label (`Bandcamp`, `Wikipedia`, ...)."
          },
          "type": {
            "type": "string",
            "description": "MusicBrainz relationship type (`official homepage`, `bandcamp`, ...)."
          },
          "url": {
            "type": "string",
            "description": "The URL."
          }
        }
      },
      "ExternalRefresh": {
        "type": "object",
        "description": "One media server's rescan after a run, as the run's page shows it.",
        "required": [
          "target",
          "state",
          "attempts"
        ],
        "properties": {
          "attempts": {
            "type": "integer",
            "format": "int32",
            "description": "Tries so far.",
            "minimum": 0
          },
          "code": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RefreshCode"
              }
            ],
            "description": "Why the last try did not go through."
          },
          "finished_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "When it ended, unix ms."
          },
          "state": {
            "$ref": "#/components/schemas/RefreshState"
          },
          "target": {
            "$ref": "#/components/schemas/RefreshTarget"
          }
        }
      },
      "ExternalRefreshSettings": {
        "type": "object",
        "description": "External-server refresh after publishing.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "jellyfin_enabled": {
            "type": "boolean",
            "description": "Refresh Jellyfin.",
            "default": false
          },
          "navidrome_enabled": {
            "type": "boolean",
            "description": "Refresh Navidrome.",
            "default": false
          },
          "plex_enabled": {
            "type": "boolean",
            "description": "Refresh Plex.",
            "default": false
          }
        }
      },
      "FailureCode": {
        "type": "string",
        "description": "Why a scan skipped or failed a path, or why a run ended early. The\n`WALK_E*` codes name the operating system's error for a folder the scan\ncould not read.",
        "enum": [
          "ROOT_UNAVAILABLE",
          "ROOT_PERMISSION_DENIED",
          "WALK_TIMEOUT",
          "WALKER_UNAVAILABLE",
          "PROBE_UNAVAILABLE",
          "WALK_SUPERSEDED",
          "WALK_ERROR",
          "WALK_EPERM",
          "WALK_ENOENT",
          "WALK_EIO",
          "WALK_EACCES",
          "WALK_ENOTDIR",
          "WALK_EISDIR",
          "WALK_EINVAL",
          "WALK_ENFILE",
          "WALK_EMFILE",
          "WALK_ENOSPC",
          "WALK_EROFS",
          "WALK_ENAMETOOLONG",
          "WALK_ELOOP",
          "WALK_EUNKNOWN",
          "SYMLINK_ESCAPE_OUT",
          "NON_REGULAR_FILE",
          "WALK_NAME_ENCODING",
          "NFC_TWIN_COLLISION",
          "TAG_READ_DEFERRED",
          "TAG_READ_FAILED",
          "MTIME_SKEW",
          "SUPERSEDED_POLICY_CHANGED",
          "UNEXPECTED_WORKER_FAILURE",
          "MASS_MISSING_GUARD",
          "CATALOG_COMMIT_FAILED",
          "SCOPE_THROUGH_LINK",
          "SCOPE_RENAMED"
        ]
      },
      "FavoriteStatusResponse": {
        "type": "object",
        "description": "Favorite-status answer.",
        "required": [
          "kind",
          "item_id",
          "favorited"
        ],
        "properties": {
          "favorited": {
            "type": "boolean",
            "description": "Current state."
          },
          "item_id": {
            "type": "string",
            "description": "The id the favourite is stored under: the item's current id, which\ndiffers from the one sent after a merge."
          },
          "kind": {
            "type": "string",
            "description": "Favorited kind."
          }
        }
      },
      "FavoritesView": {
        "type": "object",
        "description": "Favorites grouped by kind.",
        "required": [
          "artists",
          "albums",
          "tracks"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesAlbumView"
            },
            "description": "Favorite albums."
          },
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesArtistView"
            },
            "description": "Favorite artists."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesTrackView"
            },
            "description": "Favorite tracks."
          }
        }
      },
      "FederatedUserView": {
        "type": "object",
        "description": "Authenticated user, federated view. Stored provider rows never surface;\nonly the profile fields the SPA renders.",
        "required": [
          "id",
          "display_name",
          "role",
          "username",
          "username_display"
        ],
        "properties": {
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Avatar URL from the provider."
          },
          "display_name": {
            "type": "string",
            "description": "Display name from the provider."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Lowercased email, when the provider supplies one."
          },
          "id": {
            "type": "string",
            "description": "User id."
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          },
          "username": {
            "type": "string",
            "description": "Lowercased login identifier."
          },
          "username_display": {
            "type": "string",
            "description": "Preferred casing for display."
          }
        }
      },
      "FieldMode": {
        "type": "string",
        "description": "Tag-field write mode.",
        "enum": [
          "disabled",
          "replace",
          "fill_missing",
          "merge",
          "preserve"
        ]
      },
      "FilesystemWatcher": {
        "type": "object",
        "description": "Zero-dependency filesystem poller knobs.",
        "properties": {
          "batch_window_seconds": {
            "type": "number",
            "format": "double",
            "description": "Burst-collapse window in seconds (minimum 0).",
            "default": 60.0
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": true
          },
          "poll_interval_seconds": {
            "type": "number",
            "format": "double",
            "description": "Stat-snapshot cadence in seconds (minimum 1).",
            "default": 300.0
          }
        }
      },
      "FilterFacetsView": {
        "type": "object",
        "description": "Jellyfin filter facets for the album browser.",
        "required": [
          "years",
          "tags",
          "studios"
        ],
        "properties": {
          "studios": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Studios (labels), sorted."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tags, sorted."
          },
          "years": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "description": "Release years, newest first."
          }
        }
      },
      "FindingCode": {
        "type": "string",
        "description": "One album's verdict in a repair report.",
        "enum": [
          "valid",
          "safe_detach",
          "manual_identity",
          "needs_review",
          "unverifiable",
          "stale",
          "ready",
          "mapping_ready",
          "exact_release_required",
          "exact_release_suggested",
          "exact_release_auto_accepted"
        ]
      },
      "FindingRow": {
        "type": "object",
        "description": "One stored finding with the album it is about.",
        "required": [
          "id",
          "local_album_id",
          "album_title",
          "cover_available",
          "finding_code",
          "reason_code",
          "confidence",
          "apply_eligible",
          "state",
          "updated_at",
          "row_revision"
        ],
        "properties": {
          "album_artist_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "album_title": {
            "type": "string"
          },
          "album_year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "apply_eligible": {
            "type": "boolean"
          },
          "apply_result": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ApplyResult"
              }
            ]
          },
          "confidence": {
            "$ref": "#/components/schemas/Confidence"
          },
          "cover_available": {
            "type": "boolean"
          },
          "finding_code": {
            "$ref": "#/components/schemas/FindingCode"
          },
          "id": {
            "type": "string"
          },
          "local_album_id": {
            "type": "string"
          },
          "reason_code": {
            "type": "string"
          },
          "review_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "row_revision": {
            "type": "integer",
            "format": "int64"
          },
          "state": {
            "$ref": "#/components/schemas/FindingState"
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "FindingState": {
        "type": "string",
        "description": "Where a finding is.",
        "enum": [
          "open",
          "applied",
          "skipped",
          "stale"
        ]
      },
      "FolderResolutionView": {
        "type": "object",
        "description": "Navidrome folder preference resolution for the caller.",
        "required": [
          "mode",
          "folder_ids",
          "available_folders",
          "stale_folder_ids",
          "source_available"
        ],
        "properties": {
          "available_folders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MusicFolderView"
            },
            "description": "Folders the server currently exposes."
          },
          "folder_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Effective folder ids (\"all\" means upstream default scoping)."
          },
          "mode": {
            "type": "string",
            "description": "\"all\" or \"selected\"."
          },
          "source_available": {
            "type": "boolean",
            "description": "False when the source is down; the scope still echoes the preference."
          },
          "stale_folder_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Selected ids the server no longer exposes."
          }
        }
      },
      "FolderSave": {
        "type": "object",
        "description": "Save payload for the Navidrome folder preference.",
        "required": [
          "mode",
          "selected_folder_ids"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "description": "\"all\" or \"selected\"."
          },
          "selected_folder_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Selected folder ids. Must be empty for \"all\", non-empty for \"selected\"."
          }
        }
      },
      "FollowBody": {
        "type": "object",
        "description": "Follow-toggle body.",
        "required": [
          "followed"
        ],
        "properties": {
          "artist_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist name to keep, when following."
          },
          "followed": {
            "type": "boolean",
            "description": "True follows the artist; false unfollows (and drops auto-download)."
          }
        }
      },
      "FollowStatusResponse": {
        "type": "object",
        "description": "Follow-status answer for one artist.",
        "required": [
          "artist_mbid",
          "followed",
          "auto_download",
          "auto_download_state"
        ],
        "properties": {
          "artist_mbid": {
            "type": "string",
            "description": "Artist MBID."
          },
          "auto_download": {
            "type": "boolean",
            "description": "Whether auto-download is wanted."
          },
          "auto_download_state": {
            "$ref": "#/components/schemas/AutoDownloadState",
            "description": "Approval state of the auto-download ask."
          },
          "followed": {
            "type": "boolean",
            "description": "Whether the caller follows the artist."
          }
        }
      },
      "FollowedArtist": {
        "type": "object",
        "description": "One followed artist.",
        "required": [
          "artist_mbid",
          "name",
          "auto_download",
          "auto_download_state",
          "followed_at"
        ],
        "properties": {
          "artist_mbid": {
            "type": "string",
            "description": "Artist MBID."
          },
          "auto_download": {
            "type": "boolean",
            "description": "Whether auto-download is wanted."
          },
          "auto_download_state": {
            "$ref": "#/components/schemas/AutoDownloadState",
            "description": "Approval state of the auto-download ask."
          },
          "followed_at": {
            "type": "integer",
            "format": "int64",
            "description": "When the follow started, epoch seconds.",
            "minimum": 0
          },
          "name": {
            "type": "string",
            "description": "Artist name as known when followed."
          }
        }
      },
      "FollowedArtistListResponse": {
        "type": "object",
        "description": "Followed-artist list answer.",
        "required": [
          "artists"
        ],
        "properties": {
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FollowedArtist"
            },
            "description": "Followed artists."
          }
        }
      },
      "FormatMode": {
        "type": "string",
        "description": "Whether a list keeps the items in its `formats` or the ones in none.",
        "enum": [
          "with",
          "without"
        ]
      },
      "GenreAlias": {
        "type": "object",
        "description": "One genre alias.",
        "properties": {
          "source": {
            "type": "string",
            "description": "Source label.",
            "default": ""
          },
          "target": {
            "type": "string",
            "description": "Target label.",
            "default": ""
          }
        }
      },
      "GenreArtwork": {
        "type": "object",
        "description": "Genre mosaic art: a collage of owned covers or a flat gradient.",
        "required": [
          "kind",
          "version",
          "albums"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenreArtworkAlbum"
            },
            "description": "Owned covers composing the collage (empty for gradients)."
          },
          "kind": {
            "$ref": "#/components/schemas/ArtworkKind",
            "description": "How the art is drawn."
          },
          "version": {
            "type": "string",
            "description": "Artwork schema version."
          }
        }
      },
      "GenreArtworkAlbum": {
        "type": "object",
        "description": "One cover inside a genre collage.",
        "required": [
          "album_id",
          "album_title",
          "cover_version"
        ],
        "properties": {
          "album_artist_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album artist name, when known."
          },
          "album_id": {
            "type": "string",
            "description": "Native album id."
          },
          "album_title": {
            "type": "string",
            "description": "Album title."
          },
          "cover_version": {
            "type": "integer",
            "format": "int64",
            "description": "Cover revision for cache busting."
          }
        }
      },
      "GenreDetailResponse": {
        "type": "object",
        "description": "Owned plus popular rows behind one genre page.",
        "required": [
          "genre",
          "genre_artwork"
        ],
        "properties": {
          "genre": {
            "type": "string",
            "description": "Genre name as requested."
          },
          "genre_artwork": {
            "$ref": "#/components/schemas/GenreArtwork",
            "description": "Mosaic art for the genre."
          },
          "library": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GenreLibrarySection"
              }
            ],
            "description": "Owned rows for the genre."
          },
          "popular": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GenrePopularSection"
              }
            ],
            "description": "Popular rows for the genre."
          },
          "total_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Total popular rows, when counted."
          }
        }
      },
      "GenreLibrarySection": {
        "type": "object",
        "description": "Owned artists and albums for a genre.",
        "required": [
          "artists",
          "albums",
          "artist_count",
          "album_count"
        ],
        "properties": {
          "album_count": {
            "type": "integer",
            "format": "int64",
            "description": "Total owned albums."
          },
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumRef"
            },
            "description": "Owned albums."
          },
          "artist_count": {
            "type": "integer",
            "format": "int64",
            "description": "Total owned artists."
          },
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistRef"
            },
            "description": "Owned artists."
          }
        }
      },
      "GenreManagementSettings": {
        "type": "object",
        "description": "Genre management block.",
        "properties": {
          "aliases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenreAlias"
            },
            "description": "Aliases.",
            "default": []
          },
          "allowlist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Allowed labels.",
            "default": []
          },
          "canonicalize": {
            "type": "boolean",
            "description": "Canonicalize labels.",
            "default": true
          },
          "denylist": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Blocked labels.",
            "default": []
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": true
          },
          "lastfm_minimum_weight": {
            "type": "integer",
            "format": "int64",
            "description": "Last.fm weight floor.",
            "default": 10
          },
          "lastfm_whitelist_only": {
            "type": "boolean",
            "description": "Last.fm whitelisted tags only.",
            "default": true
          },
          "listenbrainz_curated_only": {
            "type": "boolean",
            "description": "ListenBrainz curated tags only.",
            "default": true
          },
          "listenbrainz_minimum_count": {
            "type": "integer",
            "format": "int64",
            "description": "ListenBrainz vote floor.",
            "default": 1
          },
          "maximum_count": {
            "type": "integer",
            "format": "int64",
            "description": "Max genres written.",
            "default": 5
          },
          "mode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenreMode"
              }
            ],
            "description": "Write mode.",
            "default": "replace"
          },
          "musicbrainz_minimum_count": {
            "type": "integer",
            "format": "int64",
            "description": "MusicBrainz vote floor.",
            "default": 1
          },
          "preferred_casing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Preferred casing.",
            "default": []
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenreSource"
            },
            "description": "Genre sources.",
            "default": [
              "musicbrainz",
              "listenbrainz"
            ]
          },
          "write_primary_only_for_constrained_formats": {
            "type": "boolean",
            "description": "Primary genre only for constrained formats.",
            "default": false
          }
        }
      },
      "GenreMode": {
        "type": "string",
        "description": "Genre write mode.",
        "enum": [
          "replace",
          "merge",
          "fill_missing"
        ]
      },
      "GenrePopularSection": {
        "type": "object",
        "description": "Popular artists and albums for a genre.",
        "required": [
          "artists",
          "albums",
          "has_more_artists",
          "has_more_albums"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumRef"
            },
            "description": "Popular albums."
          },
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistRef"
            },
            "description": "Popular artists."
          },
          "has_more_albums": {
            "type": "boolean",
            "description": "More albums behind the offsets."
          },
          "has_more_artists": {
            "type": "boolean",
            "description": "More artists behind the offsets."
          }
        }
      },
      "GenreRef": {
        "type": "object",
        "description": "One genre inside a section.",
        "required": [
          "name"
        ],
        "properties": {
          "artist_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Owned artists tagged with this genre, when counted."
          },
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz id of the seed artist behind the row, when there is one."
          },
          "listen_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Listen or play count behind the row, when known."
          },
          "name": {
            "type": "string",
            "description": "Genre name."
          }
        }
      },
      "GenreSource": {
        "type": "string",
        "description": "Genre source.",
        "enum": [
          "musicbrainz",
          "listenbrainz",
          "lastfm",
          "existing_local"
        ]
      },
      "GetIt": {
        "type": "object",
        "description": "Store-region settings.",
        "properties": {
          "store_region": {
            "type": "string",
            "description": "Two-letter store region.",
            "default": "US"
          }
        }
      },
      "GitHubRelease": {
        "type": "object",
        "description": "One GitHub release row.",
        "required": [
          "tag_name",
          "published_at",
          "html_url",
          "prerelease"
        ],
        "properties": {
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release notes when set."
          },
          "html_url": {
            "type": "string",
            "description": "Release page URL."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release title when set."
          },
          "prerelease": {
            "type": "boolean",
            "description": "True for prereleases."
          },
          "published_at": {
            "type": "string",
            "description": "Publish timestamp."
          },
          "tag_name": {
            "type": "string",
            "description": "Release tag."
          }
        }
      },
      "HandBackAllResponse": {
        "type": "object",
        "description": "Answer to handing every album back.",
        "required": [
          "albums"
        ],
        "properties": {
          "albums": {
            "type": "integer",
            "description": "Albums that now wait for their turn to be handed back.",
            "minimum": 0
          }
        }
      },
      "HandBackResponse": {
        "type": "object",
        "description": "Hand-back answer.",
        "required": [
          "handed_back"
        ],
        "properties": {
          "handed_back": {
            "type": "boolean",
            "description": "False when DroppedNeedle had not stepped back from the album."
          }
        }
      },
      "HealthResponse": {
        "type": "object",
        "description": "Health payload. The route is public, so it says nothing about the\nserver's internals; admins read those from the admin routes.",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human-readable running message."
          },
          "status": {
            "$ref": "#/components/schemas/HealthStatus",
            "description": "What the server is doing."
          }
        }
      },
      "HealthStatus": {
        "type": "string",
        "description": "What the server is doing, as the health check reports it.",
        "enum": [
          "ok",
          "upgrade"
        ]
      },
      "HeldActionResponse": {
        "type": "object",
        "description": "What an action did.",
        "required": [
          "imported",
          "already_owned",
          "discarded",
          "still_held"
        ],
        "properties": {
          "already_owned": {
            "type": "integer",
            "description": "Files the library already held, so nothing was added.",
            "minimum": 0
          },
          "discarded": {
            "type": "integer",
            "description": "Files deleted.",
            "minimum": 0
          },
          "imported": {
            "type": "integer",
            "description": "Files now in the library.",
            "minimum": 0
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the first file still held stays, when one does."
          },
          "still_held": {
            "type": "integer",
            "description": "Files still held.",
            "minimum": 0
          }
        }
      },
      "HeldEntryResponse": {
        "type": "object",
        "description": "One entry of the held list: one download or upload, with its files.",
        "required": [
          "id",
          "origin",
          "state",
          "created_at",
          "files"
        ],
        "properties": {
          "album_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "check_album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The library album whose match a person should check before the\nbetter copy held here can go in: its \"Check this album\" target."
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "When it was made, in milliseconds."
          },
          "drop_item_id": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "The upload's drop import item."
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "When its held files are removed, in milliseconds. `None` for files\nleft in the import folder, which stay until a person decides."
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HeldFileResponse"
            }
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "next_retry_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "When DroppedNeedle next retries the files offering Retry by itself,\nin milliseconds. `None` when no file offers Retry, or when the next\ntry is at the held loop's next pass (within five minutes)."
          },
          "origin": {
            "$ref": "#/components/schemas/EntryOrigin"
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The song, for a track download."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/EntryState",
            "description": "`held` while it waits, `placing` while an action runs on it."
          }
        }
      },
      "HeldFileAction": {
        "type": "string",
        "description": "What a person can do with one held file, besides listening and\ndiscarding, which every file offers.",
        "enum": [
          "import",
          "retry",
          "use_this_version",
          "use_this_file",
          "recheck",
          "get_from_album"
        ]
      },
      "HeldFileResponse": {
        "type": "object",
        "description": "One held file.",
        "required": [
          "id",
          "original_name",
          "source",
          "reason",
          "reason_text",
          "reason_action",
          "reason_kind",
          "actions",
          "created_at"
        ],
        "properties": {
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HeldFileAction"
            }
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "When it was held, in milliseconds."
          },
          "disc_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "evidence_artist": {
            "type": [
              "string",
              "null"
            ]
          },
          "evidence_score": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "evidence_title": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the check that held it saw: the title and artist AcoustID heard\nor the file's tags name, and AcoustID's score."
          },
          "expected_duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "file_format": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "original_name": {
            "type": "string",
            "description": "Its name (and folder) as it came."
          },
          "reason": {
            "$ref": "#/components/schemas/Reason"
          },
          "reason_action": {
            "type": "string",
            "description": "What the person can do about it."
          },
          "reason_detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Specifics: which file, which marker."
          },
          "reason_kind": {
            "$ref": "#/components/schemas/ReasonKind",
            "description": "`library` when our side held it and it is retried as it is; `hold`\nwhen a person decides."
          },
          "reason_text": {
            "type": "string",
            "description": "The reason as one plain sentence."
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_track_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "description": "`soulseek`, `usenet`, `plugin:<key>`, `upload` or `import_folder`."
          },
          "source_task_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "track_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "track_title": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HeldFilesRequest": {
        "type": "object",
        "description": "The files an action takes; every held file of the entry when left out.",
        "properties": {
          "file_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        }
      },
      "HeldListResponse": {
        "type": "object",
        "description": "Entries waiting for a decision, newest first.",
        "required": [
          "entries"
        ],
        "properties": {
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HeldEntryResponse"
            }
          }
        }
      },
      "HeldMatchRequest": {
        "type": "object",
        "description": "The album a curator picked, and the files it takes (all when left out).",
        "required": [
          "release_group_mbid"
        ],
        "properties": {
          "file_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "release_group_mbid": {
            "type": "string"
          }
        }
      },
      "HeldRecheckAllRequest": {
        "type": "object",
        "description": "Bulk re-check: these entries, in order, or every entry.",
        "properties": {
          "entry_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        }
      },
      "HeldRecheckAllResponse": {
        "type": "object",
        "description": "A bulk re-check's results.",
        "required": [
          "results"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HeldRecheckItem"
            }
          }
        }
      },
      "HeldRecheckItem": {
        "type": "object",
        "description": "One file of a bulk re-check.",
        "required": [
          "entry_id",
          "file_id",
          "status"
        ],
        "properties": {
          "entry_id": {
            "type": "integer",
            "format": "int64"
          },
          "file_id": {
            "type": "integer",
            "format": "int64"
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed."
          },
          "status": {
            "$ref": "#/components/schemas/HeldRecheckStatus"
          }
        }
      },
      "HeldRecheckStatus": {
        "type": "string",
        "description": "How one file of a bulk re-check went.",
        "enum": [
          "imported",
          "still_held",
          "error"
        ]
      },
      "HeldTracks": {
        "type": "object",
        "description": "How much of one release group the library holds, over every album that\nowns it: their tracks add up, to the edition's count at most.",
        "required": [
          "id",
          "held"
        ],
        "properties": {
          "expected": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Tracks the edition has; `None` when neither the matched release nor\nthe files' tags tell. A guess the files' tags contradict counts by\nits tags.",
            "minimum": 0
          },
          "held": {
            "type": "integer",
            "format": "int64",
            "description": "Tracks the library holds.",
            "minimum": 0
          },
          "id": {
            "type": "string",
            "description": "Lowercase release-group id."
          }
        }
      },
      "HistoryEntry": {
        "type": "object",
        "description": "One listening-history entry.",
        "required": [
          "id",
          "track_title",
          "artist_name",
          "album_name",
          "viewed_at",
          "duration_ms",
          "device_name"
        ],
        "properties": {
          "album_name": {
            "type": "string",
            "description": "Track album."
          },
          "artist_name": {
            "type": "string",
            "description": "Track artist."
          },
          "device_name": {
            "type": "string",
            "description": "Player or device the track was played on, empty when unknown."
          },
          "duration_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Track length in milliseconds."
          },
          "id": {
            "type": "string",
            "description": "Opaque remote track id."
          },
          "track_title": {
            "type": "string",
            "description": "Track title."
          },
          "viewed_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix time the play ended."
          }
        }
      },
      "HistoryPage": {
        "type": "object",
        "description": "Listening history page.",
        "required": [
          "source",
          "items",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryEntry"
            },
            "description": "Page items, newest first."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total matching records upstream."
          }
        }
      },
      "HistoryResponse": {
        "type": "object",
        "description": "Paged history list.",
        "required": [
          "items",
          "total",
          "page",
          "page_size",
          "total_pages"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RequestItem"
            },
            "description": "Page rows."
          },
          "page": {
            "type": "integer",
            "format": "int32",
            "description": "Current page.",
            "minimum": 0
          },
          "page_size": {
            "type": "integer",
            "format": "int32",
            "description": "Rows per page.",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "format": "int32",
            "description": "Total rows.",
            "minimum": 0
          },
          "total_pages": {
            "type": "integer",
            "format": "int32",
            "description": "Total pages (at least 1).",
            "minimum": 0
          }
        }
      },
      "HomeResponse": {
        "type": "object",
        "description": "Home: its sections, in page order, plus the page-level fields. A\nsection with no rows is left out.",
        "required": [
          "sections",
          "service_prompts",
          "genre_artwork",
          "genre_artwork_schema_version",
          "refreshing"
        ],
        "properties": {
          "discover_preview": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DiscoverPreview"
              }
            ],
            "description": "Discover teaser: the first \"because you listen to\" shelf of the\nuser's last discover page."
          },
          "genre_artwork": {
            "type": "object",
            "description": "Mosaic art keyed by genre name.",
            "additionalProperties": {
              "$ref": "#/components/schemas/GenreArtwork"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "genre_artwork_schema_version": {
            "type": "string",
            "description": "Genre artwork schema version."
          },
          "integration_status": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IntegrationStatus"
              }
            ],
            "description": "Integration availability behind the shelves."
          },
          "refreshing": {
            "type": "boolean",
            "description": "True while a fuller build runs in the background (the UI polls)."
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageSection"
            },
            "description": "The sections, in page order."
          },
          "service_prompts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServicePrompt"
            },
            "description": "Connect-a-service cards."
          }
        }
      },
      "HubView": {
        "type": "object",
        "description": "The hub: one screen of highlights per source. Sections a source lacks\nstay empty rather than erroring.",
        "required": [
          "source",
          "recently_played",
          "recently_added",
          "favorites",
          "favorite_artists",
          "most_played_artists",
          "all_albums_preview",
          "genres"
        ],
        "properties": {
          "all_albums_preview": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesAlbumView"
            },
            "description": "Preview of the full album catalog."
          },
          "favorite_artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesArtistView"
            },
            "description": "Favorite artists (sources with artist favorites)."
          },
          "favorites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesAlbumView"
            },
            "description": "Favorite albums."
          },
          "genres": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Genre labels."
          },
          "most_played_artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesArtistView"
            },
            "description": "Most-played artists (sources reporting play counts)."
          },
          "recently_added": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesAlbumView"
            },
            "description": "Recently added albums."
          },
          "recently_played": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesAlbumView"
            },
            "description": "Recently played albums."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          },
          "stats": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RemotesStatsView"
              }
            ],
            "description": "Library totals, when the source can count cheaply."
          }
        }
      },
      "IdentificationControlBody": {
        "type": "object",
        "description": "A pause or resume of identification.",
        "required": [
          "expected_revision"
        ],
        "properties": {
          "expected_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The switch revision from the activity feed's\n`control_revision`.",
            "minimum": 0
          }
        }
      },
      "IdentificationControlResponse": {
        "type": "object",
        "description": "Answer to a pause or resume of identification.",
        "required": [
          "state",
          "row_revision"
        ],
        "properties": {
          "row_revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "state": {
            "$ref": "#/components/schemas/IdentificationState"
          }
        }
      },
      "IdentificationPolicy": {
        "type": "string",
        "description": "Per-path identification policy.",
        "enum": [
          "local_metadata",
          "automatic",
          "excluded"
        ]
      },
      "IdentificationState": {
        "type": "string",
        "description": "Identification queue state after a pause or resume.",
        "enum": [
          "running",
          "pausing",
          "paused"
        ]
      },
      "IdentityChoiceBody": {
        "type": "string",
        "description": "What the receiving album keeps when the albums being combined name\ndifferent editions.",
        "enum": [
          "detach",
          "retain_manual"
        ]
      },
      "IdentityManagementSettings": {
        "type": "object",
        "description": "Catalog-identity policy (no file writes).",
        "properties": {
          "automatic_edition_acceptance_enabled": {
            "type": "boolean",
            "description": "Automatic edition acceptance.",
            "default": false
          }
        }
      },
      "IdentityView": {
        "type": "object",
        "description": "Sealed identity after a review resolves.",
        "required": [
          "decision_source"
        ],
        "properties": {
          "decision_source": {
            "$ref": "#/components/schemas/DecisionSource",
            "description": "Who decided."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release-group MBID, when sealed."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release MBID, when an exact edition is sealed."
          }
        }
      },
      "IgnoredRelease": {
        "type": "object",
        "description": "One ignored release.",
        "required": [
          "release_group_mbid",
          "artist_mbid",
          "release_name",
          "artist_name",
          "ignored_at"
        ],
        "properties": {
          "artist_mbid": {
            "type": "string",
            "description": "MusicBrainz artist id."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "ignored_at": {
            "type": "integer",
            "format": "int64",
            "description": "Ignore timestamp (unix seconds)."
          },
          "release_group_mbid": {
            "type": "string",
            "description": "MusicBrainz release-group id."
          },
          "release_name": {
            "type": "string",
            "description": "Release name."
          }
        }
      },
      "IgnoredReleasesResponse": {
        "type": "object",
        "description": "The user's ignore ledger.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IgnoredRelease"
            },
            "description": "Ignored releases, newest first."
          }
        }
      },
      "ImportCandidateListResponse": {
        "type": "object",
        "description": "Importable accounts on one provider.",
        "required": [
          "candidates"
        ],
        "properties": {
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportCandidateView"
            },
            "description": "Every account the directory enumerated."
          }
        }
      },
      "ImportCandidateView": {
        "type": "object",
        "description": "One media-server account offered for import. Display only: the import\nre-reads the directory server-side and never trusts echoed fields.",
        "required": [
          "provider",
          "provider_uid",
          "display_name",
          "already_imported"
        ],
        "properties": {
          "already_imported": {
            "type": "boolean",
            "description": "True when a binding for this `(provider, provider_uid)` exists."
          },
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Account image URL, when the provider exposes one."
          },
          "display_name": {
            "type": "string",
            "description": "Display name on the provider."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Account email, when the provider exposes one."
          },
          "provider": {
            "type": "string",
            "description": "`jellyfin` or `plex`."
          },
          "provider_uid": {
            "type": "string",
            "description": "Provider-side id (Jellyfin user id, Plex account uuid)."
          }
        }
      },
      "ImportDecisionView": {
        "type": "object",
        "description": "What the import decided about the task's newest landing.",
        "required": [
          "outcome",
          "files_total",
          "files_imported",
          "files_held",
          "decided_at"
        ],
        "properties": {
          "decided_at": {
            "type": "number",
            "format": "double",
            "description": "Decision time (unix seconds)."
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "Specifics (which file, which marker), never the explanation."
          },
          "files_held": {
            "type": "integer",
            "format": "int64"
          },
          "files_imported": {
            "type": "integer",
            "format": "int64"
          },
          "files_total": {
            "type": "integer",
            "format": "int64"
          },
          "outcome": {
            "type": "string",
            "description": "`imported`, `partial`, `held`, `rejected` or `deferred`."
          },
          "reason_action": {
            "type": [
              "string",
              "null"
            ],
            "description": "What to do about it."
          },
          "reason_code": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Reason"
              }
            ],
            "description": "Why, when the landing was not a clean import."
          },
          "reason_text": {
            "type": [
              "string",
              "null"
            ],
            "description": "The reason as a plain sentence."
          }
        }
      },
      "ImportFolder": {
        "type": "object",
        "description": "The folder on the server DroppedNeedle imports music from by itself and\nempties as it goes. An empty path turns it off.",
        "properties": {
          "path": {
            "type": "string",
            "description": "An absolute folder path as the server sees it, or empty for off.",
            "default": ""
          }
        }
      },
      "ImportFolderOverlap": {
        "type": "string",
        "description": "Which kind of folder the import folder overlaps.",
        "enum": [
          "library",
          "recycle_bin",
          "downloads",
          "app"
        ]
      },
      "ImportFolderState": {
        "type": "string",
        "description": "What the import folder is doing, or why it waits.",
        "enum": [
          "off",
          "watching",
          "importing",
          "waiting_for_scan",
          "retrying",
          "library_off",
          "settings_unreadable",
          "unreachable",
          "read_only",
          "overlaps"
        ]
      },
      "ImportFolderStatusResponse": {
        "type": "object",
        "description": "What the import folder is doing, or why it waits.",
        "required": [
          "state",
          "waiting"
        ],
        "properties": {
          "overlap": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ImportFolderOverlap"
              }
            ],
            "description": "With `overlaps`: the kind of folder it overlaps."
          },
          "overlap_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "With `overlaps`: that folder's path."
          },
          "state": {
            "$ref": "#/components/schemas/ImportFolderState"
          },
          "waiting": {
            "type": "integer",
            "format": "int64",
            "description": "Albums found and still to go in."
          }
        }
      },
      "ImportFormat": {
        "type": "string",
        "description": "File a playlist import is read from.",
        "enum": [
          "m3u8",
          "csv"
        ]
      },
      "ImportPlaylistBody": {
        "type": "object",
        "description": "Playlist import body. `content` is capped at 2 MB.",
        "required": [
          "name",
          "format",
          "content"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "The file's text."
          },
          "format": {
            "$ref": "#/components/schemas/ImportFormat",
            "description": "The file's format."
          },
          "name": {
            "type": "string",
            "description": "Name for the new playlist. Must not be blank."
          }
        }
      },
      "ImportPlaylistResponse": {
        "type": "object",
        "description": "Playlist import answer.",
        "required": [
          "playlist_id",
          "name",
          "matched",
          "unmatched",
          "over_limit"
        ],
        "properties": {
          "matched": {
            "type": "integer",
            "description": "Entries that became playlist tracks.",
            "minimum": 0
          },
          "name": {
            "type": "string",
            "description": "Its name as stored."
          },
          "over_limit": {
            "type": "integer",
            "description": "Entries past the 10,000 an import reads, counted but not read.",
            "minimum": 0
          },
          "playlist_id": {
            "type": "string",
            "description": "The new playlist's id."
          },
          "unmatched": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportUnmatched"
            },
            "description": "Entries that did not, in file order."
          }
        }
      },
      "ImportResult": {
        "type": "object",
        "description": "Receipt for a playlist import into the local catalog.",
        "required": [
          "local_playlist_id",
          "tracks_imported",
          "tracks_failed",
          "already_imported"
        ],
        "properties": {
          "already_imported": {
            "type": "boolean",
            "description": "True when this exact playlist was already imported."
          },
          "local_playlist_id": {
            "type": "string",
            "description": "Local playlist id that now holds the tracks."
          },
          "tracks_failed": {
            "type": "integer",
            "format": "int64",
            "description": "Tracks that failed to resolve."
          },
          "tracks_imported": {
            "type": "integer",
            "format": "int64",
            "description": "Tracks imported."
          }
        }
      },
      "ImportUnmatched": {
        "type": "object",
        "description": "One entry an import could not match.",
        "required": [
          "title",
          "artist",
          "reason"
        ],
        "properties": {
          "artist": {
            "type": "string",
            "description": "Artist the file gave, empty when it gave none."
          },
          "reason": {
            "$ref": "#/components/schemas/ImportUnmatchedReason",
            "description": "Why the entry was left out."
          },
          "title": {
            "type": "string",
            "description": "Title the file gave, or its file name when it gave none."
          }
        }
      },
      "ImportUnmatchedReason": {
        "type": "string",
        "description": "Why an import left an entry out.",
        "enum": [
          "names_nothing",
          "no_match",
          "duplicate"
        ]
      },
      "ImportUsersRequest": {
        "type": "object",
        "description": "Import a batch of accounts from one provider.",
        "required": [
          "provider",
          "provider_uids"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "description": "`jellyfin` or `plex`."
          },
          "provider_uids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Provider uids to import, matched against a fresh directory listing."
          }
        }
      },
      "ImportUsersResponse": {
        "type": "object",
        "description": "A finished import batch.",
        "required": [
          "imported",
          "conflicts",
          "skipped",
          "total_imported"
        ],
        "properties": {
          "conflicts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Uids not imported because their email already belongs to an\naccount. They are never linked to it automatically."
          },
          "imported": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserResponse"
            },
            "description": "Newly created accounts, in request order."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Uids skipped: unknown, already bound, or failed."
          },
          "total_imported": {
            "type": "integer",
            "format": "int64",
            "description": "Count of `imported`, for the admin summary line.",
            "minimum": 0
          }
        }
      },
      "IndexerReorderRequest": {
        "type": "object",
        "description": "Dragged-card priority order (1-based on save).",
        "required": [
          "ordered_ids"
        ],
        "properties": {
          "ordered_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Indexer ids in the new order."
          }
        }
      },
      "IndexerSavedResponse": {
        "type": "object",
        "description": "Indexer save acknowledgement.",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Saved indexer id."
          }
        }
      },
      "IndexerTestResponse": {
        "type": "object",
        "description": "Indexer caps-test verdict. `supports_audio_search` tells the user\nwhether structured music search will be used or the `t=search`\nfallback; `suggested_url` is a one-click fix when the URL looks like\nthe site homepage but `/api` answers as a real endpoint.",
        "required": [
          "valid",
          "message",
          "supports_audio_search",
          "category_count"
        ],
        "properties": {
          "category_count": {
            "type": "integer",
            "format": "int64",
            "description": "Advertised category count."
          },
          "message": {
            "type": "string",
            "description": "Human summary."
          },
          "suggested_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "One-click `/api` fix, when the submitted URL was the homepage."
          },
          "supports_audio_search": {
            "type": "boolean",
            "description": "Whether structured music search is advertised."
          },
          "valid": {
            "type": "boolean",
            "description": "Whether the submitted values checked out."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Server version, when known."
          }
        }
      },
      "InfoView": {
        "type": "object",
        "description": "Unified artist/album info passthrough (Last.fm-sourced upstream).",
        "required": [
          "source",
          "id",
          "biography",
          "musicbrainz_id",
          "image_url",
          "lastfm_url",
          "similar_artists"
        ],
        "properties": {
          "biography": {
            "type": "string",
            "description": "Biography or release notes."
          },
          "id": {
            "type": "string",
            "description": "Opaque remote id the info belongs to."
          },
          "image_url": {
            "type": "string",
            "description": "Best upstream image URL, when offered."
          },
          "lastfm_url": {
            "type": "string",
            "description": "Last.fm page URL, empty when the source offers none."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Linked MusicBrainz id."
          },
          "similar_artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesArtistView"
            },
            "description": "Similar artists (artist info only)."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          }
        }
      },
      "IntakeResponse": {
        "type": "object",
        "description": "Intake response. Clients render this decision, never infer from roles.",
        "required": [
          "success",
          "message",
          "musicbrainz_id",
          "status"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human outcome."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Canonical MBID."
          },
          "status": {
            "$ref": "#/components/schemas/RequestStatus",
            "description": "Row status after this call."
          },
          "success": {
            "type": "boolean",
            "description": "Whether the ask was recorded."
          },
          "task_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked download task, when dispatched."
          }
        }
      },
      "IntegrationStatus": {
        "type": "object",
        "description": "Which integrations back the shelves right now.",
        "required": [
          "listenbrainz",
          "jellyfin",
          "download_client",
          "youtube",
          "lastfm",
          "navidrome",
          "youtube_api",
          "plex",
          "library",
          "localfiles"
        ],
        "properties": {
          "download_client": {
            "type": "boolean",
            "description": "A download client is configured."
          },
          "jellyfin": {
            "type": "boolean",
            "description": "A Jellyfin source is connected."
          },
          "lastfm": {
            "type": "boolean",
            "description": "The admin has switched Last.fm on for this server."
          },
          "library": {
            "type": "boolean",
            "description": "The native library has files."
          },
          "listenbrainz": {
            "type": "boolean",
            "description": "ListenBrainz reads are switched on for this server. The home page's\ncopy is also false while the person has no ListenBrainz link."
          },
          "localfiles": {
            "type": "boolean",
            "description": "Local files back playback. Home-only; discover leaves it false."
          },
          "navidrome": {
            "type": "boolean",
            "description": "A Navidrome source is connected."
          },
          "plex": {
            "type": "boolean",
            "description": "A Plex source is connected."
          },
          "youtube": {
            "type": "boolean",
            "description": "YouTube playback is configured."
          },
          "youtube_api": {
            "type": "boolean",
            "description": "The YouTube data API (quota'd) is configured."
          }
        }
      },
      "JellyfinConnection": {
        "type": "object",
        "description": "Jellyfin connection. The section URL is the single owner (the top-level\nmirror and the in-memory `Settings` mutation are gone).",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "API key (encrypted at rest; v2 returned it plaintext on GET).",
            "default": ""
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "jellyfin_url": {
            "type": "string",
            "description": "Jellyfin base URL.",
            "default": "http://jellyfin:8096"
          },
          "login_enabled": {
            "type": "boolean",
            "description": "Jellyfin login switch.",
            "default": false
          },
          "user_id": {
            "type": "string",
            "description": "Jellyfin user id.",
            "default": ""
          }
        }
      },
      "JellyfinLoginBody": {
        "type": "object",
        "description": "Jellyfin login body.",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "password": {
            "type": "string",
            "description": "Jellyfin password."
          },
          "transport": {
            "$ref": "#/components/schemas/TransportDto",
            "description": "Credential handoff; defaults to cookie."
          },
          "username": {
            "type": "string",
            "description": "Jellyfin username."
          }
        }
      },
      "JellyfinUserInfo": {
        "type": "object",
        "description": "One Jellyfin user, for the admin user picker after a verify.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "User id."
          },
          "name": {
            "type": "string",
            "description": "Display name."
          }
        }
      },
      "JellyfinVerifyResponse": {
        "type": "object",
        "description": "Jellyfin verify verdict, with the user list on success.",
        "required": [
          "success",
          "message",
          "users"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human summary."
          },
          "success": {
            "type": "boolean",
            "description": "Whether the connection checked out."
          },
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JellyfinUserInfo"
            },
            "description": "Server users (empty unless the probe succeeded)."
          }
        }
      },
      "JobView": {
        "type": "object",
        "description": "One background loop.",
        "required": [
          "name",
          "state"
        ],
        "properties": {
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Code of the last failure, such as `CHECKPOINT_FAILED`, until a\nclean turn clears it."
          },
          "last_heartbeat_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Last heartbeat as unix milliseconds, when the loop ever beat."
          },
          "name": {
            "type": "string",
            "description": "Loop name."
          },
          "state": {
            "$ref": "#/components/schemas/LoopState",
            "description": "Liveness now."
          }
        }
      },
      "KeptName": {
        "type": "object",
        "description": "A copy a run kept.",
        "required": [
          "name",
          "why"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The file's name."
          },
          "why": {
            "$ref": "#/components/schemas/KeptWhy"
          }
        }
      },
      "KeptWhy": {
        "type": "string",
        "description": "Why a due copy was kept.",
        "enum": [
          "changed",
          "not_in_bin",
          "not_plain_file",
          "unreadable"
        ]
      },
      "LastFmAlbumEnrichment": {
        "type": "object",
        "description": "`GET /albums/{album_id}/lastfm`.",
        "required": [
          "tags"
        ],
        "properties": {
          "listeners": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Listener count; null when Last.fm sent none."
          },
          "playcount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Play count; null when Last.fm sent none."
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Wiki summary, HTML stripped."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LastFmTag"
            },
            "description": "Tags."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last.fm page."
          }
        }
      },
      "LastFmArtistEnrichment": {
        "type": "object",
        "description": "`GET /artists/{artist_mbid}/lastfm`. Empty when Last.fm is off or the\nuser has no Last.fm key.",
        "required": [
          "tags",
          "similar_artists"
        ],
        "properties": {
          "bio": {
            "type": [
              "string",
              "null"
            ],
            "description": "Biography, HTML stripped."
          },
          "listeners": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Listener count; null when Last.fm sent none."
          },
          "playcount": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Play count; null when Last.fm sent none."
          },
          "similar_artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LastFmSimilarArtist"
            },
            "description": "Similar artists."
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short summary, HTML stripped."
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LastFmTag"
            },
            "description": "Tags."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last.fm page."
          }
        }
      },
      "LastFmConfiguredResponse": {
        "type": "object",
        "description": "Confirmation that credentials were stored.",
        "required": [
          "configured",
          "linked"
        ],
        "properties": {
          "configured": {
            "type": "boolean",
            "description": "Always true when this response is returned."
          },
          "linked": {
            "type": "boolean",
            "description": "Whether a session is still linked (a key change unlinks)."
          }
        }
      },
      "LastFmCredentialsSet": {
        "type": "object",
        "description": "Store per-user Last.fm API credentials. Either field may be the\n`********` mask, meaning keep the stored value.",
        "required": [
          "api_key",
          "shared_secret"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Last.fm API key, or the mask sentinel to keep it."
          },
          "shared_secret": {
            "type": "string",
            "description": "Last.fm shared secret, or the mask sentinel to keep it."
          }
        }
      },
      "LastFmSessionExchange": {
        "type": "object",
        "description": "Exchange an approved token for a session.",
        "required": [
          "token"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "The token from the token step, after browser approval."
          }
        }
      },
      "LastFmSessionResponse": {
        "type": "object",
        "description": "A linked Last.fm session.",
        "required": [
          "username",
          "linked"
        ],
        "properties": {
          "linked": {
            "type": "boolean",
            "description": "Always true when this response is returned."
          },
          "username": {
            "type": "string",
            "description": "Linked Last.fm username."
          }
        }
      },
      "LastFmSettings": {
        "type": "object",
        "description": "Last.fm: the master switch plus the instance's app key pair (v2\nparity). Users link their own Last.fm account with this pair; a user\nmay store their own pair instead, which wins for that user.",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "The instance's Last.fm API key (encrypted at rest).",
            "default": ""
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch for Last.fm linking and scrobbling.",
            "default": false
          },
          "shared_secret": {
            "type": "string",
            "description": "The instance's Last.fm shared secret (encrypted at rest).",
            "default": ""
          }
        }
      },
      "LastFmSimilarArtist": {
        "type": "object",
        "description": "A similar artist according to Last.fm.",
        "required": [
          "name",
          "match"
        ],
        "properties": {
          "match": {
            "type": "number",
            "format": "double",
            "description": "Similarity, 0 to 1."
          },
          "mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist MBID, when Last.fm knows it."
          },
          "name": {
            "type": "string",
            "description": "Artist name."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last.fm page."
          }
        }
      },
      "LastFmTag": {
        "type": "object",
        "description": "A Last.fm tag.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Tag name."
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tag page."
          }
        }
      },
      "LastFmTokenResponse": {
        "type": "object",
        "description": "A Last.fm sign-in token plus the URL to approve it at.",
        "required": [
          "token",
          "auth_url"
        ],
        "properties": {
          "auth_url": {
            "type": "string",
            "description": "Approval URL to open in a browser."
          },
          "token": {
            "type": "string",
            "description": "Single-use token for the session exchange."
          }
        }
      },
      "LeaveUnmanagedBody": {
        "type": "object",
        "description": "Leave the album unmanaged.",
        "required": [
          "expected_identity_revision"
        ],
        "properties": {
          "expected_identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `identity_revision` the edition status showed."
          }
        }
      },
      "LibraryActivity": {
        "type": "object",
        "description": "The whole feed.",
        "required": [
          "items",
          "work_items",
          "revisions"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityItem"
            }
          },
          "revisions": {
            "type": "object",
            "description": "Change revisions per stream (`scan`, `identification`,\n`operation`, `catalog`), as the `activity.changed` event sends.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "work_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkItem"
            }
          }
        }
      },
      "LibraryAlbumStatus": {
        "type": "object",
        "description": "What the library holds for one album, by local id or MusicBrainz id.\nUnknown albums answer with `in_library` false, never 404.",
        "required": [
          "in_library",
          "album_id",
          "track_count",
          "tracks"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "The local album id holding the tracks, or the asked id when none."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when at least one streamable track is held."
          },
          "track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Held streamable tracks.",
            "minimum": 0
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryStatusTrack"
            },
            "description": "Held tracks by album, disc and track."
          }
        }
      },
      "LibraryDownloadAccess": {
        "type": "object",
        "description": "Whether the caller may download library files.",
        "required": [
          "allowed"
        ],
        "properties": {
          "allowed": {
            "type": "boolean",
            "description": "True when the access setting admits the caller's role."
          }
        }
      },
      "LibraryManagementActivationHealthResponse": {
        "type": "object",
        "description": "Dry-run activation health: stale roots (saved activation no longer\nmatches) and blocked roots (no dry run could help).",
        "required": [
          "stale_root_ids",
          "blocked_root_ids"
        ],
        "properties": {
          "blocked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Policy error, set only with a non-empty `blocked_root_ids`."
          },
          "blocked_root_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Active roots no dry run could help."
          },
          "stale_root_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Active roots whose activation no longer matches."
          }
        }
      },
      "LibraryManagementChangeImpact": {
        "type": "object",
        "description": "Impact verdict for a candidate: classification, preview requirement,\naffected roots, and human reasons.",
        "required": [
          "current_settings_revision",
          "proposed_settings_revision",
          "stale",
          "classification",
          "preview_required",
          "affected_root_ids",
          "reasons"
        ],
        "properties": {
          "affected_root_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Affected root ids."
          },
          "classification": {
            "type": "string",
            "description": "`no_change`, `harmless`, `restrictive`, or `destructive`."
          },
          "current_settings_revision": {
            "type": "string",
            "description": "Current stored revision."
          },
          "preview_required": {
            "type": "boolean",
            "description": "A current dry run must be confirmed before enabling."
          },
          "proposed_settings_revision": {
            "type": "string",
            "description": "Normalized candidate revision."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Human reasons."
          },
          "stale": {
            "type": "boolean",
            "description": "The caller's revision was already stale."
          }
        }
      },
      "LibraryManagementPresetDiff": {
        "type": "object",
        "description": "Group-level preset drift: which top-level profile groups differ from\nthe tracked preset, plus the preset profile for rendering.",
        "required": [
          "profile_id",
          "differs",
          "changed_groups",
          "version_upgrade_groups"
        ],
        "properties": {
          "changed_groups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Differing groups."
          },
          "differs": {
            "type": "boolean",
            "description": "Whether any group differs."
          },
          "preset_origin": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preset origin, when tracked."
          },
          "preset_profile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LibraryManagementProfile"
              }
            ],
            "description": "The preset profile, when tracked."
          },
          "preset_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Preset version, when tracked."
          },
          "profile_id": {
            "type": "string",
            "description": "Profile id."
          },
          "version_upgrade_groups": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Groups a preset version upgrade would touch."
          }
        }
      },
      "LibraryManagementProfile": {
        "type": "object",
        "description": "One named management profile.",
        "properties": {
          "artwork": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArtworkManagementSettings"
              }
            ],
            "description": "Artwork block.",
            "default": {
              "embedded_enabled": true,
              "embedded_format": "jpeg",
              "embedded_maximum_size": 1200,
              "external_enabled": true,
              "external_format": "original",
              "external_maximum_size": 0,
              "local_file_patterns": [
                "cover.jpg",
                "cover.jpeg",
                "cover.png",
                "cover.webp",
                "folder.jpg",
                "folder.png",
                "front.jpg",
                "front.png"
              ],
              "never_replace_with_smaller": true
            }
          },
          "description": {
            "type": "string",
            "description": "Description.",
            "default": ""
          },
          "enrichment": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EnrichmentManagementSettings"
              }
            ],
            "description": "Enrichment block.",
            "default": {
              "lyrics": {
                "enabled": false,
                "preserve_existing": false,
                "required": false,
                "write_plain": true,
                "write_synced": true
              },
              "replaygain": {
                "album_aware": true,
                "enabled": false,
                "mode": "preserve",
                "required": false
              }
            }
          },
          "genres": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/GenreManagementSettings"
              }
            ],
            "description": "Genre block.",
            "default": {
              "aliases": [],
              "allowlist": [],
              "canonicalize": true,
              "denylist": [],
              "enabled": true,
              "lastfm_minimum_weight": 10,
              "lastfm_whitelist_only": true,
              "listenbrainz_curated_only": true,
              "listenbrainz_minimum_count": 1,
              "maximum_count": 5,
              "mode": "replace",
              "musicbrainz_minimum_count": 1,
              "preferred_casing": [],
              "sources": [
                "musicbrainz",
                "listenbrainz"
              ],
              "write_primary_only_for_constrained_formats": false
            }
          },
          "id": {
            "type": "string",
            "description": "Profile id.",
            "default": ""
          },
          "identity": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/IdentityManagementSettings"
              }
            ],
            "description": "Identity policy.",
            "default": {
              "automatic_edition_acceptance_enabled": false
            }
          },
          "metadata": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/MetadataManagementSettings"
              }
            ],
            "description": "Metadata block.",
            "default": {
              "artist_credits": {
                "preferred_locales": [],
                "standardization": "credited",
                "translate_names": false
              },
              "enabled": true,
              "fields": [],
              "preserve_embedded_art_during_scrub": true,
              "preserve_fields": [],
              "relationships": {
                "enabled": true,
                "types": [
                  "composer",
                  "lyricist",
                  "conductor",
                  "performer",
                  "arranger",
                  "remixer",
                  "producer"
                ]
              },
              "scrub_unmanaged_tags": false,
              "tagging_script_ids": []
            }
          },
          "name": {
            "type": "string",
            "description": "Display name.",
            "default": ""
          },
          "notification": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ProfileNotificationSettings"
              }
            ],
            "description": "Notifications.",
            "default": {
              "refresh_external_servers": false
            }
          },
          "organization": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OrganizationManagementSettings"
              }
            ],
            "description": "Organization block.",
            "default": {
              "compatibility": {
                "extension_case": "preserve",
                "maximum_component_length": 240,
                "maximum_path_length": 4096,
                "replace_non_ascii": false,
                "replace_spaces_with_underscores": false,
                "separator_replacement": "_",
                "unicode_normalization": "NFC",
                "windows_compatible": true,
                "windows_legacy_path_limit": false
              },
              "move_enabled": true,
              "move_sidecars": true,
              "multi_disc_naming_script_id": null,
              "naming_script_id": "69202666-cb88-52b0-bac2-0afc62b1e909",
              "rename_enabled": true,
              "sidecar_patterns": [
                "cover.jpg",
                "cover.jpeg",
                "cover.png",
                "cover.webp",
                "folder.jpg",
                "folder.jpeg",
                "folder.png",
                "front.jpg",
                "front.png",
                "back.jpg",
                "back.jpeg",
                "back.png",
                "back.webp",
                "booklet*.jpg",
                "booklet*.jpeg",
                "booklet*.png",
                "booklet*.webp",
                "medium*.jpg",
                "medium*.jpeg",
                "medium*.png",
                "medium*.webp",
                "*.cue",
                "*.log",
                "*.lrc",
                "*.m3u",
                "*.m3u8",
                "*.pls"
              ]
            }
          },
          "preset_origin": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preset origin.",
            "default": null
          },
          "preset_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Preset version.",
            "default": null
          },
          "revision": {
            "type": "string",
            "description": "Content revision.",
            "default": ""
          }
        }
      },
      "LibraryManagementProfileCopyRequest": {
        "type": "object",
        "description": "Copy-profile request.",
        "required": [
          "name",
          "expected_settings_revision"
        ],
        "properties": {
          "expected_settings_revision": {
            "type": "string",
            "description": "Compare-and-swap token from the last GET."
          },
          "name": {
            "type": "string",
            "description": "Name for the copy."
          }
        }
      },
      "LibraryManagementProfileDeleteRequest": {
        "type": "object",
        "description": "Delete-profile request.",
        "required": [
          "expected_settings_revision"
        ],
        "properties": {
          "expected_settings_revision": {
            "type": "string",
            "description": "Compare-and-swap token from the last GET."
          }
        }
      },
      "LibraryManagementProfileExportRequest": {
        "type": "object",
        "description": "Export request.",
        "required": [
          "expected_settings_revision"
        ],
        "properties": {
          "expected_settings_revision": {
            "type": "string",
            "description": "Compare-and-swap token from the last GET."
          }
        }
      },
      "LibraryManagementProfileExportResponse": {
        "type": "object",
        "description": "Exported bundle: a portable document plus a share code, both pinned\nby the bundle hash.",
        "required": [
          "filename",
          "mime_type",
          "document",
          "share_code",
          "bundle_hash",
          "settings_revision"
        ],
        "properties": {
          "bundle_hash": {
            "type": "string",
            "description": "Bundle hash (import pins to the reviewed hash)."
          },
          "document": {
            "type": "string",
            "description": "Portable document (JSON)."
          },
          "filename": {
            "type": "string",
            "description": "Suggested download filename."
          },
          "mime_type": {
            "type": "string",
            "description": "Bundle MIME type."
          },
          "settings_revision": {
            "type": "string",
            "description": "Settings revision at export time."
          },
          "share_code": {
            "type": "string",
            "description": "Share code (`DNLP2:...`)."
          }
        }
      },
      "LibraryManagementProfileImportPreviewRequest": {
        "type": "object",
        "description": "Import-preview request (accepts a document or a share code).",
        "required": [
          "content",
          "expected_settings_revision"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "Bundle document or share code."
          },
          "expected_settings_revision": {
            "type": "string",
            "description": "Compare-and-swap token from the last GET."
          }
        }
      },
      "LibraryManagementProfileImportPreviewResponse": {
        "type": "object",
        "description": "Import-preview response.",
        "required": [
          "profile",
          "bundle_hash",
          "settings_revision",
          "naming_scripts",
          "tagging_scripts",
          "aspects",
          "warnings"
        ],
        "properties": {
          "aspects": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Capability aspects the profile uses."
          },
          "bundle_hash": {
            "type": "string",
            "description": "Reviewed bundle hash (the import must pin to this)."
          },
          "naming_scripts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NamingScript"
            },
            "description": "Naming scripts the bundle carries."
          },
          "profile": {
            "$ref": "#/components/schemas/LibraryManagementProfile",
            "description": "Materialized profile (names resolved against stored settings)."
          },
          "settings_revision": {
            "type": "string",
            "description": "Settings revision at preview time."
          },
          "tagging_scripts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaggingScript"
            },
            "description": "Tagging scripts the bundle carries."
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryManagementProfileImportWarning"
            },
            "description": "Import warnings."
          }
        }
      },
      "LibraryManagementProfileImportRequest": {
        "type": "object",
        "description": "Import-confirm request.",
        "required": [
          "content",
          "reviewed_bundle_hash",
          "name",
          "expected_settings_revision"
        ],
        "properties": {
          "content": {
            "type": "string",
            "description": "Bundle document or share code."
          },
          "expected_settings_revision": {
            "type": "string",
            "description": "Compare-and-swap token from the last GET."
          },
          "name": {
            "type": "string",
            "description": "Name for the imported profile."
          },
          "reviewed_bundle_hash": {
            "type": "string",
            "description": "Bundle hash the admin reviewed."
          }
        }
      },
      "LibraryManagementProfileImportResponse": {
        "type": "object",
        "description": "Import-confirm response.",
        "required": [
          "profile",
          "settings_revision",
          "naming_scripts",
          "tagging_scripts"
        ],
        "properties": {
          "naming_scripts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NamingScript"
            },
            "description": "Naming scripts the import added."
          },
          "profile": {
            "$ref": "#/components/schemas/LibraryManagementProfile",
            "description": "Imported profile."
          },
          "settings_revision": {
            "type": "string",
            "description": "New settings revision."
          },
          "tagging_scripts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaggingScript"
            },
            "description": "Tagging scripts the import added."
          }
        }
      },
      "LibraryManagementProfileImportWarning": {
        "type": "object",
        "description": "One import warning: machine code plus human title and message.",
        "required": [
          "code",
          "severity",
          "title",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable warning code."
          },
          "message": {
            "type": "string",
            "description": "What the profile will do."
          },
          "severity": {
            "type": "string",
            "description": "`warning` or `danger`."
          },
          "title": {
            "type": "string",
            "description": "Short title."
          }
        }
      },
      "LibraryManagementProfileMutationResponse": {
        "type": "object",
        "description": "Profile-mutation acknowledgement: the saved profile plus the fresh\nrevision (a second read, so concurrent saves surface as staleness on\nthe next write instead of silently winning).",
        "required": [
          "profile",
          "settings_revision"
        ],
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/LibraryManagementProfile",
            "description": "Saved profile."
          },
          "settings_revision": {
            "type": "string",
            "description": "Fresh settings revision."
          }
        }
      },
      "LibraryManagementRootAssignment": {
        "type": "object",
        "description": "One root-to-profile assignment.",
        "properties": {
          "activation_confirmed_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Activation pins (set by the activation flow).",
            "default": null
          },
          "activation_confirmed_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who confirmed the dry run.",
            "default": null
          },
          "activation_naming_policy_revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Activation pins (set by the activation flow).",
            "default": null
          },
          "activation_policy_revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Activation pins (set by the activation flow).",
            "default": null
          },
          "activation_preview_hash": {
            "type": [
              "string",
              "null"
            ],
            "description": "Activation pins (set by the activation flow).",
            "default": null
          },
          "activation_preview_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "Activation pins (set by the activation flow).",
            "default": null
          },
          "activation_profile_revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Activation pins (set by the activation flow).",
            "default": null
          },
          "activation_settings_revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Activation pins (set by the activation flow).",
            "default": null
          },
          "automatic_acquisitions": {
            "type": "boolean",
            "description": "Automatic acquisitions.",
            "default": false
          },
          "automatic_custom_editions": {
            "type": "boolean",
            "description": "Automatic custom editions.",
            "default": false
          },
          "automatic_drop_imports": {
            "type": "boolean",
            "description": "Automatic drop imports.",
            "default": false
          },
          "automatic_scan_discovered": {
            "type": "boolean",
            "description": "Automatic scan-discovered organization.",
            "default": false
          },
          "enabled": {
            "type": "boolean",
            "description": "Assignment switch.",
            "default": false
          },
          "overrides": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LibraryManagementRootOverrides"
              }
            ],
            "description": "Per-root overrides.",
            "default": null
          },
          "profile_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Assigned profile id.",
            "default": null
          },
          "root_id": {
            "type": "string",
            "description": "Library root id.",
            "default": ""
          }
        }
      },
      "LibraryManagementRootOverrides": {
        "type": "object",
        "description": "Per-root profile overrides (`None` inherits the profile).",
        "properties": {
          "embedded_artwork_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Embedded-artwork switch.",
            "default": null
          },
          "external_artwork_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "External-artwork switch.",
            "default": null
          },
          "genres_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Genre switch.",
            "default": null
          },
          "metadata_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Metadata switch.",
            "default": null
          },
          "move_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Move switch.",
            "default": null
          },
          "move_sidecars": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Sidecar-move switch.",
            "default": null
          },
          "multi_disc_naming_mode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/MultiDiscNamingMode"
              }
            ],
            "description": "Multi-disc naming mode.",
            "default": "inherit"
          },
          "multi_disc_naming_script_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Multi-disc naming script id.",
            "default": null
          },
          "naming_script_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Naming script id.",
            "default": null
          },
          "rename_enabled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Rename switch.",
            "default": null
          }
        }
      },
      "LibraryManagementSaveRequest": {
        "type": "object",
        "description": "PUT body: full settings plus the required CAS token.",
        "required": [
          "settings",
          "expected_settings_revision"
        ],
        "properties": {
          "expected_settings_revision": {
            "type": "string",
            "description": "Compare-and-swap token from the last GET."
          },
          "settings": {
            "$ref": "#/components/schemas/LibraryManagementSettings",
            "description": "Full candidate settings."
          }
        }
      },
      "LibraryManagementSettings": {
        "type": "object",
        "description": "Library management settings (secret-free on purpose).",
        "properties": {
          "default_profile_id": {
            "type": "string",
            "description": "Default profile id.",
            "default": ""
          },
          "external_refresh": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ExternalRefreshSettings"
              }
            ],
            "description": "External refresh.",
            "default": {
              "enabled": false,
              "jellyfin_enabled": false,
              "navidrome_enabled": false,
              "plex_enabled": false
            }
          },
          "naming_scripts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NamingScript"
            },
            "description": "Naming scripts.",
            "default": []
          },
          "preset_catalog_version": {
            "type": "integer",
            "format": "int64",
            "description": "Preset catalog version.",
            "default": 0
          },
          "preview_retention_hours": {
            "type": "integer",
            "format": "int64",
            "description": "Preview retention in hours.",
            "default": 24
          },
          "profiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryManagementProfile"
            },
            "description": "Named profiles.",
            "default": []
          },
          "recycle_bin_path": {
            "type": "string",
            "description": "The recycle bin folder removed and replaced files go to (\"\" uses\neach library folder's own `.recycle`).",
            "default": ""
          },
          "recycle_retention_days": {
            "type": "integer",
            "format": "int64",
            "description": "Days a copy stays in the recycle bin, from 1 to 3650. A stored value\noutside that does not decode: expiry deletes on it, so it waits.",
            "default": 30
          },
          "root_assignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryManagementRootAssignment"
            },
            "description": "Root assignments.",
            "default": []
          },
          "schema_version": {
            "type": "integer",
            "format": "int64",
            "description": "Settings schema version.",
            "default": 1
          },
          "tagging_scripts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaggingScript"
            },
            "description": "Tagging scripts.",
            "default": []
          },
          "undo_retention_days": {
            "type": "integer",
            "format": "int64",
            "description": "Undo retention in days.",
            "default": 90
          }
        }
      },
      "LibraryManagementSettingsImpactRequest": {
        "type": "object",
        "description": "Impact/validate request body.",
        "required": [
          "settings"
        ],
        "properties": {
          "expected_settings_revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Compare-and-swap token from the last GET, if any."
          },
          "settings": {
            "$ref": "#/components/schemas/LibraryManagementSettings",
            "description": "Full candidate settings."
          }
        }
      },
      "LibraryManagementSettingsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LibraryManagementSettings",
            "description": "The stored settings."
          },
          {
            "type": "object",
            "required": [
              "settings_revision",
              "managed_fields"
            ],
            "properties": {
              "managed_fields": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ManagedFieldInfo"
                },
                "description": "Every tag field a profile can manage, in the editor's order, with\nthe genre row last."
              },
              "recycle_bin_warning": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/RecycleBinWarning"
                  }
                ],
                "description": "Why the recycle bin path is not used, when it is not: each library\nfolder's `.recycle` takes its place, or files wait for a folder\nthat can't be reached. Set on the settings read and save only."
              },
              "settings_revision": {
                "type": "string",
                "description": "Settings content revision."
              },
              "settings_unreadable": {
                "type": "boolean",
                "description": "The stored settings cannot be read, so these are the seeded ones\nand a save replaces the row. Removals, upgrades and automatic work\nwait until then."
              }
            }
          }
        ],
        "description": "GET/PUT view of Library Management: the settings plus their content\nrevision (the write CAS token)."
      },
      "LibraryMembershipRequest": {
        "type": "object",
        "description": "Which of these MusicBrainz album ids the library holds or has an open\nrequest for. Ids compare case-insensitively.",
        "properties": {
          "album_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Release-group (or release) ids, at most 500 after de-duplication."
          }
        }
      },
      "LibraryMembershipResponse": {
        "type": "object",
        "description": "Membership answer. Every list is lowercase and sorted by id.",
        "required": [
          "owned_ids",
          "requested_ids",
          "held_tracks"
        ],
        "properties": {
          "held_tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HeldTracks"
            },
            "description": "For each asked release group the library owns, how many of its\ntracks the library holds and how many its edition has."
          },
          "owned_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Asked ids the library holds with at least one streamable track."
          },
          "requested_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Asked ids with an open acquisition request."
          }
        }
      },
      "LibraryPathRule": {
        "type": "object",
        "description": "One path-policy rule inside a root.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Rule id.",
            "default": ""
          },
          "policy": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/IdentificationPolicy"
              }
            ],
            "description": "Policy for this path.",
            "default": "automatic"
          },
          "relative_path": {
            "type": "string",
            "description": "Path relative to the root.",
            "default": ""
          }
        }
      },
      "LibraryPolicyApplyPreviewResponse": {
        "type": "object",
        "description": "Apply preview: how many catalog files a reconcile of the chosen\nscopes would revisit.",
        "required": [
          "policy_revision",
          "scope_ids",
          "estimated_file_count",
          "content_will_become_unavailable",
          "queued_work_was_cancelled_on_save"
        ],
        "properties": {
          "content_will_become_unavailable": {
            "type": "boolean",
            "description": "Some chosen scope is excluded."
          },
          "estimated_file_count": {
            "type": "integer",
            "format": "int64",
            "description": "Catalog files under the chosen scopes."
          },
          "policy_revision": {
            "type": "string",
            "description": "Saved revision the preview was built from."
          },
          "queued_work_was_cancelled_on_save": {
            "type": "boolean",
            "description": "Whether the last save cancelled queued work. Saves never cancel\nqueued work on this server, so this is always false."
          },
          "scope_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The scope ids as requested."
          }
        }
      },
      "LibraryPolicyApplyRequest": {
        "type": "object",
        "description": "Apply-preview request: which saved scopes to reconcile.",
        "required": [
          "scope_ids",
          "expected_policy_revision"
        ],
        "properties": {
          "expected_policy_revision": {
            "type": "string",
            "description": "Revision the page loaded; a mismatch is a 409."
          },
          "scope_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Root or rule ids; empty means every root."
          }
        }
      },
      "LibraryPolicyImpactRequest": {
        "type": "object",
        "description": "Impact preview request.",
        "required": [
          "settings"
        ],
        "properties": {
          "expected_policy_revision": {
            "type": [
              "string",
              "null"
            ],
            "description": "Revision the page loaded, if any. A mismatch sets `stale`."
          },
          "settings": {
            "$ref": "#/components/schemas/LibrarySettings",
            "description": "Full candidate settings."
          }
        }
      },
      "LibraryPolicyImpactResponse": {
        "type": "object",
        "description": "Impact preview: how the candidate settings differ from the saved ones\nand how much of the catalog the change touches.",
        "required": [
          "current_policy_revision",
          "proposed_policy_revision",
          "stale",
          "reconciliation_required",
          "affected_scope_ids",
          "content_will_become_unavailable",
          "queued_work_will_be_cancelled",
          "warnings"
        ],
        "properties": {
          "affected_scope_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Root and rule ids whose effective policy changes."
          },
          "content_will_become_unavailable": {
            "type": "boolean",
            "description": "Some affected scope becomes excluded."
          },
          "current_policy_revision": {
            "type": "string",
            "description": "Saved revision."
          },
          "indexed_file_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Indexed catalog files under the affected scopes, when wired."
          },
          "on_disk_file_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Indexed plus excluded catalog files under the affected scopes,\nwhen wired."
          },
          "proposed_policy_revision": {
            "type": "string",
            "description": "Revision of the normalized candidate."
          },
          "queued_work_will_be_cancelled": {
            "type": "boolean",
            "description": "Some affected scope stops being automatic, so queued\nidentification there no longer applies."
          },
          "reconciliation_required": {
            "type": "boolean",
            "description": "Whether any root or rule changes its effective policy."
          },
          "stale": {
            "type": "boolean",
            "description": "The caller's expected revision no longer matches the saved one."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Non-blocking warnings about the candidate."
          }
        }
      },
      "LibraryPolicyTreeNode": {
        "type": "object",
        "description": "One policy-tree node.",
        "required": [
          "id",
          "kind",
          "label",
          "path",
          "policy",
          "available",
          "children"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "Whether the path exists on disk right now."
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryPolicyTreeNode"
            },
            "description": "Child rule nodes."
          },
          "id": {
            "type": "string",
            "description": "Node id (root or rule id)."
          },
          "indexed_file_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Indexed catalog files under the node, when the catalog is wired."
          },
          "inherited_from_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Id the policy comes from."
          },
          "kind": {
            "$ref": "#/components/schemas/PolicyNodeKind",
            "description": "Root or rule."
          },
          "label": {
            "type": "string",
            "description": "Display label."
          },
          "on_disk_file_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Indexed plus excluded catalog files under the node, when the\ncatalog is wired."
          },
          "path": {
            "type": "string",
            "description": "Absolute path for a root, the root-relative path for a rule."
          },
          "policy": {
            "$ref": "#/components/schemas/IdentificationPolicy",
            "description": "Policy set on this node."
          }
        }
      },
      "LibraryPolicyTreeResponse": {
        "type": "object",
        "description": "Policy-tree response.",
        "required": [
          "policy_revision",
          "roots",
          "warnings"
        ],
        "properties": {
          "policy_revision": {
            "type": "string",
            "description": "Content revision the tree was built from."
          },
          "roots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryPolicyTreeNode"
            },
            "description": "Root nodes."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Non-blocking warnings."
          }
        }
      },
      "LibraryRestorableRoot": {
        "type": "object",
        "description": "A root the catalog still holds tracks for but the settings no\nlonger list.",
        "required": [
          "root_id",
          "path",
          "indexed_file_count"
        ],
        "properties": {
          "indexed_file_count": {
            "type": "integer",
            "format": "int64",
            "description": "Catalog files under the root."
          },
          "path": {
            "type": "string",
            "description": "Root path recovered from the catalog rows."
          },
          "root_id": {
            "type": "string",
            "description": "Root id the catalog rows carry."
          }
        }
      },
      "LibraryRestorableRootsResponse": {
        "type": "object",
        "description": "Removed roots that can be put back.",
        "required": [
          "policy_revision",
          "restorable_roots"
        ],
        "properties": {
          "policy_revision": {
            "type": "string",
            "description": "Saved revision (the token a restore must send)."
          },
          "restorable_roots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryRestorableRoot"
            },
            "description": "Restorable roots, sorted by id."
          }
        }
      },
      "LibraryRestoreRootsRequest": {
        "type": "object",
        "description": "Restore request: put every removed root back.",
        "required": [
          "expected_policy_revision"
        ],
        "properties": {
          "expected_policy_revision": {
            "type": "string",
            "description": "Revision the page loaded; a mismatch is a 409."
          },
          "paths": {
            "type": [
              "object",
              "null"
            ],
            "description": "Path overrides by root id, for roots whose files moved.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "LibraryRoot": {
        "type": "object",
        "description": "One library root.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable root id.",
            "default": ""
          },
          "label": {
            "type": "string",
            "description": "Display label.",
            "default": ""
          },
          "path": {
            "type": "string",
            "description": "Absolute path.",
            "default": ""
          },
          "policy": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/IdentificationPolicy"
              }
            ],
            "description": "Default policy.",
            "default": "automatic"
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryPathRule"
            },
            "description": "Path rules.",
            "default": []
          }
        }
      },
      "LibraryScanSchedule": {
        "type": "object",
        "description": "Native automatic-scan schedule.",
        "properties": {
          "daily_scan_time": {
            "type": "string",
            "description": "Server-local `HH:MM` used when `scan_frequency` is `daily`.",
            "default": "03:00"
          },
          "scan_frequency": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ScanFrequency"
              }
            ],
            "description": "Rolling-gap cadence, or `daily` for a fixed clock time.",
            "default": "24hr"
          }
        }
      },
      "LibraryScanScheduleResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LibraryScanSchedule",
            "description": "The stored schedule."
          },
          {
            "type": "object",
            "required": [
              "server_timezone"
            ],
            "properties": {
              "last_scan_at": {
                "type": [
                  "number",
                  "null"
                ],
                "format": "double",
                "description": "When the last scan finished successfully, unix seconds."
              },
              "server_timezone": {
                "type": "string",
                "description": "Server-local timezone label for the daily-scan picker."
              }
            }
          }
        ],
        "description": "GET payload: the persisted schedule plus the server's timezone label, so\nthe UI can show what \"daily at HH:MM\" is relative to, and when the last\nscan finished, from the scan history. Both are computed per request and\nnever persisted."
      },
      "LibrarySettings": {
        "type": "object",
        "description": "Typed library settings: roots, policies, staging, naming, AcoustID.",
        "properties": {
          "acoustid_api_key": {
            "type": "string",
            "description": "AcoustID key (encrypted at rest).",
            "default": ""
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch: when false the app claims no new library work.",
            "default": true
          },
          "library_roots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LibraryRoot"
            },
            "description": "Library roots.",
            "default": []
          },
          "naming_script": {
            "type": "string",
            "description": "The naming script that places downloaded and dropped files.",
            "default": "{albumartist}/{album}{conditional(is_empty(slice(default(original_date, date), 0, 4)), \"\", concat(\" (\", slice(default(original_date, date), 0, 4), \")\"))}/{disc:02d}{track:02d} {title}.{ext}"
          },
          "staging_path": {
            "type": "string",
            "description": "Staging path.",
            "default": ""
          }
        }
      },
      "LibrarySettingsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/LibrarySettings",
            "description": "Normalized settings, AcoustID key masked."
          },
          {
            "type": "object",
            "required": [
              "policy_revision",
              "reconciliation_required",
              "reconciliation_state",
              "affected_scope_ids",
              "actions_applied",
              "warnings"
            ],
            "properties": {
              "actions_applied": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Actions the save applied."
              },
              "affected_scope_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Affected scope ids."
              },
              "naming_example": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Where the import naming script puts an example track; absent when\nthe stored script places nothing."
              },
              "pending_policy_revision": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Pending revision, when awaiting reconciliation."
              },
              "policy_revision": {
                "type": "string",
                "description": "Content revision (write CAS token)."
              },
              "reconciliation_required": {
                "type": "boolean",
                "description": "Whether reconciliation is still required."
              },
              "reconciliation_state": {
                "type": "string",
                "description": "`applied` or `awaiting_reconciliation`."
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Non-blocking warnings."
              }
            }
          }
        ],
        "description": "GET view of the library settings: the settings (AcoustID key masked)\nplus the policy revision, the reconciliation projection, and\nnon-blocking warnings."
      },
      "LibrarySettingsSaveRequest": {
        "type": "object",
        "description": "PUT body: full settings plus the required CAS token.",
        "required": [
          "settings",
          "expected_policy_revision"
        ],
        "properties": {
          "expected_policy_revision": {
            "type": "string",
            "description": "Compare-and-swap token from the last GET."
          },
          "settings": {
            "$ref": "#/components/schemas/LibrarySettings",
            "description": "Full candidate settings (a masked AcoustID key keeps the stored one)."
          }
        }
      },
      "LibraryStatusTrack": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TrackView",
            "description": "The track."
          },
          {
            "type": "object",
            "required": [
              "current_tier",
              "below_cutoff"
            ],
            "properties": {
              "below_cutoff": {
                "type": "boolean",
                "description": "True when upgrades are on and the file sits below the cutoff tier."
              },
              "current_tier": {
                "type": "string",
                "description": "Quality tier of the file: `lossless`, `mp3_320`, `mp3_256`,\n`mp3_192`, or `low`."
              }
            }
          }
        ],
        "description": "One held track on the album status view, judged against the upgrade\nsettings."
      },
      "LidarrArtistCandidate": {
        "type": "object",
        "description": "One monitored Lidarr artist annotated for the requesting user.",
        "required": [
          "mbid",
          "name",
          "monitor_new_items",
          "already_following",
          "would_auto_download"
        ],
        "properties": {
          "already_following": {
            "type": "boolean",
            "description": "True when the user already follows this MBID."
          },
          "mbid": {
            "type": "string",
            "description": "MusicBrainz artist MBID (`foreignArtistId`)."
          },
          "monitor_new_items": {
            "type": "string",
            "description": "Lidarr `monitorNewItems`: `none` or `all`."
          },
          "name": {
            "type": "string",
            "description": "Artist name as Lidarr reports it."
          },
          "would_auto_download": {
            "type": "boolean",
            "description": "True when importing would arm auto-download (`all`)."
          }
        }
      },
      "LidarrArtistListResponse": {
        "type": "object",
        "description": "Candidate list.",
        "required": [
          "artists",
          "total"
        ],
        "properties": {
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LidarrArtistCandidate"
            },
            "description": "Monitored artists with valid MBIDs."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Count of `artists`."
          }
        }
      },
      "LidarrConnectionSettings": {
        "type": "object",
        "description": "Admin-configured read-only Lidarr import connection. Not a management\nintegration.",
        "required": [
          "url",
          "api_key"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "API key, Fernet-encrypted at rest, masked on read."
          },
          "url": {
            "type": "string",
            "description": "Lidarr base URL, normalised to a bare origin."
          }
        }
      },
      "LidarrImportRequest": {
        "type": "object",
        "description": "Import selection.",
        "required": [
          "selected_mbids"
        ],
        "properties": {
          "selected_mbids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "MBIDs to import; unknown or unmonitored entries are ignored."
          }
        }
      },
      "LidarrImportResponse": {
        "type": "object",
        "description": "Import summary. `imported` counts brand-new\nfollows only; `already_following` is the disjoint pre-existing subset;\n`auto_download_enabled` counts brand-new auto-download follows only.",
        "required": [
          "imported",
          "already_following",
          "skipped_invalid",
          "auto_download_enabled"
        ],
        "properties": {
          "already_following": {
            "type": "integer",
            "format": "int64",
            "description": "Selected MBIDs already followed before this import."
          },
          "auto_download_enabled": {
            "type": "integer",
            "format": "int64",
            "description": "Brand-new follows with auto-download armed."
          },
          "imported": {
            "type": "integer",
            "format": "int64",
            "description": "Brand-new follows created."
          },
          "skipped_invalid": {
            "type": "integer",
            "format": "int64",
            "description": "Selected entries that were not valid MBIDs."
          }
        }
      },
      "LidarrTestResponse": {
        "type": "object",
        "description": "Result of testing submitted Lidarr credentials.",
        "required": [
          "valid",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "User-safe summary. Never echoes the URL or host."
          },
          "valid": {
            "type": "boolean",
            "description": "True when the probe authenticated."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Lidarr version from `system/status`, when the probe reached it."
          }
        }
      },
      "LifeSpan": {
        "type": "object",
        "description": "An artist's life span.",
        "properties": {
          "begin": {
            "type": [
              "string",
              "null"
            ],
            "description": "Begin date, partial shapes allowed (`1991`, `1991-06`)."
          },
          "end": {
            "type": [
              "string",
              "null"
            ],
            "description": "End date, partial shapes allowed."
          },
          "ended": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the artist has ended, when MusicBrainz says."
          }
        }
      },
      "LinkedAccount": {
        "type": "object",
        "description": "One account the caller linked, on any service. Never carries the\nstored secret.",
        "required": [
          "service",
          "enabled",
          "username"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether the link is enabled."
          },
          "service": {
            "type": "string",
            "description": "Service tag (`navidrome`, `jellyfin`, `plex`, `listenbrainz`,\n`lastfm`, `spotify`)."
          },
          "username": {
            "type": "string",
            "description": "Linked account name, empty when the service stores none."
          }
        }
      },
      "LinkedAccounts": {
        "type": "object",
        "description": "The caller's linked accounts.",
        "required": [
          "connections"
        ],
        "properties": {
          "connections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LinkedAccount"
            },
            "description": "One entry per linked service."
          }
        }
      },
      "ListOrder": {
        "type": "string",
        "description": "Which way a list runs.",
        "enum": [
          "asc",
          "desc"
        ]
      },
      "ListenBrainzConnectRequest": {
        "type": "object",
        "description": "ListenBrainz connect request. The username is required: it drives every\nper-user read, and without it a \"connected\" account yields silently\nempty discovery.",
        "required": [
          "user_token"
        ],
        "properties": {
          "user_token": {
            "type": "string",
            "description": "User token."
          },
          "username": {
            "type": "string",
            "description": "ListenBrainz username."
          }
        }
      },
      "ListenBrainzSettings": {
        "type": "object",
        "description": "ListenBrainz settings: the switch for the app's ListenBrainz reads.",
        "properties": {
          "reads_enabled": {
            "type": "boolean",
            "description": "Read recommendations, popularity and genres from ListenBrainz.",
            "default": true
          }
        }
      },
      "ListenSource": {
        "type": "string",
        "description": "A listening-data service: the one the discover shelves, charts, radio and\nenrichment answers name.",
        "enum": [
          "listenbrainz",
          "lastfm"
        ]
      },
      "ListeningLinkStatus": {
        "type": "object",
        "description": "One linked listening account. Never carries the secret, only the name.\nNamed apart from the remotes `ConnectionStatus` in the one OpenAPI\ndocument.",
        "required": [
          "service"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether the link is active."
          },
          "service": {
            "type": "string",
            "description": "Service name (`listenbrainz` here)."
          },
          "username": {
            "type": "string",
            "description": "Linked username."
          }
        }
      },
      "LocalPasswordSet": {
        "type": "object",
        "description": "Set the first local password on an account without one.",
        "required": [
          "new_password"
        ],
        "properties": {
          "new_password": {
            "type": "string",
            "description": "New password, at least 12 chars."
          }
        }
      },
      "LocalReleaseSnapshot": {
        "type": "object",
        "required": [
          "schema_version",
          "local_album_id",
          "local_artist_id",
          "album_row_revision",
          "input_revision",
          "title",
          "album_artist_name",
          "artist_kind",
          "musicbrainz_artist_id",
          "musicbrainz_release_group_id",
          "musicbrainz_release_id",
          "release_date",
          "year",
          "is_compilation",
          "captured_at",
          "media"
        ],
        "properties": {
          "album_artist_name": {
            "type": "string"
          },
          "album_row_revision": {
            "type": "integer",
            "format": "int64"
          },
          "artist_kind": {
            "type": "string"
          },
          "captured_at": {
            "type": "number",
            "format": "double"
          },
          "input_revision": {
            "type": "string"
          },
          "is_compilation": {
            "type": "boolean"
          },
          "local_album_id": {
            "type": "string"
          },
          "local_artist_id": {
            "type": "string"
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseMediumSnapshot"
            }
          },
          "musicbrainz_artist_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "musicbrainz_release_group_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "musicbrainz_release_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "schema_version": {
            "type": "integer",
            "format": "int32"
          },
          "title": {
            "type": "string"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          }
        }
      },
      "LoginBody": {
        "type": "object",
        "description": "Local login body.",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "password": {
            "type": "string",
            "description": "Account password."
          },
          "transport": {
            "$ref": "#/components/schemas/TransportDto",
            "description": "Credential handoff; defaults to cookie."
          },
          "username": {
            "type": "string",
            "description": "Username, matched case-insensitively."
          }
        }
      },
      "LooksWrongBody": {
        "type": "object",
        "description": "Mark an album's match as looking wrong, or take the mark back.",
        "required": [
          "looks_wrong"
        ],
        "properties": {
          "looks_wrong": {
            "type": "boolean"
          }
        }
      },
      "LooksWrongView": {
        "type": "object",
        "description": "The caller's own \"Looks wrong\" mark.",
        "required": [
          "looks_wrong"
        ],
        "properties": {
          "looks_wrong": {
            "type": "boolean"
          }
        }
      },
      "LoopState": {
        "type": "string",
        "description": "Liveness of a background loop.",
        "enum": [
          "running",
          "stopped",
          "failed"
        ]
      },
      "LyricLine": {
        "type": "object",
        "description": "One lyric line.",
        "required": [
          "text"
        ],
        "properties": {
          "start_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Line start, seconds, for synced lyrics."
          },
          "text": {
            "type": "string",
            "description": "Line text."
          }
        }
      },
      "LyricsManagementSettings": {
        "type": "object",
        "description": "Lyrics enrichment block.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "preserve_existing": {
            "type": "boolean",
            "description": "Keep existing lyrics.",
            "default": false
          },
          "required": {
            "type": "boolean",
            "description": "Lyrics required for completion.",
            "default": false
          },
          "write_plain": {
            "type": "boolean",
            "description": "Write plain lyrics.",
            "default": true
          },
          "write_synced": {
            "type": "boolean",
            "description": "Write synced lyrics.",
            "default": true
          }
        }
      },
      "LyricsSettings": {
        "type": "object",
        "description": "Lyrics settings: the switch for the online LRCLIB lookup.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Look up lyrics on LRCLIB when the server has none for a track.",
            "default": true
          }
        }
      },
      "LyricsView": {
        "type": "object",
        "description": "Stored lyrics for one track. Missing lyrics read as 404, never empty.",
        "required": [
          "text",
          "is_synced",
          "lines"
        ],
        "properties": {
          "is_synced": {
            "type": "boolean",
            "description": "True when lines carry timestamps."
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LyricLine"
            },
            "description": "Lyric lines in order."
          },
          "text": {
            "type": "string",
            "description": "Full text, lines joined with newlines."
          }
        }
      },
      "ManageUndoBody": {
        "type": "object",
        "description": "Undo one published bundle as a new previewed operation.",
        "required": [
          "bundle_id"
        ],
        "properties": {
          "bundle_id": {
            "type": "string",
            "description": "Source operation bundle id."
          }
        }
      },
      "ManageUndoResponse": {
        "type": "object",
        "description": "Undo answer.",
        "required": [
          "bundle_id",
          "outcome",
          "restored"
        ],
        "properties": {
          "bundle_id": {
            "type": "string",
            "description": "Undo operation bundle id."
          },
          "outcome": {
            "$ref": "#/components/schemas/PublishOutcome",
            "description": "Whether cleanup finished."
          },
          "restored": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Restored track ids."
          }
        }
      },
      "ManagedField": {
        "type": "object",
        "description": "One managed tag field.",
        "properties": {
          "clear_when_canonical_missing": {
            "type": "boolean",
            "description": "Clear when the canonical value is missing.",
            "default": false
          },
          "field": {
            "type": "string",
            "description": "Field name.",
            "default": ""
          },
          "mode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FieldMode"
              }
            ],
            "description": "Write mode.",
            "default": "replace"
          }
        }
      },
      "ManagedFieldInfo": {
        "type": "object",
        "description": "One row of a profile's field table.",
        "required": [
          "name",
          "label",
          "mergeable",
          "clearable",
          "modes"
        ],
        "properties": {
          "clearable": {
            "type": "boolean",
            "description": "Whether replace offers to clear the value when the source has none."
          },
          "label": {
            "type": "string",
            "description": "What the editor calls it."
          },
          "mergeable": {
            "type": "boolean",
            "description": "Whether merge is offered."
          },
          "modes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldMode"
            },
            "description": "The modes the field offers."
          },
          "name": {
            "type": "string",
            "description": "The profile's name for the field."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "What MusicBrainz fact the value comes from. `None`: nothing gives\none, so the file keeps its value unless a tagging script sets it,\nor replace with clear removes it."
          }
        }
      },
      "ManagementActivationConfirmBody": {
        "type": "object",
        "description": "Save settings with the dry runs that confirm them.",
        "required": [
          "settings",
          "proofs",
          "expected_settings_revision"
        ],
        "properties": {
          "confirmation": {
            "type": "boolean"
          },
          "expected_settings_revision": {
            "type": "string"
          },
          "proofs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagementActivationProofBody"
            }
          },
          "settings": {
            "$ref": "#/components/schemas/LibraryManagementSettings"
          }
        }
      },
      "ManagementActivationPreviewBody": {
        "type": "object",
        "description": "Dry-run one library folder under proposed settings.",
        "required": [
          "root_id",
          "settings",
          "expected_settings_revision",
          "expected_policy_revision"
        ],
        "properties": {
          "expected_policy_revision": {
            "type": "string"
          },
          "expected_settings_revision": {
            "type": "string"
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "root_id": {
            "type": "string"
          },
          "settings": {
            "$ref": "#/components/schemas/LibraryManagementSettings"
          }
        }
      },
      "ManagementActivationProofBody": {
        "type": "object",
        "description": "One dry run offered as proof.",
        "required": [
          "root_id",
          "job_id",
          "preview_token"
        ],
        "properties": {
          "job_id": {
            "type": "string"
          },
          "preview_token": {
            "type": "string"
          },
          "root_id": {
            "type": "string"
          }
        }
      },
      "ManagementApplyBody": {
        "type": "object",
        "description": "Apply a ready preview.",
        "required": [
          "preview_token",
          "expected_operation_row_revision",
          "idempotency_key"
        ],
        "properties": {
          "confirmation": {
            "type": "boolean",
            "description": "Must be true: the administrator confirmed the change."
          },
          "expected_operation_row_revision": {
            "type": "integer",
            "format": "int64"
          },
          "idempotency_key": {
            "type": "string"
          },
          "preview_token": {
            "type": "string"
          }
        }
      },
      "ManagementAttentionBundleView": {
        "type": "object",
        "description": "A write that needs an administrator.",
        "required": [
          "bundle_id",
          "file_count",
          "sample_paths",
          "source_folders"
        ],
        "properties": {
          "bundle_id": {
            "type": "string"
          },
          "file_count": {
            "type": "integer",
            "format": "int64"
          },
          "sample_paths": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_folders": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The folders the write took its files from, relative to their\nlibrary folder. For a download that is the hidden import folder\nholding the downloaded files."
          }
        }
      },
      "ManagementCatalogFilterBody": {
        "type": "object",
        "description": "Catalog filter for a `filter` selection; empty matches everything.",
        "properties": {
          "album_artist_only": {
            "type": "boolean"
          },
          "artist_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "from_year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "genre": {
            "type": [
              "string",
              "null"
            ]
          },
          "search": {
            "type": [
              "string",
              "null"
            ]
          },
          "to_year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "ManagementCollisionKind": {
        "type": "string",
        "description": "What kind of collision a duplicate resolution settles.",
        "enum": [
          "same_path_same_content",
          "same_path_different_content",
          "same_release_position_different_content",
          "normalized_path_collision",
          "sidecar_collision",
          "destination_created_after_preview"
        ]
      },
      "ManagementDiscardBody": {
        "type": "object",
        "description": "Discard a preview.",
        "required": [
          "expected_operation_row_revision"
        ],
        "properties": {
          "expected_operation_row_revision": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ManagementDuplicateAction": {
        "type": "string",
        "description": "What to do with a file whose destination is taken.",
        "enum": [
          "keep_existing",
          "keep_incoming_alternate",
          "recycle_existing_keep_incoming",
          "recycle_incoming_keep_existing"
        ]
      },
      "ManagementDuplicateBody": {
        "type": "object",
        "description": "Settle one file a preview could not place.",
        "required": [
          "source_job_id",
          "source_plan_item_ordinal",
          "expected_source_operation_row_revision",
          "collision_kind",
          "existing_root_id",
          "existing_relative_path",
          "action",
          "expected_settings_revision",
          "expected_policy_revision",
          "idempotency_key"
        ],
        "properties": {
          "action": {
            "$ref": "#/components/schemas/ManagementDuplicateAction"
          },
          "alternate_relative_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "For `keep_incoming_alternate`: where the incoming file goes."
          },
          "collision_kind": {
            "$ref": "#/components/schemas/ManagementCollisionKind"
          },
          "existing_local_track_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "existing_relative_path": {
            "type": "string"
          },
          "existing_root_id": {
            "type": "string"
          },
          "expected_policy_revision": {
            "type": "string"
          },
          "expected_settings_revision": {
            "type": "string"
          },
          "expected_source_operation_row_revision": {
            "type": "integer",
            "format": "int64"
          },
          "idempotency_key": {
            "type": "string"
          },
          "source_job_id": {
            "type": "string"
          },
          "source_plan_item_ordinal": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ManagementHistoryItemView": {
        "type": "object",
        "description": "One row of management history.",
        "required": [
          "operation",
          "mode",
          "origin",
          "phase",
          "profile_id",
          "profile_name",
          "profile_revision",
          "activation_preview",
          "selection",
          "eligible_count",
          "warning_count",
          "blocked_count"
        ],
        "properties": {
          "activation_preview": {
            "type": "boolean"
          },
          "blocked_count": {
            "type": "integer",
            "format": "int64"
          },
          "eligible_count": {
            "type": "integer",
            "format": "int64"
          },
          "expires_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "mode": {
            "type": "string"
          },
          "operation": {
            "$ref": "#/components/schemas/OperationView"
          },
          "origin": {
            "type": "string"
          },
          "phase": {
            "$ref": "#/components/schemas/ManagementPhase"
          },
          "profile_id": {
            "type": "string"
          },
          "profile_name": {
            "type": "string"
          },
          "profile_revision": {
            "type": "string"
          },
          "selection": {
            "type": "object"
          },
          "target_root_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "warning_count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ManagementHoldView": {
        "type": "object",
        "description": "Why library management leaves an album's files alone.",
        "required": [
          "kind",
          "held_at",
          "handing_back"
        ],
        "properties": {
          "exclusion_revision": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "For `your_choice`: the exclusion's revision, which re-enabling\nmanagement echoes."
          },
          "handing_back": {
            "type": "boolean",
            "description": "True while the album waits for its turn after every album was\nhanded back at once."
          },
          "held_at": {
            "type": "integer",
            "format": "int64",
            "description": "Since when, unix milliseconds."
          },
          "kind": {
            "type": "string",
            "description": "`your_choice` when a person chose to leave the album unmanaged.\nOtherwise why DroppedNeedle stepped back by itself: `files_changed`\n(its files were changed outside DroppedNeedle), `retag_followed`\n(it was retagged outside DroppedNeedle), `run_undone` (a person\nundid DroppedNeedle's changes to it) or `replaced_hands_off` (its\nfiles appeared beside a hands-off album in the scan that saw that\nalbum's files go)."
          }
        }
      },
      "ManagementJobView": {
        "type": "object",
        "description": "A management job: a preview, an apply in progress, or a finished one.",
        "required": [
          "job_id",
          "state",
          "phase",
          "mode",
          "origin",
          "profile_id",
          "profile_name",
          "profile_revision",
          "settings_revision",
          "catalog_revision",
          "selection",
          "summary",
          "created_at",
          "updated_at",
          "expired",
          "stale",
          "stale_reasons",
          "stale_input_count",
          "stale_sample_relative_paths",
          "ready_for_confirmation",
          "operation_row_revision",
          "operation_event_revision",
          "worker_stalled",
          "expected_work_count",
          "completed_count",
          "succeeded_count",
          "failed_count",
          "skipped_count",
          "control_request",
          "undo_available_count",
          "undo_expired_count",
          "baseline_available_count",
          "external_refreshes"
        ],
        "properties": {
          "baseline_available_count": {
            "type": "integer",
            "format": "int64"
          },
          "catalog_revision": {
            "type": "integer",
            "format": "int64"
          },
          "completed_count": {
            "type": "integer",
            "format": "int64"
          },
          "control_request": {
            "$ref": "#/components/schemas/ControlRequest"
          },
          "created_at": {
            "type": "number",
            "format": "double"
          },
          "expected_work_count": {
            "type": "integer",
            "format": "int64"
          },
          "expired": {
            "type": "boolean"
          },
          "expires_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "external_refreshes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalRefresh"
            },
            "description": "Media servers asked to rescan after the apply, and how it went."
          },
          "failed_count": {
            "type": "integer",
            "format": "int64"
          },
          "job_id": {
            "type": "string"
          },
          "linked_job_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "For an undo: the operation it puts back."
          },
          "mode": {
            "type": "string",
            "description": "`preview`, `apply`, or `undo` (v2 history may show others)."
          },
          "operation_event_revision": {
            "type": "integer",
            "format": "int64"
          },
          "operation_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Echo this on apply, discard and undo preview."
          },
          "origin": {
            "type": "string"
          },
          "phase": {
            "$ref": "#/components/schemas/ManagementPhase"
          },
          "profile_id": {
            "type": "string"
          },
          "profile_name": {
            "type": "string"
          },
          "profile_revision": {
            "type": "string"
          },
          "proposed_settings_revision": {
            "type": [
              "string",
              "null"
            ]
          },
          "ready_for_confirmation": {
            "type": "boolean"
          },
          "selection": {
            "type": "object"
          },
          "settings_revision": {
            "type": "string"
          },
          "skipped_count": {
            "type": "integer",
            "format": "int64"
          },
          "stale": {
            "type": "boolean"
          },
          "stale_input_count": {
            "type": "integer",
            "format": "int64"
          },
          "stale_reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why the preview can no longer be applied, in words."
          },
          "stale_sample_relative_paths": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "$ref": "#/components/schemas/OperationState",
            "description": "The operation state."
          },
          "succeeded_count": {
            "type": "integer",
            "format": "int64"
          },
          "summary": {
            "$ref": "#/components/schemas/ManagementSummaryView"
          },
          "target_root_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "terminal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "terminal_reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReasonView"
              }
            ]
          },
          "undo_available_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files whose change can still be undone."
          },
          "undo_expired_count": {
            "type": "integer",
            "format": "int64"
          },
          "undo_expires_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          },
          "worker_heartbeat_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "worker_lease_expires_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "worker_stalled": {
            "type": "boolean"
          }
        }
      },
      "ManagementLeftoverFileView": {
        "type": "object",
        "description": "A hidden temporary file no write accounts for.",
        "required": [
          "root_id",
          "root_path",
          "rel_path"
        ],
        "properties": {
          "rel_path": {
            "type": "string",
            "description": "Path under the library folder."
          },
          "root_id": {
            "type": "string"
          },
          "root_path": {
            "type": "string",
            "description": "The library folder it is in."
          }
        }
      },
      "ManagementOverrideMode": {
        "type": "string",
        "description": "What a saved override does to its tag.",
        "enum": [
          "replace",
          "preserve",
          "clear"
        ]
      },
      "ManagementPhase": {
        "type": "string",
        "description": "Where a management job is: planning its files, a preview waiting to be\napplied, writing (applying, undoing or restoring originals), or done.\nThe worker takes a queued job in any phase but `ready` and `complete`.",
        "enum": [
          "planning",
          "ready",
          "applying",
          "undoing",
          "restoring",
          "complete"
        ]
      },
      "ManagementPlacementCheckView": {
        "type": "object",
        "description": "What checking one library folder found.",
        "required": [
          "root_id",
          "mode",
          "answered"
        ],
        "properties": {
          "answered": {
            "type": "boolean",
            "description": "False when the check could not tell, for example on a full or\nread-only disk. `mode` is then the last result, which is kept."
          },
          "mode": {
            "$ref": "#/components/schemas/ManagementPlacementMode",
            "description": "The folder's mode now."
          },
          "root_id": {
            "type": "string"
          }
        }
      },
      "ManagementPlacementMode": {
        "type": "string",
        "description": "How DroppedNeedle can add a file to a library folder.",
        "enum": [
          "unknown",
          "rename",
          "link",
          "check"
        ]
      },
      "ManagementPlacementView": {
        "type": "object",
        "description": "Every saved library folder DroppedNeedle can write to. Excluded\nfolders are not listed.",
        "required": [
          "roots"
        ],
        "properties": {
          "roots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagementRootPlacementView"
            }
          }
        }
      },
      "ManagementPlanItemView": {
        "type": "object",
        "description": "One planned file.",
        "required": [
          "ordinal",
          "bundle_ordinal",
          "eligibility",
          "estimated_temporary_bytes",
          "desired_document",
          "artwork_choices",
          "diff",
          "capability",
          "collisions"
        ],
        "properties": {
          "artwork_choices": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "bundle_ordinal": {
            "type": "integer",
            "format": "int64",
            "description": "The album this file is planned with; albums apply as a whole."
          },
          "capability": {
            "type": "object",
            "description": "`audio_format`, `warnings`, `blockers`, and catalog facts."
          },
          "collisions": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "desired_document": {
            "type": "object",
            "description": "`fields`: the tags the file ends up with, `[{name, value}]`."
          },
          "destination_relative_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "destination_root_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "diff": {
            "type": "object",
            "description": "`field_mutations` (`{name, operation, before, after}`),\n`tags_changed`, `path_changed`, `sidecars`."
          },
          "eligibility": {
            "$ref": "#/components/schemas/Eligibility"
          },
          "estimated_temporary_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "local_album_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "local_track_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ordinal": {
            "type": "integer",
            "format": "int64"
          },
          "reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ManagementReasonView"
              }
            ],
            "description": "The reason in words, with what to do about it."
          },
          "reason_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_relative_path": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_root_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ManagementPreviewCreateBody": {
        "type": "object",
        "description": "Make a preview.",
        "required": [
          "selection",
          "profile_id",
          "expected_settings_revision",
          "expected_policy_revision"
        ],
        "properties": {
          "expected_policy_revision": {
            "type": "string",
            "description": "The library policy revision the page loaded; refused when it moved."
          },
          "expected_settings_revision": {
            "type": "string",
            "description": "The settings revision the page loaded; refused when it moved."
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Makes a retried request return the same preview."
          },
          "include_organized": {
            "type": "boolean",
            "description": "Also plan albums already organized with these settings and\nunchanged since. A preview of one album always plans it."
          },
          "overrides": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LibraryManagementRootOverrides"
              }
            ],
            "description": "Switches for this run only, on top of the profile."
          },
          "profile_id": {
            "type": "string"
          },
          "selection": {
            "$ref": "#/components/schemas/ManagementSelectionBody"
          },
          "target_root_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Move the files into this library folder instead of their own."
          }
        }
      },
      "ManagementPreviewCreatedResponse": {
        "type": "object",
        "description": "A new preview and the token that applies it. Keep the token: it is\nshown once (ask for a new one with reissue).",
        "required": [
          "job_id",
          "preview_token",
          "created_at",
          "expires_at",
          "existing"
        ],
        "properties": {
          "created_at": {
            "type": "number",
            "format": "double"
          },
          "existing": {
            "type": "boolean",
            "description": "True when the idempotency key named an existing preview."
          },
          "expires_at": {
            "type": "number",
            "format": "double"
          },
          "job_id": {
            "type": "string"
          },
          "preview_token": {
            "type": "string"
          }
        }
      },
      "ManagementPreviewReissueResponse": {
        "type": "object",
        "description": "A new token for a ready preview.",
        "required": [
          "job_id",
          "preview_token",
          "created_at",
          "expires_at"
        ],
        "properties": {
          "created_at": {
            "type": "number",
            "format": "double"
          },
          "expires_at": {
            "type": "number",
            "format": "double"
          },
          "job_id": {
            "type": "string"
          },
          "preview_token": {
            "type": "string"
          }
        }
      },
      "ManagementPurgeBody": {
        "type": "object",
        "description": "Delete every saved original for good.",
        "required": [
          "impact_token",
          "typed_confirmation",
          "idempotency_key"
        ],
        "properties": {
          "idempotency_key": {
            "type": "string"
          },
          "impact_token": {
            "type": "string"
          },
          "typed_confirmation": {
            "type": "string",
            "description": "Must be `CONFIRM`."
          }
        }
      },
      "ManagementPurgeImpactView": {
        "type": "object",
        "description": "What a purge of the saved originals would remove.",
        "required": [
          "baseline_count",
          "referenced_blob_count",
          "referenced_blob_bytes",
          "blocked_journal_count",
          "active_restore_count",
          "impact_token"
        ],
        "properties": {
          "active_restore_count": {
            "type": "integer",
            "format": "int64"
          },
          "baseline_count": {
            "type": "integer",
            "format": "int64"
          },
          "blocked_journal_count": {
            "type": "integer",
            "format": "int64"
          },
          "impact_token": {
            "type": "string",
            "description": "Echo on the purge."
          },
          "referenced_blob_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "referenced_blob_count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ManagementPurgeView": {
        "type": "object",
        "description": "What a purge removed.",
        "required": [
          "purged_baseline_count",
          "detached_reference_count",
          "cleaned_blob_count",
          "existing"
        ],
        "properties": {
          "cleaned_blob_count": {
            "type": "integer",
            "format": "int64"
          },
          "detached_reference_count": {
            "type": "integer",
            "format": "int64"
          },
          "existing": {
            "type": "boolean",
            "description": "True when the request key named an earlier purge."
          },
          "purged_baseline_count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ManagementReasonView": {
        "type": "object",
        "description": "Why a file is left alone or failed: a stable code, a plain sentence,\nand what to do about it. v2 history carries only the code.",
        "required": [
          "code",
          "message",
          "action"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ManagementRecoveryView": {
        "type": "object",
        "description": "The publish journal at a glance.",
        "required": [
          "recoverable_bundle_count",
          "nonterminal_journal_count",
          "needs_attention_count",
          "cleanup_pending_count",
          "state_counts",
          "needs_attention_bundles",
          "retrying_bundles",
          "leftover_file_count",
          "leftover_files"
        ],
        "properties": {
          "cleanup_pending_count": {
            "type": "integer",
            "format": "int64"
          },
          "leftover_file_count": {
            "type": "integer",
            "format": "int64",
            "description": "Hidden temporary files under the library folders that no write\naccounts for, as the last check of each folder found them. Nothing\nremoves them."
          },
          "leftover_files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagementLeftoverFileView"
            },
            "description": "The first hundred of them."
          },
          "needs_attention_bundles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagementAttentionBundleView"
            }
          },
          "needs_attention_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files in writes that need an administrator."
          },
          "nonterminal_journal_count": {
            "type": "integer",
            "format": "int64"
          },
          "oldest_updated_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "recoverable_bundle_count": {
            "type": "integer",
            "format": "int64",
            "description": "Writes recovery will still finish or unwind."
          },
          "retrying_bundles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagementAttentionBundleView"
            },
            "description": "Writes recovery has been retrying for more than a day and is still\nretrying."
          },
          "state_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ManagementResolveView": {
        "type": "object",
        "description": "A closed write.",
        "required": [
          "bundle_id",
          "state",
          "verified_files",
          "total_files",
          "note"
        ],
        "properties": {
          "bundle_id": {
            "type": "string"
          },
          "note": {
            "type": "string",
            "description": "What closing did, and did not do, in words."
          },
          "state": {
            "type": "string"
          },
          "total_files": {
            "type": "integer",
            "format": "int64"
          },
          "verified_files": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ManagementRestorePreviewBody": {
        "type": "object",
        "description": "Preview putting files back the way they were before management.",
        "required": [
          "selection",
          "expected_settings_revision",
          "expected_policy_revision",
          "idempotency_key"
        ],
        "properties": {
          "expected_policy_revision": {
            "type": "string"
          },
          "expected_settings_revision": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string"
          },
          "selection": {
            "$ref": "#/components/schemas/ManagementSelectionBody"
          }
        }
      },
      "ManagementResultItemView": {
        "type": "object",
        "description": "One file after apply.",
        "required": [
          "plan",
          "work_state",
          "result",
          "journal_states"
        ],
        "properties": {
          "failure_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "failure_reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ManagementReasonView"
              }
            ],
            "description": "Why the file failed or was not written, with what to do about it."
          },
          "journal_states": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "plan": {
            "$ref": "#/components/schemas/ManagementPlanItemView"
          },
          "result": {
            "type": "object"
          },
          "work_state": {
            "$ref": "#/components/schemas/ResultState"
          }
        }
      },
      "ManagementRootPlacementView": {
        "type": "object",
        "description": "One library folder and how files can be added to it.",
        "required": [
          "root_id",
          "mode"
        ],
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/ManagementPlacementMode"
          },
          "root_id": {
            "type": "string"
          }
        }
      },
      "ManagementSelectionBody": {
        "type": "object",
        "description": "A preview's scope: library folders, artists, albums, files, or a\ncatalog filter.",
        "required": [
          "kind"
        ],
        "properties": {
          "catalog_filter": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ManagementCatalogFilterBody"
              }
            ]
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "kind": {
            "$ref": "#/components/schemas/ManagementSelectionKind"
          }
        }
      },
      "ManagementSelectionKind": {
        "type": "string",
        "description": "What a preview covers.",
        "enum": [
          "roots",
          "artists",
          "albums",
          "tracks",
          "filter"
        ]
      },
      "ManagementSkippedAlbumView": {
        "type": "object",
        "description": "An album automatic management skipped.",
        "required": [
          "album_id",
          "album_title",
          "reason",
          "attempts",
          "updated_at"
        ],
        "properties": {
          "album_id": {
            "type": "string"
          },
          "album_title": {
            "type": "string"
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "attempts": {
            "type": "integer",
            "format": "int64"
          },
          "reason": {
            "$ref": "#/components/schemas/ManagementReasonView",
            "description": "Why, in words, with what to do about it."
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "ManagementSkippedPage": {
        "type": "object",
        "description": "Albums automatic management skipped.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagementSkippedAlbumView"
            }
          }
        }
      },
      "ManagementSummaryView": {
        "type": "object",
        "description": "What a preview counted.",
        "required": [
          "item_count",
          "bundle_count",
          "eligible_count",
          "warning_count",
          "blocked_count",
          "stale_count",
          "no_change_count",
          "tag_change_count",
          "artwork_change_count",
          "path_change_count",
          "sidecar_change_count",
          "estimated_temporary_bytes",
          "expanded_track_count",
          "organized_album_count",
          "organized_file_count",
          "reasons",
          "roots",
          "formats",
          "deferred_sources",
          "metadata_snapshot_ids"
        ],
        "properties": {
          "artwork_change_count": {
            "type": "integer",
            "format": "int64"
          },
          "blocked_count": {
            "type": "integer",
            "format": "int64"
          },
          "bundle_count": {
            "type": "integer",
            "format": "int64"
          },
          "deferred_sources": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "eligible_count": {
            "type": "integer",
            "format": "int64"
          },
          "estimated_temporary_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "expanded_track_count": {
            "type": "integer",
            "format": "int64"
          },
          "formats": {
            "type": "object",
            "description": "Files per audio format.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "item_count": {
            "type": "integer",
            "format": "int64"
          },
          "metadata_snapshot_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "no_change_count": {
            "type": "integer",
            "format": "int64"
          },
          "organized_album_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums left out because they are already organized."
          },
          "organized_file_count": {
            "type": "integer",
            "format": "int64",
            "description": "Files of the albums left out as already organized."
          },
          "path_change_count": {
            "type": "integer",
            "format": "int64"
          },
          "reasons": {
            "type": "object",
            "description": "Files per reason code.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "roots": {
            "type": "object",
            "description": "Files per library folder.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "selected_item_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "sidecar_change_count": {
            "type": "integer",
            "format": "int64"
          },
          "stale_count": {
            "type": "integer",
            "format": "int64"
          },
          "tag_change_count": {
            "type": "integer",
            "format": "int64"
          },
          "warning_count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ManagementTagCardinality": {
        "type": "string",
        "description": "The shape of a tag's value in the editor.",
        "enum": [
          "string",
          "integer",
          "boolean",
          "ordered_strings"
        ]
      },
      "ManagementTagEditFieldBody": {
        "type": "object",
        "description": "One edited tag.",
        "required": [
          "field_name"
        ],
        "properties": {
          "field_name": {
            "type": "string"
          },
          "value": {
            "description": "Text, a number, true/false, a list, or null to clear. Ignored for\na reset."
          }
        }
      },
      "ManagementTagEditMode": {
        "type": "string",
        "description": "How a tag edit is kept.",
        "enum": [
          "save_override",
          "write_once",
          "reset_canonical"
        ]
      },
      "ManagementTagEditPreviewBody": {
        "type": "object",
        "description": "Preview a tag edit.",
        "required": [
          "local_track_id",
          "mode",
          "expected_settings_revision",
          "expected_policy_revision",
          "fields"
        ],
        "properties": {
          "expected_policy_revision": {
            "type": "string"
          },
          "expected_settings_revision": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagementTagEditFieldBody"
            }
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "local_track_id": {
            "type": "string"
          },
          "mode": {
            "$ref": "#/components/schemas/ManagementTagEditMode"
          }
        }
      },
      "ManagementTagEditorFieldView": {
        "type": "object",
        "description": "One tag in the editor.",
        "required": [
          "field_name",
          "scope",
          "cardinality",
          "current_value",
          "override_mode"
        ],
        "properties": {
          "cardinality": {
            "$ref": "#/components/schemas/ManagementTagCardinality"
          },
          "current_value": {
            "description": "The file's value now: text, a number, true/false, a list, or null."
          },
          "field_name": {
            "type": "string"
          },
          "override_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "override_mode": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ManagementOverrideMode"
              }
            ]
          },
          "override_row_revision": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "scope": {
            "$ref": "#/components/schemas/ManagementTagScope"
          }
        }
      },
      "ManagementTagEditorView": {
        "type": "object",
        "description": "One file's tags, saved overrides and match.",
        "required": [
          "local_track_id",
          "local_album_id",
          "root_id",
          "profile_id",
          "profile_name",
          "settings_revision",
          "policy_revision",
          "track_revision",
          "album_revision",
          "accepted_identity",
          "fields"
        ],
        "properties": {
          "accepted_identity": {
            "type": "boolean"
          },
          "album_revision": {
            "type": "integer",
            "format": "int64"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagementTagEditorFieldView"
            }
          },
          "identity_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the file has no accepted match, as a reason code."
          },
          "local_album_id": {
            "type": "string"
          },
          "local_track_id": {
            "type": "string"
          },
          "policy_revision": {
            "type": "string",
            "description": "Echo on the edit preview."
          },
          "profile_id": {
            "type": "string"
          },
          "profile_name": {
            "type": "string"
          },
          "root_id": {
            "type": "string"
          },
          "settings_revision": {
            "type": "string",
            "description": "Echo on the edit preview."
          },
          "track_revision": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ManagementTagScope": {
        "type": "string",
        "description": "Where a tag applies.",
        "enum": [
          "album",
          "track"
        ]
      },
      "ManagementTakeoverCause": {
        "type": "string",
        "description": "Why the app stepped back from an album.",
        "enum": [
          "files_changed",
          "retag_followed",
          "run_undone",
          "replaced_hands_off"
        ]
      },
      "ManagementTakeoverPage": {
        "type": "object",
        "description": "Albums DroppedNeedle stepped back from.",
        "required": [
          "items",
          "total",
          "handing_back"
        ],
        "properties": {
          "handing_back": {
            "type": "integer",
            "format": "int64",
            "description": "Albums already handed back that wait for their turn."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagementTakeoverView"
            },
            "description": "Newest first, 100 at most."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "How many there are in all."
          }
        }
      },
      "ManagementTakeoverView": {
        "type": "object",
        "description": "An album DroppedNeedle stepped back from.",
        "required": [
          "album_id",
          "album_title",
          "cause",
          "noticed_at",
          "hand_back_given_up"
        ],
        "properties": {
          "album_id": {
            "type": "string"
          },
          "album_title": {
            "type": "string"
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "cause": {
            "$ref": "#/components/schemas/ManagementTakeoverCause"
          },
          "hand_back_given_up": {
            "type": "boolean",
            "description": "A hand-back since then was given up because the album's files\ncould not be read."
          },
          "noticed_at": {
            "type": "integer",
            "format": "int64",
            "description": "When it stepped back, unix milliseconds."
          }
        }
      },
      "ManagementUndoPreviewBody": {
        "type": "object",
        "description": "Preview undoing an applied job.",
        "required": [
          "expected_operation_row_revision",
          "idempotency_key"
        ],
        "properties": {
          "expected_operation_row_revision": {
            "type": "integer",
            "format": "int64"
          },
          "idempotency_key": {
            "type": "string"
          }
        }
      },
      "MatchFileBody": {
        "type": "object",
        "description": "Match a file by hand.",
        "required": [
          "release_track_mbid",
          "expected_identity_revision"
        ],
        "properties": {
          "expected_identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `identity_revision` the edition plan showed."
          },
          "release_track_mbid": {
            "type": "string",
            "description": "A track of the album's current edition that no file holds."
          }
        }
      },
      "MatchView": {
        "type": "object",
        "description": "MBID match result: the remote album behind a MusicBrainz id.",
        "required": [
          "source",
          "found",
          "tracks"
        ],
        "properties": {
          "found": {
            "type": "boolean",
            "description": "True when the MBID resolved to a remote album."
          },
          "remote_album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque remote album id, when found."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesTrackView"
            },
            "description": "Album tracks, when found."
          }
        }
      },
      "MaybeHaveView": {
        "type": "object",
        "description": "A library album that may already be the one a download hunts for.",
        "required": [
          "album_id",
          "title"
        ],
        "properties": {
          "album_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "MbSourceMode": {
        "type": "string",
        "description": "MusicBrainz source tier.",
        "enum": [
          "official",
          "mirror",
          "community",
          "brainzmash"
        ]
      },
      "MembersBody": {
        "type": "object",
        "description": "Share-with body: everyone the playlist is shared with, replacing the\nlist; empty unshares it from everyone.",
        "required": [
          "user_ids"
        ],
        "properties": {
          "editor_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Those of them who may change its songs."
          },
          "user_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "User ids."
          }
        }
      },
      "MembersResponse": {
        "type": "object",
        "description": "The people a playlist is shared with, first shared first.",
        "required": [
          "members"
        ],
        "properties": {
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaylistMember"
            },
            "description": "Members."
          }
        }
      },
      "MembershipApplyBody": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MembershipPreviewBody"
          },
          {
            "type": "object",
            "required": [
              "preview_token"
            ],
            "properties": {
              "idempotency_key": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Replaying a key returns the first result instead of applying twice."
              },
              "preview_token": {
                "type": "string",
                "description": "The token the preview returned."
              }
            }
          }
        ],
        "description": "A previewed membership change to apply: the previewed change and its\ntoken."
      },
      "MembershipPreviewBody": {
        "type": "object",
        "description": "A membership change to preview.",
        "required": [
          "track_ids"
        ],
        "properties": {
          "album_artist_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Split only: the new album's album artist (default: the source's)."
          },
          "expected_album_revisions": {
            "type": "object",
            "description": "Album revisions as the page showed them, by album id. Zero or\nmissing means unknown; the preview token still guards the change.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "identity_choice": {
            "$ref": "#/components/schemas/IdentityChoiceBody",
            "description": "How competing editions settle; shown in the preview."
          },
          "target_album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The album that receives the tracks (merge and move; optional for a\nsplit, which otherwise makes a new album)."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Split only: the new album's title (default: the source's)."
          },
          "track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The tracks to split off, move, or reset. For a merge, any track of\neach album to fold in: merges always take whole albums."
          }
        }
      },
      "MembershipPreviewResponse": {
        "type": "object",
        "description": "An album membership preview.",
        "required": [
          "preview_token",
          "source_album_ids",
          "track_ids",
          "identity_conflicts",
          "aliases",
          "automatic_groups",
          "reference_counts",
          "edition_changes"
        ],
        "properties": {
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Album ids that will point at the receiving album."
          },
          "automatic_groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomaticGroupView"
            }
          },
          "edition_changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EditionChangeView"
            }
          },
          "identity_conflicts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Competing editions."
          },
          "preview_token": {
            "type": "string",
            "description": "Send this back to apply exactly this change (valid 15 minutes)."
          },
          "reference_counts": {
            "type": "object",
            "description": "Always empty for an album change.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "source_album_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "target_album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The receiving album."
          },
          "track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MetadataManagementSettings": {
        "type": "object",
        "description": "Metadata management block.",
        "properties": {
          "artist_credits": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ArtistCreditSettings"
              }
            ],
            "description": "Artist credits.",
            "default": {
              "preferred_locales": [],
              "standardization": "credited",
              "translate_names": false
            }
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": true
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ManagedField"
            },
            "description": "Managed fields.",
            "default": []
          },
          "preserve_embedded_art_during_scrub": {
            "type": "boolean",
            "description": "Keep embedded art during a scrub.",
            "default": true
          },
          "preserve_fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Fields never touched.",
            "default": []
          },
          "relationships": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RelationshipCreditSettings"
              }
            ],
            "description": "Relationship credits.",
            "default": {
              "enabled": true,
              "types": [
                "composer",
                "lyricist",
                "conductor",
                "performer",
                "arranger",
                "remixer",
                "producer"
              ]
            }
          },
          "scrub_unmanaged_tags": {
            "type": "boolean",
            "description": "Scrub unmanaged tags.",
            "default": false
          },
          "tagging_script_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tagging script ids.",
            "default": []
          }
        }
      },
      "MixGrantState": {
        "type": "string",
        "description": "Where the user's personal-mix auto-request stands.",
        "enum": [
          "none",
          "pending",
          "approved",
          "rejected",
          "revoked"
        ]
      },
      "MixRefreshStatus": {
        "type": "string",
        "description": "Whether a personal-mix refresh started.",
        "enum": [
          "started",
          "already_running"
        ]
      },
      "MoreByArtistResponse": {
        "type": "object",
        "description": "`GET /albums/{album_id}/more-by-artist`.",
        "required": [
          "albums",
          "artist_name"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumRef"
            },
            "description": "Other release groups by the artist, in MusicBrainz browse order."
          },
          "artist_name": {
            "type": "string",
            "description": "The artist's name, empty when MusicBrainz had nothing."
          }
        }
      },
      "MountReason": {
        "type": "string",
        "description": "Why the mount is or is not usable, and whether moves stay on one\nfilesystem.",
        "enum": [
          "ok",
          "not_set",
          "missing",
          "not_writable",
          "different_mount",
          "different_filesystem",
          "stat_error"
        ]
      },
      "MultiDiscNamingMode": {
        "type": "string",
        "description": "Multi-disc naming mode for a root override.",
        "enum": [
          "inherit",
          "standard",
          "script"
        ]
      },
      "MusicBrainzBindingRequest": {
        "type": "object",
        "description": "Consent-bound BrainzMash binding request.",
        "required": [
          "access_revision",
          "source_id",
          "generation",
          "disclosure_version"
        ],
        "properties": {
          "access_revision": {
            "type": "string",
            "description": "Proposed access revision."
          },
          "disclosure_version": {
            "type": "string",
            "description": "Proposed disclosure version."
          },
          "generation": {
            "type": "integer",
            "format": "int64",
            "description": "Proposed source generation."
          },
          "source_id": {
            "type": "string",
            "description": "Proposed source identity."
          }
        }
      },
      "MusicBrainzResultBody": {
        "type": "object",
        "description": "Record the release MusicBrainz created, by hand.",
        "required": [
          "expected_row_revision",
          "release_id_or_url"
        ],
        "properties": {
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Row revision the caller last read."
          },
          "release_id_or_url": {
            "type": "string",
            "description": "Release MBID or release URL."
          },
          "replace_existing_result": {
            "type": "boolean",
            "description": "Replace a different result already recorded."
          }
        }
      },
      "MusicBrainzSeed": {
        "type": "object",
        "required": [
          "action_url",
          "method",
          "fields",
          "contribution_revision",
          "expires_at"
        ],
        "properties": {
          "action_url": {
            "type": "string"
          },
          "contribution_revision": {
            "type": "integer",
            "format": "int64"
          },
          "expires_at": {
            "type": "number",
            "format": "double"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MusicBrainzSeedField"
            }
          },
          "method": {
            "type": "string"
          }
        }
      },
      "MusicBrainzSeedField": {
        "type": "object",
        "required": [
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "MusicBrainzSettings": {
        "type": "object",
        "description": "MusicBrainz connection settings.",
        "properties": {
          "active_brainzmash": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BrainzmashActiveBinding"
              }
            ],
            "description": "Active BrainzMash binding, if any.",
            "default": null
          },
          "api_url": {
            "type": "string",
            "description": "API base (canonicalized for official/brainzmash).",
            "default": "https://api.brainzmash.cc/ws/2"
          },
          "clamped_to_official_limits": {
            "type": "boolean",
            "description": "True when the official-host clamp forced values down (or lifted a\n0 sentinel up). Rendered, never refused.",
            "default": false
          },
          "community_acknowledged": {
            "type": "boolean",
            "description": "Community-tier disclosure acknowledged.",
            "default": false
          },
          "generation": {
            "type": "integer",
            "format": "int64",
            "description": "Source generation.",
            "default": 1
          },
          "rate_limit": {
            "type": "number",
            "format": "double",
            "description": "Requests per second (0 = Unlimited, off-official only).",
            "default": 10.0
          },
          "selected_source_mode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/MbSourceMode"
              }
            ],
            "description": "Last tier the admin chose.",
            "default": "brainzmash"
          },
          "source_id": {
            "type": "string",
            "description": "Source identity."
          },
          "source_mode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/MbSourceMode"
              }
            ],
            "description": "Active source tier.",
            "default": "brainzmash"
          }
        }
      },
      "MusicBrainzSettingsUpdate": {
        "type": "object",
        "description": "Client-submitted MusicBrainz source change. BrainzMash is never a\ndirect update: it moves through stage/consent/verify/activate.",
        "properties": {
          "api_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "API base for mirror/community tiers.",
            "default": null
          },
          "community_acknowledged": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Community-tier disclosure acknowledged.",
            "default": false
          },
          "rate_limit": {
            "type": "number",
            "format": "double",
            "description": "Requests per second.",
            "default": 1.0
          },
          "source_mode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/MbSourceMode"
              }
            ],
            "description": "Desired source tier.",
            "default": "official"
          }
        }
      },
      "MusicBrainzSettingsView": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MusicBrainzSettings",
            "description": "The settled settings."
          },
          {
            "type": "object",
            "properties": {
              "pending_brainzmash": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/BrainzmashPendingProposal"
                  }
                ],
                "description": "Transient pending proposal, when one is staged."
              }
            }
          }
        ],
        "description": "GET view of the MusicBrainz connection: the settled settings plus the\ntransient pending BrainzMash proposal, when one is staged."
      },
      "MusicBrainzVerifyRequest": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/MusicBrainzBindingRequest",
            "description": "Consent-bound BrainzMash verification."
          },
          {
            "$ref": "#/components/schemas/MusicBrainzSettingsUpdate",
            "description": "Plain tier probe (never BrainzMash)."
          }
        ],
        "description": "Verify payload: a BrainzMash consent binding or a plain source\nupdate. The binding is tried first: it pins the exact staged\nproposal, while an update only names a tier to probe."
      },
      "MusicFolderView": {
        "type": "object",
        "description": "One Navidrome music folder.",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Folder id."
          },
          "name": {
            "type": "string",
            "description": "Folder name."
          }
        }
      },
      "MyAppearance": {
        "type": "object",
        "description": "Everything the browser needs to paint the caller's pages.",
        "required": [
          "custom_css",
          "site",
          "stored"
        ],
        "properties": {
          "custom_css": {
            "$ref": "#/components/schemas/MyCustomCss",
            "description": "The caller's own CSS."
          },
          "site": {
            "$ref": "#/components/schemas/SiteAppearance",
            "description": "The site's CSS and whether the caller's own applies."
          },
          "stored": {
            "type": "boolean",
            "description": "False while the caller has saved nothing to their account."
          },
          "theme": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ThemeChoice"
              }
            ],
            "description": "The theme the caller chose, or null while they chose none."
          }
        }
      },
      "MyConnectApps": {
        "type": "object",
        "description": "The caller's choices for their music apps.",
        "required": [
          "include_public_playlists"
        ],
        "properties": {
          "include_public_playlists": {
            "type": "boolean",
            "description": "Apps list other people's public playlists as well as the caller's."
          }
        }
      },
      "MyCustomCss": {
        "type": "object",
        "description": "A person's own CSS.",
        "required": [
          "text",
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "The \"Use my CSS\" switch. Off keeps the text but applies none of it."
          },
          "saved_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "When the text last changed, unix milliseconds."
          },
          "text": {
            "type": "string",
            "description": "The sheet, empty when there is none."
          }
        }
      },
      "NamingScript": {
        "type": "object",
        "description": "One naming script.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Script id.",
            "default": ""
          },
          "name": {
            "type": "string",
            "description": "Display name.",
            "default": ""
          },
          "preset_origin": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preset origin.",
            "default": null
          },
          "preset_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Preset version.",
            "default": null
          },
          "revision": {
            "type": "string",
            "description": "Content revision.",
            "default": ""
          },
          "source": {
            "type": "string",
            "description": "Script source.",
            "default": ""
          }
        }
      },
      "NavidromeConnection": {
        "type": "object",
        "description": "Navidrome connection.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "navidrome_url": {
            "type": "string",
            "description": "Navidrome base URL.",
            "default": ""
          },
          "password": {
            "type": "string",
            "description": "Password (encrypted at rest).",
            "default": ""
          },
          "playlist_sync_enabled": {
            "type": "boolean",
            "description": ".m3u8 export switch (off by default).",
            "default": false
          },
          "playlist_sync_path": {
            "type": "string",
            "description": "Export directory Navidrome scans.",
            "default": ""
          },
          "playlist_sync_remove_deleted": {
            "type": "boolean",
            "description": "Remove exports that stop qualifying.",
            "default": true
          },
          "playlist_sync_scope": {
            "type": "string",
            "description": "Export scope (`public`, or opt-in `all`).",
            "default": "public"
          },
          "username": {
            "type": "string",
            "description": "Username.",
            "default": ""
          }
        }
      },
      "NewReleaseItem": {
        "type": "object",
        "description": "One new-release sighting.",
        "required": [
          "release_group_mbid",
          "title",
          "artist_name",
          "artist_mbid",
          "in_library"
        ],
        "properties": {
          "artist_mbid": {
            "type": "string",
            "description": "Artist MBID."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "first_release_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "First release date, when known."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when the library already holds the album (only the release\nlog shows owned albums)."
          },
          "primary_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release-group primary type, when known."
          },
          "release_group_mbid": {
            "type": "string",
            "description": "Release-group MBID."
          },
          "title": {
            "type": "string",
            "description": "Release title."
          }
        }
      },
      "NewReleaseListResponse": {
        "type": "object",
        "description": "New-release list answer.",
        "required": [
          "items",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NewReleaseItem"
            },
            "description": "Sightings for followed artists, newest first."
          },
          "total": {
            "type": "integer",
            "description": "Rows the filter matches, beyond this page too.",
            "minimum": 0
          }
        }
      },
      "NewznabIndexer": {
        "type": "object",
        "description": "One configured Newznab indexer. DroppedNeedle ships none; the user adds\ntheir own.",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "API key (encrypted at rest, per element).",
            "default": ""
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "description": "Newznab categories.",
            "default": [
              3000,
              3010,
              3040
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": true
          },
          "id": {
            "type": "string",
            "description": "Stable id.",
            "default": ""
          },
          "name": {
            "type": "string",
            "description": "Display name (list identity for import).",
            "default": ""
          },
          "priority": {
            "type": "integer",
            "format": "int64",
            "description": "Priority (lower first).",
            "default": 1
          },
          "url": {
            "type": "string",
            "description": "Indexer base URL.",
            "default": ""
          }
        }
      },
      "NextSourceRequest": {
        "type": "object",
        "description": "Next-source request: the source the page showed, so a stale click\ncannot skip the source that replaced it.",
        "required": [
          "expected_candidate_index"
        ],
        "properties": {
          "expected_candidate_index": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "NextSourceResponse": {
        "type": "object",
        "description": "Next-source outcome: the task after the switch.",
        "required": [
          "success",
          "status"
        ],
        "properties": {
          "candidate_index": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus"
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "NowPlayingEntry": {
        "type": "object",
        "description": "One live session, already privacy-projected (same JSON as the\n`discover` now-playing shape, so clients see no difference).",
        "required": [
          "id",
          "user_name",
          "track_name",
          "artist_name",
          "cover_url",
          "device_name",
          "is_paused",
          "source"
        ],
        "properties": {
          "album_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title (none when redacted or unknown)."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name (empty when redacted)."
          },
          "cover_url": {
            "type": "string",
            "description": "Cover art URL (empty when redacted)."
          },
          "device_name": {
            "type": "string",
            "description": "Device label."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track length in milliseconds, when known."
          },
          "id": {
            "type": "string",
            "description": "Session key (`user_id:device`)."
          },
          "is_paused": {
            "type": "boolean",
            "description": "True when paused."
          },
          "progress_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Position in milliseconds, when known."
          },
          "redacted": {
            "type": "boolean",
            "description": "True when the owner hides the track."
          },
          "source": {
            "type": "string",
            "description": "Playback source."
          },
          "track_name": {
            "type": "string",
            "description": "Track title (empty when redacted)."
          },
          "user_name": {
            "type": "string",
            "description": "Display name of the listener."
          }
        }
      },
      "NowPlayingHeartbeat": {
        "type": "object",
        "description": "Native heartbeat.",
        "required": [
          "track_name",
          "artist_name"
        ],
        "properties": {
          "album_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "cover_url": {
            "type": "string",
            "description": "Cover art URL."
          },
          "device": {
            "type": "string",
            "description": "Reporting device slug."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track length in milliseconds, when known."
          },
          "is_paused": {
            "type": "boolean",
            "description": "True while paused."
          },
          "progress_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Position in milliseconds, when known."
          },
          "source": {
            "type": "string",
            "description": "Playback source."
          },
          "track_name": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "NowPlayingSnapshot": {
        "type": "object",
        "description": "The live presence snapshot.",
        "required": [
          "sessions"
        ],
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NowPlayingEntry"
            },
            "description": "Projected live sessions."
          }
        }
      },
      "NowPlayingVisibility": {
        "type": "string",
        "description": "Who sees what a user plays: `user_listening_prefs.now_playing_visibility`.",
        "enum": [
          "full",
          "track_hidden",
          "offline"
        ]
      },
      "NzbgetConnection": {
        "type": "object",
        "description": "NZBGet connection. NZBGet has no \"all categories\" wildcard, so an empty\ncategory lets NZBGet apply its own default. There is no post-processing\nfield: NZBGet decides unpack and repair per category, not per job.",
        "properties": {
          "category": {
            "type": "string",
            "description": "Category (\"\" lets NZBGet choose).",
            "default": ""
          },
          "downloads_mount": {
            "type": "string",
            "description": "Where DroppedNeedle sees NZBGet's completed dir (`DestDir`).",
            "default": "/nzbget-downloads"
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "password": {
            "type": "string",
            "description": "Control password (encrypted at rest).",
            "default": ""
          },
          "url": {
            "type": "string",
            "description": "NZBGet base URL.",
            "default": ""
          },
          "username": {
            "type": "string",
            "description": "Control username (`ControlUsername` in nzbget.conf).",
            "default": "nzbget"
          }
        }
      },
      "OidcAuthorizeBody": {
        "type": "object",
        "description": "OIDC authorize answer: the browser URL for this login.",
        "required": [
          "authorize_url"
        ],
        "properties": {
          "authorize_url": {
            "type": "string",
            "description": "IdP authorize URL (PKCE + state baked in)."
          }
        }
      },
      "OidcConnection": {
        "type": "object",
        "description": "OIDC connection.",
        "properties": {
          "auto_redirect": {
            "type": "boolean",
            "description": "The login page starts single sign-on at once instead of showing its\nsign-in methods; `/login?local` still shows them. Only while single\nsign-on is on and set up.",
            "default": false
          },
          "client_id": {
            "type": "string",
            "description": "Client id.",
            "default": ""
          },
          "client_secret": {
            "type": "string",
            "description": "Client secret (encrypted at rest).",
            "default": ""
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "issuer": {
            "type": "string",
            "description": "Issuer URL.",
            "default": ""
          },
          "redirect_uri": {
            "type": "string",
            "description": "Redirect URI.",
            "default": ""
          },
          "scopes": {
            "type": "string",
            "description": "Scopes.",
            "default": "openid email profile"
          }
        }
      },
      "OidcExchangeBody": {
        "type": "object",
        "description": "OIDC exchange body: swap the one-time callback code for a session.",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Single-use code from the callback redirect."
          },
          "transport": {
            "$ref": "#/components/schemas/TransportDto",
            "description": "Credential handoff; defaults to cookie."
          }
        }
      },
      "OperationCandidateEvidenceView": {
        "type": "object",
        "description": "The evidence behind one candidate release.",
        "required": [
          "release_group_mbid",
          "album_title",
          "album_artist_name",
          "local_album_title",
          "local_album_artist_name",
          "album_title_classification",
          "album_artist_classification",
          "track_evidence",
          "unmatched_expected_tracks",
          "score",
          "margin",
          "reason_code",
          "matcher_version",
          "distance",
          "penalties"
        ],
        "properties": {
          "album_artist_classification": {
            "$ref": "#/components/schemas/EvidenceClass"
          },
          "album_artist_name": {
            "type": "string"
          },
          "album_title": {
            "type": "string"
          },
          "album_title_classification": {
            "$ref": "#/components/schemas/EvidenceClass"
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "distance": {
            "type": "number",
            "format": "double",
            "description": "Matcher distance, 0 for a perfect match."
          },
          "local_album_artist_name": {
            "type": "string"
          },
          "local_album_title": {
            "type": "string"
          },
          "margin": {
            "type": "number",
            "format": "double",
            "description": "Distance gap to the next candidate in the list."
          },
          "matcher_version": {
            "type": "string"
          },
          "penalties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PenaltyView"
            },
            "description": "What the distance is made of, largest share first."
          },
          "reason_code": {
            "type": "string"
          },
          "release_date": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_group_mbid": {
            "type": "string"
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "score": {
            "type": "number",
            "format": "double",
            "description": "One minus the distance."
          },
          "track_evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OperationTrackEvidenceView"
            }
          },
          "unmatched_expected_tracks": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Release track titles no local file took."
          }
        }
      },
      "OperationControlBody": {
        "type": "object",
        "description": "Pause, resume, or stop a job.",
        "required": [
          "expected_row_revision"
        ],
        "properties": {
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The job's `row_revision` as last read."
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Makes a retried control a no-op."
          }
        }
      },
      "OperationResult": {
        "type": "object",
        "description": "Bare success acknowledgement.",
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Whether the operation succeeded."
          }
        }
      },
      "OperationState": {
        "type": "string",
        "description": "Where a job is in its life.",
        "enum": [
          "queued",
          "running",
          "paused",
          "ready",
          "succeeded",
          "failed",
          "cancelled",
          "stopped"
        ]
      },
      "OperationTrackEvidenceView": {
        "type": "object",
        "description": "One local file against one candidate release.",
        "required": [
          "local_track_id",
          "classification",
          "evidence_kinds"
        ],
        "properties": {
          "candidate_disc_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "candidate_track_position": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "candidate_track_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "classification": {
            "$ref": "#/components/schemas/EvidenceClass"
          },
          "evidence_kinds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What ties the file to the release track (`embedded_id`, `acoustid`,\n`title_position_length`, or `track_id_elsewhere`: the recording ID,\non a file whose track ID belongs to another edition), or why it does\nnot (`distant_pair`: paired, but not closely). `acoustid_overruled`\nfollows when the file's measured length set aside a fingerprint\nthat named another track."
          },
          "local_track_id": {
            "type": "string"
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_track_mbid": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OperationView": {
        "type": "object",
        "description": "One operation job.",
        "required": [
          "id",
          "kind",
          "state",
          "expected_work_count",
          "completed_count",
          "succeeded_count",
          "failed_count",
          "skipped_count",
          "control_request",
          "row_revision",
          "event_revision",
          "created_at",
          "updated_at",
          "results",
          "results_truncated",
          "reidentification_candidates"
        ],
        "properties": {
          "completed_count": {
            "type": "integer",
            "format": "int64"
          },
          "control_request": {
            "$ref": "#/components/schemas/ControlRequest",
            "description": "A control the worker has not acted on yet."
          },
          "created_at": {
            "type": "number",
            "format": "double"
          },
          "event_revision": {
            "type": "integer",
            "format": "int64"
          },
          "expected_work_count": {
            "type": "integer",
            "format": "int64"
          },
          "failed_count": {
            "type": "integer",
            "format": "int64"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "`explicit_reidentification`, `bulk_review_apply`, `repair`, or\n`library_management`."
          },
          "reidentification_candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReidentificationCandidateView"
            },
            "description": "Candidates a re-identification waits on, best first."
          },
          "repair_summary": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RepairSummaryView"
              }
            ],
            "description": "An identity repair or preparation's report, once its check is done."
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OperationWorkResultView"
            },
            "description": "The first 100 work results."
          },
          "results_truncated": {
            "type": "boolean"
          },
          "row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Echo this on every control and choice."
          },
          "selected_reidentification_candidate_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "skipped_count": {
            "type": "integer",
            "format": "int64"
          },
          "state": {
            "$ref": "#/components/schemas/OperationState",
            "description": "Where the job is in its life."
          },
          "succeeded_count": {
            "type": "integer",
            "format": "int64"
          },
          "terminal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "terminal_reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReasonView"
              }
            ],
            "description": "What `terminal_code` means and what to do about it."
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "OperationWorkResultView": {
        "type": "object",
        "description": "One work item's outcome.",
        "required": [
          "ordinal",
          "action",
          "state",
          "result"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "bundle_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The publish bundle the item wrote its files under, when it wrote\nany: the id the recovery list names."
          },
          "failure_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "failure_reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReasonView"
              }
            ],
            "description": "Why the item failed, in words, with what to do about it."
          },
          "local_album_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "local_track_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ordinal": {
            "type": "integer",
            "format": "int64"
          },
          "result": {
            "type": "object",
            "description": "What the work item recorded (for a re-identification: `outcome`,\n`reason_code`, `candidate_keys`)."
          },
          "state": {
            "$ref": "#/components/schemas/WorkState"
          }
        }
      },
      "Option": {
        "oneOf": [
          {
            "type": "null"
          },
          {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "description": "How one optional source fared while a page was built. Sources that\nanswered normally are left out of the map.",
              "enum": [
                "degraded",
                "error"
              ]
            },
            "propertyNames": {
              "type": "string"
            }
          }
        ]
      },
      "OrganizationManagementSettings": {
        "type": "object",
        "description": "Organization management block.",
        "properties": {
          "compatibility": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PathCompatibilitySettings"
              }
            ],
            "description": "Path compatibility.",
            "default": {
              "extension_case": "preserve",
              "maximum_component_length": 240,
              "maximum_path_length": 4096,
              "replace_non_ascii": false,
              "replace_spaces_with_underscores": false,
              "separator_replacement": "_",
              "unicode_normalization": "NFC",
              "windows_compatible": true,
              "windows_legacy_path_limit": false
            }
          },
          "move_enabled": {
            "type": "boolean",
            "description": "Move files.",
            "default": true
          },
          "move_sidecars": {
            "type": "boolean",
            "description": "Move sidecar files along.",
            "default": true
          },
          "multi_disc_naming_script_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Multi-disc naming script id.",
            "default": null
          },
          "naming_script_id": {
            "type": "string",
            "description": "Naming script id.",
            "default": "69202666-cb88-52b0-bac2-0afc62b1e909"
          },
          "rename_enabled": {
            "type": "boolean",
            "description": "Rename files.",
            "default": true
          },
          "sidecar_patterns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sidecar filename patterns.",
            "default": [
              "cover.jpg",
              "cover.jpeg",
              "cover.png",
              "cover.webp",
              "folder.jpg",
              "folder.jpeg",
              "folder.png",
              "front.jpg",
              "front.png",
              "back.jpg",
              "back.jpeg",
              "back.png",
              "back.webp",
              "booklet*.jpg",
              "booklet*.jpeg",
              "booklet*.png",
              "booklet*.webp",
              "medium*.jpg",
              "medium*.jpeg",
              "medium*.png",
              "medium*.webp",
              "*.cue",
              "*.log",
              "*.lrc",
              "*.m3u",
              "*.m3u8",
              "*.pls"
            ]
          }
        }
      },
      "OwnedRelease": {
        "type": "object",
        "description": "One release group of an artist's discography that the library holds.",
        "required": [
          "id",
          "secondary_types"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Release-group MBID."
          },
          "primary_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary type (`Album`, `EP`, `Single`, `Other`, ...)."
          },
          "secondary_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Secondary types (`Compilation`, `Live`, `Soundtrack`, ...)."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Title."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "First release year."
          }
        }
      },
      "OwnedReleases": {
        "type": "object",
        "description": "`GET /artists/{artist_mbid}/owned-releases`: every release group of the\nartist's discography that the library holds, whatever its type. The\nrelease-type preferences only shape the discography; the library part of\nan artist page shows everything the library holds.",
        "required": [
          "items",
          "complete",
          "service_status"
        ],
        "properties": {
          "complete": {
            "type": "boolean",
            "description": "False while the rest of a large discography is still being fetched,\nor when MusicBrainz could not be asked: some held albums may be\nmissing from `items`."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OwnedRelease"
            },
            "description": "The held release groups, newest first."
          },
          "service_status": {
            "$ref": "#/components/schemas/Option",
            "description": "Sources that degraded while building the list."
          }
        }
      },
      "PageSection": {
        "type": "object",
        "description": "One section of a page.",
        "required": [
          "key",
          "zone",
          "content"
        ],
        "properties": {
          "content": {
            "$ref": "#/components/schemas/SectionContent",
            "description": "Its rows."
          },
          "key": {
            "$ref": "#/components/schemas/SectionKey",
            "description": "Which section it is."
          },
          "zone": {
            "$ref": "#/components/schemas/SectionZone",
            "description": "The zone it is shown in."
          }
        }
      },
      "Page_ArtistDuplicateGroupSummary": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One duplicate artist group.",
              "required": [
                "id",
                "display_name",
                "state",
                "member_count",
                "members",
                "provider_mbids",
                "affected_reference_count",
                "reason_code",
                "reason",
                "can_undo"
              ],
              "properties": {
                "affected_reference_count": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Credits, favorites and plays a merge would move."
                },
                "can_undo": {
                  "type": "boolean",
                  "description": "The merge is a join by name an administrator can undo."
                },
                "display_name": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "description": "Stable for the same set of records."
                },
                "member_count": {
                  "type": "integer",
                  "minimum": 0
                },
                "members": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ArtistReconciliationMember"
                  }
                },
                "merge_basis": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/ArtistMergeBasis",
                      "description": "What that merge rested on."
                    }
                  ]
                },
                "provider_mbids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "reason": {
                  "$ref": "#/components/schemas/ReasonView",
                  "description": "Why the group is listed and what to do about it."
                },
                "reason_code": {
                  "type": "string"
                },
                "recommended_survivor_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The record a merge would keep, when the evidence names one."
                },
                "resolved_at": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "format": "double",
                  "description": "When an automatic merge resolved the group (unix seconds)."
                },
                "state": {
                  "$ref": "#/components/schemas/ArtistGroupState"
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_BinRemovalView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One removal or change whose files are in the recycle bin.",
              "required": [
                "id",
                "kind",
                "removed_at",
                "files",
                "bytes",
                "not_found",
                "unchecked",
                "held",
                "can_put_back"
              ],
              "properties": {
                "album": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/BinAlbumView"
                    }
                  ]
                },
                "bytes": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Bytes of the copies found.",
                  "minimum": 0
                },
                "can_put_back": {
                  "type": "boolean",
                  "description": "Put back is offered."
                },
                "expires_at": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int64",
                  "description": "When the bin's expiry deletes its first copy, unix milliseconds;\nabsent while the retention can't be read."
                },
                "files": {
                  "type": "integer",
                  "format": "int32",
                  "description": "Files in the bin.",
                  "minimum": 0
                },
                "held": {
                  "type": "integer",
                  "format": "int32",
                  "description": "Files waiting for an admin under \"Some file writes need you\".",
                  "minimum": 0
                },
                "id": {
                  "type": "string",
                  "description": "The removal's id, which Put back names."
                },
                "kind": {
                  "$ref": "#/components/schemas/BinKind"
                },
                "not_found": {
                  "type": "integer",
                  "format": "int32",
                  "description": "Copies not found where they should be.",
                  "minimum": 0
                },
                "removed_at": {
                  "type": "integer",
                  "format": "int64",
                  "description": "When it was made, unix milliseconds."
                },
                "unchecked": {
                  "type": "integer",
                  "format": "int32",
                  "description": "Copies that can't be checked: in a bin no longer set, behind a\nlink, or while the bins can't be told.",
                  "minimum": 0
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_DuplicateGroupView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Albums the library lists more than once.",
              "required": [
                "id",
                "title",
                "artist",
                "classes",
                "copies"
              ],
              "properties": {
                "artist": {
                  "type": "string",
                  "description": "The first copy's artist."
                },
                "classes": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DuplicateClass"
                  },
                  "description": "What the copies show: a shared release, different releases, a copy\nwith fewer tracks. Empty when none applies."
                },
                "copies": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DuplicateCopyView"
                  }
                },
                "id": {
                  "type": "string",
                  "description": "The release group the copies share."
                },
                "title": {
                  "type": "string",
                  "description": "The first copy's title, to name the group by."
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_ManagementHistoryItemView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One row of management history.",
              "required": [
                "operation",
                "mode",
                "origin",
                "phase",
                "profile_id",
                "profile_name",
                "profile_revision",
                "activation_preview",
                "selection",
                "eligible_count",
                "warning_count",
                "blocked_count"
              ],
              "properties": {
                "activation_preview": {
                  "type": "boolean"
                },
                "blocked_count": {
                  "type": "integer",
                  "format": "int64"
                },
                "eligible_count": {
                  "type": "integer",
                  "format": "int64"
                },
                "expires_at": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "format": "double"
                },
                "mode": {
                  "type": "string"
                },
                "operation": {
                  "$ref": "#/components/schemas/OperationView"
                },
                "origin": {
                  "type": "string"
                },
                "phase": {
                  "$ref": "#/components/schemas/ManagementPhase"
                },
                "profile_id": {
                  "type": "string"
                },
                "profile_name": {
                  "type": "string"
                },
                "profile_revision": {
                  "type": "string"
                },
                "selection": {
                  "type": "object"
                },
                "target_root_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "warning_count": {
                  "type": "integer",
                  "format": "int64"
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_ManagementPlanItemView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One planned file.",
              "required": [
                "ordinal",
                "bundle_ordinal",
                "eligibility",
                "estimated_temporary_bytes",
                "desired_document",
                "artwork_choices",
                "diff",
                "capability",
                "collisions"
              ],
              "properties": {
                "artwork_choices": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                },
                "bundle_ordinal": {
                  "type": "integer",
                  "format": "int64",
                  "description": "The album this file is planned with; albums apply as a whole."
                },
                "capability": {
                  "type": "object",
                  "description": "`audio_format`, `warnings`, `blockers`, and catalog facts."
                },
                "collisions": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                },
                "desired_document": {
                  "type": "object",
                  "description": "`fields`: the tags the file ends up with, `[{name, value}]`."
                },
                "destination_relative_path": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "destination_root_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "diff": {
                  "type": "object",
                  "description": "`field_mutations` (`{name, operation, before, after}`),\n`tags_changed`, `path_changed`, `sidecars`."
                },
                "eligibility": {
                  "$ref": "#/components/schemas/Eligibility"
                },
                "estimated_temporary_bytes": {
                  "type": "integer",
                  "format": "int64"
                },
                "local_album_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "local_track_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "ordinal": {
                  "type": "integer",
                  "format": "int64"
                },
                "reason": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/ManagementReasonView",
                      "description": "The reason in words, with what to do about it."
                    }
                  ]
                },
                "reason_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source_relative_path": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "source_root_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_ManagementResultItemView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One file after apply.",
              "required": [
                "plan",
                "work_state",
                "result",
                "journal_states"
              ],
              "properties": {
                "failure_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "failure_reason": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/ManagementReasonView",
                      "description": "Why the file failed or was not written, with what to do about it."
                    }
                  ]
                },
                "journal_states": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "plan": {
                  "$ref": "#/components/schemas/ManagementPlanItemView"
                },
                "result": {
                  "type": "object"
                },
                "work_state": {
                  "$ref": "#/components/schemas/ResultState"
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_OperationView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One operation job.",
              "required": [
                "id",
                "kind",
                "state",
                "expected_work_count",
                "completed_count",
                "succeeded_count",
                "failed_count",
                "skipped_count",
                "control_request",
                "row_revision",
                "event_revision",
                "created_at",
                "updated_at",
                "results",
                "results_truncated",
                "reidentification_candidates"
              ],
              "properties": {
                "completed_count": {
                  "type": "integer",
                  "format": "int64"
                },
                "control_request": {
                  "$ref": "#/components/schemas/ControlRequest",
                  "description": "A control the worker has not acted on yet."
                },
                "created_at": {
                  "type": "number",
                  "format": "double"
                },
                "event_revision": {
                  "type": "integer",
                  "format": "int64"
                },
                "expected_work_count": {
                  "type": "integer",
                  "format": "int64"
                },
                "failed_count": {
                  "type": "integer",
                  "format": "int64"
                },
                "id": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "description": "`explicit_reidentification`, `bulk_review_apply`, `repair`, or\n`library_management`."
                },
                "reidentification_candidates": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReidentificationCandidateView"
                  },
                  "description": "Candidates a re-identification waits on, best first."
                },
                "repair_summary": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/RepairSummaryView",
                      "description": "An identity repair or preparation's report, once its check is done."
                    }
                  ]
                },
                "results": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OperationWorkResultView"
                  },
                  "description": "The first 100 work results."
                },
                "results_truncated": {
                  "type": "boolean"
                },
                "row_revision": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Echo this on every control and choice."
                },
                "selected_reidentification_candidate_key": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "skipped_count": {
                  "type": "integer",
                  "format": "int64"
                },
                "state": {
                  "$ref": "#/components/schemas/OperationState",
                  "description": "Where the job is in its life."
                },
                "succeeded_count": {
                  "type": "integer",
                  "format": "int64"
                },
                "terminal_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "terminal_reason": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/ReasonView",
                      "description": "What `terminal_code` means and what to do about it."
                    }
                  ]
                },
                "updated_at": {
                  "type": "number",
                  "format": "double"
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_PluginFileView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One file a plugin added to the library.",
              "required": [
                "bundle_id",
                "root_id",
                "relative_path",
                "size",
                "added_at",
                "state"
              ],
              "properties": {
                "added_at": {
                  "type": "integer",
                  "format": "int64",
                  "description": "When it was added, in unix milliseconds."
                },
                "bundle_id": {
                  "type": "string",
                  "description": "The change that added it; undo it to take the file back."
                },
                "relative_path": {
                  "type": "string",
                  "description": "Path under the library folder."
                },
                "root_id": {
                  "type": "string",
                  "description": "Library folder id."
                },
                "size": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Size in bytes.",
                  "minimum": 0
                },
                "state": {
                  "$ref": "#/components/schemas/PluginFileState"
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_ReleaseEditionView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One MusicBrainz release in the edition finder.",
              "required": [
                "release_mbid",
                "release_group_mbid",
                "artist_name",
                "title",
                "media_formats",
                "disc_count",
                "track_count",
                "musicbrainz_url",
                "score",
                "belongs_to_current_release_group",
                "is_current_release"
              ],
              "properties": {
                "artist_name": {
                  "type": "string"
                },
                "barcode": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "belongs_to_current_release_group": {
                  "type": "boolean"
                },
                "catalogue_number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "country": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "date": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "disambiguation": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "disc_count": {
                  "type": "integer",
                  "format": "int32",
                  "minimum": 0
                },
                "is_current_release": {
                  "type": "boolean"
                },
                "label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "media_formats": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "musicbrainz_url": {
                  "type": "string"
                },
                "packaging": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "release_group_mbid": {
                  "type": "string"
                },
                "release_mbid": {
                  "type": "string"
                },
                "score": {
                  "type": "integer",
                  "format": "int64",
                  "description": "MusicBrainz search score, 0 to 100."
                },
                "status": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "title": {
                  "type": "string"
                },
                "track_count": {
                  "type": "integer",
                  "format": "int32",
                  "minimum": 0
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_RepairFindingView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/FindingRow"
                },
                {
                  "type": "object",
                  "required": [
                    "reason"
                  ],
                  "properties": {
                    "automatic_undo": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "$ref": "#/components/schemas/AutomaticEditionUndoInfoView"
                        }
                      ]
                    },
                    "reason": {
                      "$ref": "#/components/schemas/ReasonView",
                      "description": "What the finding means and what to do about it."
                    },
                    "suggested_edition": {
                      "oneOf": [
                        {
                          "type": "null"
                        },
                        {
                          "$ref": "#/components/schemas/SuggestedEditionView"
                        }
                      ]
                    }
                  }
                }
              ],
              "description": "One album's finding."
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_RetagPairView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Two album rows that look like one retagged album, which the scan would\nnot join by itself.",
              "required": [
                "old_album",
                "new_album",
                "reason",
                "editions_differ",
                "recorded_at"
              ],
              "properties": {
                "editions_differ": {
                  "type": "boolean",
                  "description": "Two different chosen editions remain once a custom edition on the\nold album is left out: the join must name the one to keep."
                },
                "new_album": {
                  "$ref": "#/components/schemas/RetagPairAlbumView",
                  "description": "The row the files sit on now, or the album it was merged into\nsince. A join keeps this one."
                },
                "old_album": {
                  "$ref": "#/components/schemas/RetagPairAlbumView",
                  "description": "The row the files left. It holds the favorites, plays and links."
                },
                "reason": {
                  "$ref": "#/components/schemas/RetagPairReasonView"
                },
                "recorded_at": {
                  "type": "integer",
                  "format": "int64",
                  "description": "When the scan recorded the pair (Unix milliseconds)."
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_ReviewView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One identification review and the album it is about.",
              "required": [
                "id",
                "album_id",
                "album_title",
                "artist_name",
                "reason_code",
                "reason",
                "state",
                "candidates",
                "created_ms",
                "updated_ms",
                "manual_identity",
                "row_revision"
              ],
              "properties": {
                "album_id": {
                  "type": "string",
                  "description": "Local album id."
                },
                "album_title": {
                  "type": "string",
                  "description": "Album title, as the library shows it."
                },
                "artist_name": {
                  "type": "string",
                  "description": "Album artist, as the library shows it."
                },
                "candidates": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CandidateView"
                  },
                  "description": "Scored candidates, best first."
                },
                "created_ms": {
                  "type": "integer",
                  "format": "int64",
                  "description": "When the review was filed (Unix milliseconds)."
                },
                "id": {
                  "type": "string",
                  "description": "Review id."
                },
                "manual_identity": {
                  "type": "boolean",
                  "description": "The album's current match was picked by a person."
                },
                "reason": {
                  "$ref": "#/components/schemas/ReasonView",
                  "description": "Why the review exists and what to do, in plain words."
                },
                "reason_code": {
                  "type": "string",
                  "description": "Reason code the review was filed with."
                },
                "resolved_by": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Resolving user, once settled."
                },
                "row_revision": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Goes up whenever the review's state, candidates, reason or album\nchanges. Every action on the review sends the one it was decided\non."
                },
                "selected_candidate_key": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Selected candidate key, once approved."
                },
                "state": {
                  "$ref": "#/components/schemas/ReviewState",
                  "description": "Review state."
                },
                "updated_ms": {
                  "type": "integer",
                  "format": "int64",
                  "description": "When it last changed (Unix milliseconds)."
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_ScanRunFailureItem": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One path a scan could not read or index.",
              "required": [
                "root_id",
                "relative_path",
                "failure_code",
                "message",
                "action",
                "failure_detail",
                "phase",
                "recorded_at"
              ],
              "properties": {
                "action": {
                  "type": "string",
                  "description": "What to do about it."
                },
                "failure_code": {
                  "$ref": "#/components/schemas/FailureCode",
                  "description": "Stable machine code, for example `TAG_READ_FAILED`."
                },
                "failure_detail": {
                  "type": "string",
                  "description": "Technical detail for diagnostics; not meant for display."
                },
                "message": {
                  "type": "string",
                  "description": "What happened, in plain words."
                },
                "phase": {
                  "$ref": "#/components/schemas/ScanPhase",
                  "description": "Phase the file failed in."
                },
                "recorded_at": {
                  "type": "number",
                  "format": "double",
                  "description": "Unix seconds."
                },
                "relative_path": {
                  "type": "string"
                },
                "root_id": {
                  "type": "string"
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_ScanRunView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One scan run.",
              "required": [
                "id",
                "kind",
                "trigger",
                "state",
                "phase",
                "aggregate_scope",
                "counters",
                "queued_at",
                "updated_at",
                "requested_control",
                "coalesced_request_count",
                "row_revision",
                "event_revision",
                "phase_timings"
              ],
              "properties": {
                "aggregate_scope": {
                  "$ref": "#/components/schemas/AggregateScope"
                },
                "coalesced_request_count": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Requests folded into this run."
                },
                "counters": {
                  "$ref": "#/components/schemas/Counters",
                  "description": "Progress counters."
                },
                "event_revision": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Event revision.",
                  "minimum": 0
                },
                "id": {
                  "type": "string",
                  "description": "Run id."
                },
                "kind": {
                  "$ref": "#/components/schemas/ScanKind",
                  "description": "Run kind."
                },
                "phase": {
                  "$ref": "#/components/schemas/ScanPhase",
                  "description": "Current phase."
                },
                "phase_timings": {
                  "type": "object",
                  "description": "Seconds spent per phase.",
                  "additionalProperties": {
                    "type": "number",
                    "format": "double"
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                },
                "queued_at": {
                  "type": "number",
                  "format": "double",
                  "description": "Queue time (unix seconds)."
                },
                "requested_by_user_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Who asked for the run, when someone did."
                },
                "requested_control": {
                  "$ref": "#/components/schemas/RequestedControl",
                  "description": "Pending control."
                },
                "resume_phase": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/ScanPhase",
                      "description": "Phase a paused run picks up from."
                    }
                  ]
                },
                "row_revision": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Row revision; pause, resume and stop send it back.",
                  "minimum": 0
                },
                "started_at": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "format": "double",
                  "description": "Start time, when started."
                },
                "state": {
                  "$ref": "#/components/schemas/ScanState",
                  "description": "Run state."
                },
                "terminal_action": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "What to do about the terminal code."
                },
                "terminal_at": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "format": "double",
                  "description": "Terminal time, when terminal."
                },
                "terminal_code": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/FailureCode",
                      "description": "Terminal code, when terminal."
                    }
                  ]
                },
                "terminal_message": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "What the terminal code means, in plain words."
                },
                "trigger": {
                  "$ref": "#/components/schemas/ScanTrigger",
                  "description": "What triggered the run."
                },
                "updated_at": {
                  "type": "number",
                  "format": "double",
                  "description": "Last update time."
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "Page_WaitingAlbumView": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items",
          "next_cursor",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One album whose match waits for a look.",
              "required": [
                "album_id",
                "title",
                "artist_name",
                "state",
                "reason",
                "updated_at",
                "identity_revision",
                "file_count",
                "looks_wrong_count"
              ],
              "properties": {
                "album_id": {
                  "type": "string"
                },
                "artist_name": {
                  "type": "string"
                },
                "file_count": {
                  "type": "integer",
                  "format": "int32",
                  "description": "Indexed files the album holds.",
                  "minimum": 0
                },
                "guess": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "$ref": "#/components/schemas/WaitingGuessView",
                      "description": "What \"That's right\" confirms, for a best guess."
                    }
                  ]
                },
                "identity_revision": {
                  "type": "integer",
                  "format": "int64",
                  "description": "The identity's row revision, 0 when the album has none. \"That's\nright\" echoes it."
                },
                "looks_wrong_count": {
                  "type": "integer",
                  "format": "int32",
                  "description": "How many people marked the match \"Looks wrong\".",
                  "minimum": 0
                },
                "reason": {
                  "$ref": "#/components/schemas/ReasonView"
                },
                "release_group_mbid": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "release_mbid": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "state": {
                  "$ref": "#/components/schemas/EditionState",
                  "description": "`unconfirmed` or `unmatched`; in the \"Looks wrong\" list, any state."
                },
                "title": {
                  "type": "string",
                  "description": "The album as its files have it."
                },
                "updated_at": {
                  "type": "number",
                  "format": "double",
                  "description": "When it was listed (epoch seconds): the match, or the newest\n\"Looks wrong\" mark."
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass back as `cursor` for the next page; null on the last."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Rows in the whole list, for lists that count them.",
            "minimum": 0
          }
        }
      },
      "PasswordChange": {
        "type": "object",
        "description": "Change password on an account that already has one.",
        "required": [
          "current_password",
          "new_password"
        ],
        "properties": {
          "current_password": {
            "type": "string",
            "description": "Current password, proving ownership."
          },
          "new_password": {
            "type": "string",
            "description": "New password, at least 12 chars."
          }
        }
      },
      "PasswordReset": {
        "type": "object",
        "description": "Public password reset with a recovery code.",
        "required": [
          "username",
          "recovery_code",
          "new_password"
        ],
        "properties": {
          "new_password": {
            "type": "string",
            "description": "New password, at least 12 chars."
          },
          "recovery_code": {
            "type": "string",
            "description": "Recovery code from the admin (dashes and case ignored)."
          },
          "username": {
            "type": "string",
            "description": "Account username."
          }
        }
      },
      "PathCompatibilitySettings": {
        "type": "object",
        "description": "Path-compatibility handling.",
        "properties": {
          "extension_case": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ExtensionCase"
              }
            ],
            "description": "Extension case.",
            "default": "preserve"
          },
          "maximum_component_length": {
            "type": "integer",
            "format": "int64",
            "description": "Max path-component length.",
            "default": 240
          },
          "maximum_path_length": {
            "type": "integer",
            "format": "int64",
            "description": "Max path length.",
            "default": 4096
          },
          "replace_non_ascii": {
            "type": "boolean",
            "description": "Replace non-ASCII characters.",
            "default": false
          },
          "replace_spaces_with_underscores": {
            "type": "boolean",
            "description": "Replace spaces with underscores.",
            "default": false
          },
          "separator_replacement": {
            "type": "string",
            "description": "Path-separator replacement.",
            "default": "_"
          },
          "unicode_normalization": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UnicodeNormalization"
              }
            ],
            "description": "Unicode normalization.",
            "default": "NFC"
          },
          "windows_compatible": {
            "type": "boolean",
            "description": "Windows-safe names.",
            "default": true
          },
          "windows_legacy_path_limit": {
            "type": "boolean",
            "description": "Honor the legacy Windows path limit.",
            "default": false
          }
        }
      },
      "PenaltyView": {
        "type": "object",
        "description": "One penalty's share of a candidate's distance.",
        "required": [
          "name",
          "share"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Penalty name."
          },
          "share": {
            "type": "number",
            "format": "double",
            "description": "Its share of the distance."
          }
        }
      },
      "PersonalMixApprovalItem": {
        "type": "object",
        "description": "One pending personal-mix auto-request approval.",
        "required": [
          "user_id",
          "user_name",
          "requested_at"
        ],
        "properties": {
          "requested_at": {
            "type": "integer",
            "format": "int64",
            "description": "Epoch seconds when asked.",
            "minimum": 0
          },
          "user_id": {
            "type": "string",
            "description": "Requesting user id."
          },
          "user_name": {
            "type": "string",
            "description": "Requesting display name."
          }
        }
      },
      "PersonalMixApprovalsResponse": {
        "type": "object",
        "description": "Pending personal-mix approvals.",
        "required": [
          "items",
          "count",
          "granted"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32",
            "description": "Pending row count.",
            "minimum": 0
          },
          "granted": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonalMixApprovalItem"
            },
            "description": "Approvals already granted, which an admin may revoke."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PersonalMixApprovalItem"
            },
            "description": "Pending rows."
          }
        }
      },
      "PersonalMixRefreshed": {
        "type": "object",
        "description": "`personal_mix_refreshed`: the weekly mix build finished.",
        "required": [
          "track_count",
          "requested_albums",
          "skipped",
          "reason",
          "event_id"
        ],
        "properties": {
          "event_id": {
            "type": "string",
            "description": "Id for de-duplication."
          },
          "playlist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The mix playlist, when one was written."
          },
          "reason": {
            "type": "string",
            "description": "Why it was skipped (`no_tracks`, ...), empty otherwise."
          },
          "requested_albums": {
            "type": "integer",
            "format": "int32",
            "description": "Albums requested to fill it.",
            "minimum": 0
          },
          "skipped": {
            "type": "boolean",
            "description": "True when no mix was built."
          },
          "track_count": {
            "type": "integer",
            "format": "int32",
            "description": "Tracks in the mix.",
            "minimum": 0
          }
        }
      },
      "PhotoCredit": {
        "type": "object",
        "description": "Who made an artist's picture and under which licence. Plain text.",
        "required": [
          "file_url"
        ],
        "properties": {
          "author": {
            "type": [
              "string",
              "null"
            ],
            "description": "The author, when the source names one."
          },
          "file_url": {
            "type": "string",
            "description": "The picture's page at its source, http or https."
          },
          "licence": {
            "type": [
              "string",
              "null"
            ],
            "description": "The licence's short name, such as `CC BY-SA 4.0`."
          },
          "licence_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "The licence's page, http or https."
          }
        }
      },
      "PickRequest": {
        "type": "object",
        "description": "Pick one candidate.",
        "required": [
          "candidate_index"
        ],
        "properties": {
          "candidate_index": {
            "type": "integer",
            "description": "`candidate_index` of the candidate to download.",
            "minimum": 0
          },
          "confirm_policy_break": {
            "type": "boolean",
            "description": "Download it even though it is outside the download settings (its\n`refusal` is not empty). Without it such a pick answers 409."
          }
        }
      },
      "PickResponse": {
        "type": "object",
        "description": "The download a pick started.",
        "required": [
          "task_id"
        ],
        "properties": {
          "task_id": {
            "type": "string"
          }
        }
      },
      "PlaybackConversion": {
        "type": "object",
        "description": "Whether the web player's format asks are converted.",
        "required": [
          "conversion"
        ],
        "properties": {
          "conversion": {
            "$ref": "#/components/schemas/Conversion",
            "description": "On, turned off by an admin, or impossible without ffmpeg."
          }
        }
      },
      "PlaybackProgressRequest": {
        "type": "object",
        "description": "Heartbeat for a live session: keeps presence alive and the scrubber live.",
        "required": [
          "track_id"
        ],
        "properties": {
          "device": {
            "type": "string",
            "description": "Reporting device slug."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track length in milliseconds, when the player knows it."
          },
          "is_paused": {
            "type": "boolean",
            "description": "True while paused."
          },
          "position_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Position in milliseconds, when the player knows it."
          },
          "source": {
            "$ref": "#/components/schemas/PlaybackSource",
            "description": "Where the track plays from."
          },
          "track_id": {
            "type": "string",
            "description": "The library track id for `local` and `youtube`; for a media server,\nthat server's item id (the Plex rating key)."
          }
        }
      },
      "PlaybackProgressResponse": {
        "type": "object",
        "description": "Answer to a progress heartbeat.",
        "required": [
          "accepted"
        ],
        "properties": {
          "accepted": {
            "type": "boolean",
            "description": "Always true: reporting never fails the player."
          }
        }
      },
      "PlaybackSource": {
        "type": "string",
        "description": "Where a session's track plays from.",
        "enum": [
          "local",
          "youtube",
          "jellyfin",
          "navidrome",
          "plex"
        ]
      },
      "PlaybackStartRequest": {
        "type": "object",
        "description": "Open a playback session for one track.",
        "required": [
          "track_id"
        ],
        "properties": {
          "device": {
            "type": "string",
            "description": "Reporting device slug."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track length in milliseconds, when the player knows it."
          },
          "position_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Where playback starts in milliseconds, when not at the beginning (a\nresumed track). Read for media-server plays only."
          },
          "source": {
            "$ref": "#/components/schemas/PlaybackSource",
            "description": "Where the track plays from."
          },
          "track_id": {
            "type": "string",
            "description": "The library track id for `local` and `youtube`; for a media server,\nthat server's item id (the Plex rating key)."
          }
        }
      },
      "PlaybackStartResponse": {
        "type": "object",
        "description": "Answer to a session start.",
        "required": [
          "accepted",
          "session"
        ],
        "properties": {
          "accepted": {
            "type": "boolean",
            "description": "Always true: reporting never fails the player."
          },
          "session": {
            "type": "string",
            "description": "Session key (`user_id:device:track_id`), for log correlation."
          }
        }
      },
      "PlaybackStopRequest": {
        "type": "object",
        "description": "Close a session. A library play past the scrobble threshold counts.",
        "required": [
          "track_id"
        ],
        "properties": {
          "device": {
            "type": "string",
            "description": "Reporting device slug."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track length in milliseconds, when the player knows it."
          },
          "ignore_scrobble": {
            "type": "boolean",
            "description": "Skip the scrobble even past threshold (private session). A media\nserver counts a play by its own rule."
          },
          "position_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Final position in milliseconds, when the player knows it."
          },
          "source": {
            "$ref": "#/components/schemas/PlaybackSource",
            "description": "Where the track plays from."
          },
          "start_position_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Where this play started in milliseconds, for a resumed track; absent\nmeans the beginning. Read for media-server plays only."
          },
          "track_id": {
            "type": "string",
            "description": "The library track id for `local` and `youtube`; for a media server,\nthat server's item id (the Plex rating key)."
          }
        }
      },
      "PlaybackStopResponse": {
        "type": "object",
        "description": "Answer to a stop report.",
        "required": [
          "accepted",
          "scrobbled"
        ],
        "properties": {
          "accepted": {
            "type": "boolean",
            "description": "Always true: reporting never fails the player."
          },
          "scrobbled": {
            "type": "boolean",
            "description": "True when the play counted (history recorded, forwarding attempted).\nAlways false for a media-server play: the web player's scrobble\nsubmit records that one."
          }
        }
      },
      "PlaylistCollection": {
        "type": "object",
        "description": "Playlist list.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesPlaylistSummary"
            },
            "description": "Playlists."
          }
        }
      },
      "PlaylistDetail": {
        "type": "object",
        "description": "Full playlist detail: summary fields plus tracks.",
        "required": [
          "id",
          "name",
          "cover_urls",
          "tracks",
          "track_count",
          "created_at",
          "updated_at",
          "is_public",
          "is_owner",
          "is_shared",
          "can_edit",
          "can_delete",
          "is_redacted"
        ],
        "properties": {
          "can_delete": {
            "type": "boolean",
            "description": "True when the caller may delete it: its owner, or an admin when it\nhas no owner."
          },
          "can_edit": {
            "type": "boolean",
            "description": "True when the caller may change its songs: they own it, or it is\nshared with them to edit."
          },
          "cover_urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Up to four track covers for the header."
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time, epoch seconds.",
            "minimum": 0
          },
          "custom_cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom cover URL, when one was uploaded."
          },
          "id": {
            "type": "string",
            "description": "Playlist id."
          },
          "is_owner": {
            "type": "boolean",
            "description": "True when the caller owns the playlist."
          },
          "is_public": {
            "type": "boolean",
            "description": "Public playlists are visible to other users."
          },
          "is_redacted": {
            "type": "boolean",
            "description": "Always false on a full detail; true on redacted rows."
          },
          "is_shared": {
            "type": "boolean",
            "description": "True when the caller owns the playlist and shares it with chosen\npeople."
          },
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "owner_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owner display name."
          },
          "source_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import provenance (`<source>:<id>`), when the playlist was imported."
          },
          "total_duration": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Total duration in seconds, when any track reports one."
          },
          "track_count": {
            "type": "integer",
            "description": "Track count.",
            "minimum": 0
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaylistTrack"
            },
            "description": "Tracks in position order."
          },
          "updated_at": {
            "type": "integer",
            "format": "int64",
            "description": "Last mutation time, epoch seconds.",
            "minimum": 0
          }
        }
      },
      "PlaylistImported": {
        "type": "object",
        "description": "`playlist_imported`: an imported playlist has its tracks.",
        "required": [
          "playlist_id",
          "event_id"
        ],
        "properties": {
          "event_id": {
            "type": "string",
            "description": "Id for de-duplication."
          },
          "playlist_id": {
            "type": "string",
            "description": "The filled playlist."
          }
        }
      },
      "PlaylistListItem": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PlaylistSummary",
            "description": "Full summary for owned and public playlists."
          },
          {
            "$ref": "#/components/schemas/RedactedPlaylist",
            "description": "Redacted stub for other users' private playlists."
          }
        ],
        "description": "One row of the playlist list: a full summary or a redacted stub."
      },
      "PlaylistListResponse": {
        "type": "object",
        "description": "Playlist list answer.",
        "required": [
          "playlists"
        ],
        "properties": {
          "playlists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaylistListItem"
            },
            "description": "Playlists visible to the caller."
          }
        }
      },
      "PlaylistMember": {
        "type": "object",
        "description": "One person a playlist is shared with.",
        "required": [
          "user_id",
          "display_name",
          "can_edit"
        ],
        "properties": {
          "can_edit": {
            "type": "boolean",
            "description": "True when they may change its songs."
          },
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "user_id": {
            "type": "string",
            "description": "User id."
          }
        }
      },
      "PlaylistProfile": {
        "type": "object",
        "description": "Taste profile behind playlist suggestions.",
        "properties": {
          "artist_mbids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Artist mbids the playlist leans on."
          },
          "genre_distribution": {
            "type": "object",
            "description": "Genres per artist MBID on the playlist, from the library.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Playlist track count."
          }
        }
      },
      "PlaylistSuggestionsRequest": {
        "type": "object",
        "description": "Body requesting playlist suggestions.",
        "required": [
          "playlist_id"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "Wanted suggestion count."
          },
          "playlist_id": {
            "type": "string",
            "description": "Playlist to extend."
          },
          "source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ListenSource"
              }
            ],
            "description": "Provider preference."
          }
        }
      },
      "PlaylistSuggestionsResponse": {
        "type": "object",
        "description": "Suggested rows for a playlist.",
        "required": [
          "suggestions",
          "playlist_id",
          "profile"
        ],
        "properties": {
          "playlist_id": {
            "type": "string",
            "description": "Playlist the suggestions extend."
          },
          "profile": {
            "$ref": "#/components/schemas/PlaylistProfile",
            "description": "Taste profile behind the suggestions."
          },
          "suggestions": {
            "$ref": "#/components/schemas/ChartSection",
            "description": "Suggestions shelf."
          }
        }
      },
      "PlaylistSummary": {
        "type": "object",
        "description": "Playlist summary for lists and visibility answers.",
        "required": [
          "id",
          "name",
          "track_count",
          "cover_urls",
          "created_at",
          "updated_at",
          "is_public",
          "is_owner",
          "is_shared",
          "can_edit",
          "can_delete",
          "is_redacted"
        ],
        "properties": {
          "can_delete": {
            "type": "boolean",
            "description": "True when the caller may delete it: its owner, or an admin when it\nhas no owner."
          },
          "can_edit": {
            "type": "boolean",
            "description": "True when the caller may change its songs: they own it, or it is\nshared with them to edit."
          },
          "cover_urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Up to four track covers for the list tile."
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time, epoch seconds.",
            "minimum": 0
          },
          "custom_cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom cover URL, when one was uploaded."
          },
          "id": {
            "type": "string",
            "description": "Playlist id."
          },
          "is_owner": {
            "type": "boolean",
            "description": "True when the caller owns the playlist."
          },
          "is_public": {
            "type": "boolean",
            "description": "Public playlists are visible to other users."
          },
          "is_redacted": {
            "type": "boolean",
            "description": "Always false on a full summary; true on redacted rows."
          },
          "is_shared": {
            "type": "boolean",
            "description": "True when the caller owns the playlist and shares it with chosen\npeople."
          },
          "name": {
            "type": "string",
            "description": "Display name."
          },
          "owner_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owner display name."
          },
          "source_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Import provenance (`<source>:<id>`), when the playlist was imported."
          },
          "total_duration": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Total duration in seconds, when any track reports one."
          },
          "track_count": {
            "type": "integer",
            "description": "Track count.",
            "minimum": 0
          },
          "updated_at": {
            "type": "integer",
            "format": "int64",
            "description": "Last mutation time, epoch seconds.",
            "minimum": 0
          }
        }
      },
      "PlaylistSyncResult": {
        "type": "object",
        "description": "Sync report, field for field with the v2 result shape.",
        "required": [
          "success",
          "message",
          "written",
          "unchanged",
          "removed",
          "removal_failures",
          "skipped_empty",
          "skipped_not_ours",
          "tracks_missing_files",
          "tracks_unrepresentable"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human summary of the run."
          },
          "removal_failures": {
            "type": "integer",
            "format": "int64",
            "description": "Superseded files that could not be removed (retried next cycle).",
            "minimum": 0
          },
          "removed": {
            "type": "integer",
            "format": "int64",
            "description": "Superseded files removed.",
            "minimum": 0
          },
          "skipped_empty": {
            "type": "integer",
            "format": "int64",
            "description": "Playlists skipped for having no tracks.",
            "minimum": 0
          },
          "skipped_not_ours": {
            "type": "integer",
            "format": "int64",
            "description": "Files in the directory that are not ours and were left alone.",
            "minimum": 0
          },
          "success": {
            "type": "boolean",
            "description": "False when nothing synced (disabled, or the exporter refused)."
          },
          "tracks_missing_files": {
            "type": "integer",
            "format": "int64",
            "description": "Tracks skipped for missing audio files.",
            "minimum": 0
          },
          "tracks_unrepresentable": {
            "type": "integer",
            "format": "int64",
            "description": "Tracks skipped for paths the export format cannot represent.",
            "minimum": 0
          },
          "unchanged": {
            "type": "integer",
            "format": "int64",
            "description": "Files already current and left alone.",
            "minimum": 0
          },
          "written": {
            "type": "integer",
            "format": "int64",
            "description": "Files written or updated.",
            "minimum": 0
          }
        }
      },
      "PlaylistTrack": {
        "type": "object",
        "description": "One track inside a playlist.",
        "required": [
          "id",
          "position",
          "track_name",
          "artist_name",
          "album_name",
          "source_type",
          "created_at"
        ],
        "properties": {
          "album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album id, when the track resolved to the library."
          },
          "album_name": {
            "type": "string",
            "description": "Album name."
          },
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist id, when resolved."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "available_sources": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Sources carrying this track, when known."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover art address, when known: one of DroppedNeedle's own cover\nroutes, root-relative, or an https image on Spotify, Deezer, Last.fm,\nTheAudioDB or YouTube. Any other stored address reads as null."
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Row creation time, epoch seconds.",
            "minimum": 0
          },
          "disc_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Disc number, when known."
          },
          "duration": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Duration in seconds, when known."
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Audio format, when known."
          },
          "id": {
            "type": "string",
            "description": "Track row id."
          },
          "library_file_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Local library file id, when the track resolved locally."
          },
          "plex_rating_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plex rating key, when the track came from Plex."
          },
          "position": {
            "type": "integer",
            "description": "Zero-based position in the playlist.",
            "minimum": 0
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The MusicBrainz recording `source_type` gave for this entry, when\nknown."
          },
          "source_type": {
            "type": "string",
            "description": "Preferred source type, empty when unresolved."
          },
          "track_name": {
            "type": "string",
            "description": "Track title."
          },
          "track_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Track number, when known."
          },
          "track_source_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Library track source id, when resolved."
          }
        }
      },
      "PlexConnectPollResult": {
        "type": "object",
        "description": "Settings-completion poll answer: the raw auth token, untouched.",
        "required": [
          "completed"
        ],
        "properties": {
          "auth_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "Present only when completed."
          },
          "completed": {
            "type": "boolean",
            "description": "True once the user authorized the PIN."
          }
        }
      },
      "PlexConnection": {
        "type": "object",
        "description": "Plex connection.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "login_enabled": {
            "type": "boolean",
            "description": "Plex login switch.",
            "default": false
          },
          "music_library_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Music library ids.",
            "default": []
          },
          "plex_token": {
            "type": "string",
            "description": "Plex token (encrypted at rest).",
            "default": ""
          },
          "plex_url": {
            "type": "string",
            "description": "Plex base URL.",
            "default": ""
          }
        }
      },
      "PlexLibrarySectionInfo": {
        "type": "object",
        "description": "One Plex music-library section.",
        "required": [
          "key",
          "title"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "Section key."
          },
          "title": {
            "type": "string",
            "description": "Section title."
          }
        }
      },
      "PlexLinkPollResult": {
        "type": "object",
        "description": "Link-completion poll answer. The link itself is stored server-side; the\naccount tokens never reach the browser.",
        "required": [
          "completed"
        ],
        "properties": {
          "completed": {
            "type": "boolean",
            "description": "True once the user authorized the PIN and the link is stored."
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "description": "The linked Plex user name; present only when completed."
          }
        }
      },
      "PlexLoginPollBody": {
        "type": "object",
        "description": "Login-completion poll body.",
        "required": [
          "pin_id",
          "pin_secret"
        ],
        "properties": {
          "pin_id": {
            "type": "integer",
            "format": "int64",
            "description": "PIN id from the start step."
          },
          "pin_secret": {
            "type": "string",
            "description": "Secret from the start step."
          },
          "transport": {
            "$ref": "#/components/schemas/TransportDto",
            "description": "Credential handoff; defaults to cookie."
          }
        }
      },
      "PlexLoginPollResult": {
        "type": "object",
        "description": "Login-completion poll answer. Pending carries only the flag; a completed\npoll carries the user (plus the token in Bearer mode, or the session cookie\nin cookie mode, like every login).",
        "required": [
          "completed"
        ],
        "properties": {
          "completed": {
            "type": "boolean",
            "description": "True once the user authorized the PIN."
          },
          "token": {
            "type": [
              "string",
              "null"
            ],
            "description": "Present only when completed in Bearer mode."
          },
          "user": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FederatedUserView"
              }
            ],
            "description": "Present only when completed."
          }
        }
      },
      "PlexPinBody": {
        "type": "object",
        "description": "One PIN to poll.",
        "required": [
          "pin_id",
          "pin_secret"
        ],
        "properties": {
          "pin_id": {
            "type": "integer",
            "format": "int64",
            "description": "PIN id from the start step."
          },
          "pin_secret": {
            "type": "string",
            "description": "Secret from the start step."
          }
        }
      },
      "PlexStartBody": {
        "type": "object",
        "description": "Plex journey start answer.",
        "required": [
          "pin_id",
          "authorize_url",
          "pin_secret"
        ],
        "properties": {
          "authorize_url": {
            "type": "string",
            "description": "`app.plex.tv` URL the user authorizes at."
          },
          "pin_id": {
            "type": "integer",
            "format": "int64",
            "description": "PIN id for the poll steps."
          },
          "pin_secret": {
            "type": "string",
            "description": "Proof that the poller started this PIN. Shown once; send it with\nevery poll. Keep it in memory, never in a URL."
          }
        }
      },
      "PlexVerifyResponse": {
        "type": "object",
        "description": "Plex verify verdict, with music libraries on success.",
        "required": [
          "valid",
          "message",
          "libraries"
        ],
        "properties": {
          "libraries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlexLibrarySectionInfo"
            },
            "description": "Music libraries (empty unless the probe succeeded)."
          },
          "message": {
            "type": "string",
            "description": "Human summary."
          },
          "valid": {
            "type": "boolean",
            "description": "Whether the connection checked out."
          }
        }
      },
      "PluginCapability": {
        "type": "string",
        "description": "What a plugin may declare it does.",
        "enum": [
          "scrobbler",
          "purchase_links",
          "download_client",
          "indexer",
          "subscriber",
          "publisher",
          "metadata_provider",
          "scheduler",
          "streaming_source",
          "library_writer"
        ]
      },
      "PluginDetails": {
        "type": "object",
        "description": "`GET /albums/{album_id}/plugin-details`: what metadata plugins add\nabout an album. Each field is the first plugin's answer (plugins asked\nin name order); links and tags gather every plugin's, without repeats.\nThe page shows these below its own sources and only fills gaps.",
        "required": [
          "links",
          "tags"
        ],
        "properties": {
          "biography": {
            "type": [
              "string",
              "null"
            ],
            "description": "Notes or biography."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Image (`http(s)` only)."
          },
          "links": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "External links (`http(s)` only)."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tags or genres."
          }
        }
      },
      "PluginFileState": {
        "type": "string",
        "description": "Whether a plugin's file is still in the library.",
        "enum": [
          "added",
          "taken_back"
        ]
      },
      "PluginFileView": {
        "type": "object",
        "description": "One file a plugin added to the library.",
        "required": [
          "bundle_id",
          "root_id",
          "relative_path",
          "size",
          "added_at",
          "state"
        ],
        "properties": {
          "added_at": {
            "type": "integer",
            "format": "int64",
            "description": "When it was added, in unix milliseconds."
          },
          "bundle_id": {
            "type": "string",
            "description": "The change that added it; undo it to take the file back."
          },
          "relative_path": {
            "type": "string",
            "description": "Path under the library folder."
          },
          "root_id": {
            "type": "string",
            "description": "Library folder id."
          },
          "size": {
            "type": "integer",
            "format": "int64",
            "description": "Size in bytes.",
            "minimum": 0
          },
          "state": {
            "$ref": "#/components/schemas/PluginFileState"
          }
        }
      },
      "PluginHealth": {
        "type": "object",
        "description": "One plugin's answer to `plugin.health`.",
        "required": [
          "status",
          "configured"
        ],
        "properties": {
          "configured": {
            "type": "boolean",
            "description": "Whether it has the settings it needs."
          },
          "message": {
            "type": "string",
            "description": "Detail for the admin."
          },
          "status": {
            "$ref": "#/components/schemas/PluginHealthStatus",
            "description": "Whether it works."
          }
        }
      },
      "PluginHealthStatus": {
        "type": "string",
        "description": "What a plugin says about itself.",
        "enum": [
          "ok",
          "error"
        ]
      },
      "PluginInfo": {
        "type": "object",
        "description": "One plugin as the admin UI sees it.",
        "required": [
          "name",
          "display_name",
          "version",
          "enabled"
        ],
        "properties": {
          "active_capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PluginCapability"
            },
            "description": "Declared capabilities the server sends calls for while the plugin is\nenabled."
          },
          "author": {
            "type": "string",
            "description": "Author string."
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PluginCapability"
            },
            "description": "Declared capabilities."
          },
          "description": {
            "type": "string",
            "description": "Short description."
          },
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether the plugin is enabled and loaded."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Load failure, when present."
          },
          "homepage": {
            "type": "string",
            "description": "Homepage URL."
          },
          "install": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PluginInstallInfo"
              }
            ],
            "description": "Where the plugin was installed from, when it came from GitHub."
          },
          "name": {
            "type": "string",
            "description": "Manifest name."
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the plugin asks to do, in plain words."
          },
          "runtime": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PluginRuntimeInfo"
              }
            ],
            "description": "The running process, while enabled."
          },
          "settings_fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PluginSettingFieldInfo"
            },
            "description": "Declared settings fields."
          },
          "settings_values": {
            "type": "object",
            "description": "Current settings values (secrets masked).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Declared download-client sources."
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Declared indexer targets."
          },
          "ui_entry": {
            "type": "string",
            "description": "Panel bundle path, when the plugin ships UI."
          },
          "ui_external_url": {
            "type": "string",
            "description": "External panel URL."
          },
          "ui_pages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Panel page ids."
          },
          "version": {
            "type": "string",
            "description": "Plugin version."
          }
        }
      },
      "PluginInstallInfo": {
        "type": "object",
        "description": "The pinned GitHub source of one installed plugin.",
        "required": [
          "repository_url",
          "repository",
          "ref_kind",
          "reference",
          "commit",
          "installed_at"
        ],
        "properties": {
          "commit": {
            "type": "string",
            "description": "The exact commit installed."
          },
          "installed_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix seconds."
          },
          "ref_kind": {
            "$ref": "#/components/schemas/PluginRefKind",
            "description": "What the install follows."
          },
          "reference": {
            "type": "string",
            "description": "The release tag, tag, branch or commit asked for."
          },
          "repository": {
            "type": "string",
            "description": "`owner/repo`."
          },
          "repository_url": {
            "type": "string",
            "description": "The URL the admin gave."
          }
        }
      },
      "PluginInstallPreview": {
        "type": "object",
        "description": "What an install would bring in, shown before anything is written.",
        "required": [
          "name",
          "display_name",
          "version",
          "capabilities",
          "permissions",
          "repository",
          "ref_kind",
          "reference",
          "commit",
          "warning"
        ],
        "properties": {
          "author": {
            "type": "string",
            "description": "Author string."
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PluginCapability"
            },
            "description": "Declared capabilities."
          },
          "commit": {
            "type": "string",
            "description": "The exact commit that will be installed. Send it back to install\nexactly this code."
          },
          "description": {
            "type": "string",
            "description": "Short description."
          },
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "homepage": {
            "type": "string",
            "description": "Homepage URL."
          },
          "installed_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Version already installed under the same name, when any."
          },
          "name": {
            "type": "string",
            "description": "Manifest name."
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the plugin asks to do, in plain words."
          },
          "ref_kind": {
            "$ref": "#/components/schemas/PluginRefKind",
            "description": "What the install follows."
          },
          "reference": {
            "type": "string",
            "description": "The release tag, tag, branch or commit."
          },
          "repository": {
            "type": "string",
            "description": "`owner/repo`."
          },
          "version": {
            "type": "string",
            "description": "Plugin version."
          },
          "warning": {
            "type": "string",
            "description": "The plain trust warning to show the admin."
          }
        }
      },
      "PluginInstallRequest": {
        "type": "object",
        "description": "Install request: one public GitHub repository URL, optionally pinned.",
        "required": [
          "repository_url"
        ],
        "properties": {
          "commit": {
            "type": [
              "string",
              "null"
            ],
            "description": "The exact commit from a preview. When set, exactly that commit\ninstalls, whatever the ref points at by now."
          },
          "ref_kind": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PluginRefKind"
              }
            ],
            "description": "What the preview's `reference` is. Sent with `reference` and `commit`,\nso a plain URL need not be resolved a second time."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "A release tag, tag, branch or commit; overrides any in the URL.\nWith `ref_kind`, the reference a preview showed for this URL."
          },
          "repository_url": {
            "type": "string",
            "description": "Repository URL, e.g. `https://github.com/owner/repo` (latest\nrelease), `.../releases/tag/v1.0.0`, `.../tree/<ref>` or\n`.../commit/<sha>`."
          }
        }
      },
      "PluginListResponse": {
        "type": "object",
        "description": "Plugin listing.",
        "required": [
          "plugins"
        ],
        "properties": {
          "plugins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PluginInfo"
            },
            "description": "Every discovered plugin."
          }
        }
      },
      "PluginRefKind": {
        "type": "string",
        "description": "What an install was asked to follow.",
        "enum": [
          "release",
          "tag",
          "branch",
          "commit"
        ]
      },
      "PluginRuntimeInfo": {
        "type": "object",
        "description": "Health of one enabled plugin's process.",
        "required": [
          "state",
          "restarts"
        ],
        "properties": {
          "dropped_events": {
            "type": "integer",
            "format": "int64",
            "description": "Events skipped because the plugin was still busy with the last one.",
            "minimum": 0
          },
          "health": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PluginHealth"
              }
            ],
            "description": "The plugin's own answer to its health check in this run; absent\nuntil it has answered."
          },
          "implemented_capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Capabilities the plugin said it implements."
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last start failure, crash or protocol problem."
          },
          "library_refusal": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the plugin's last library write was refused. Cleared when a\nwrite lands, the plugin is switched off or removed, or the server\nrestarts."
          },
          "restarts": {
            "type": "integer",
            "format": "int64",
            "description": "Restarts since it was enabled.",
            "minimum": 0
          },
          "state": {
            "$ref": "#/components/schemas/PluginRuntimeState",
            "description": "`starting`, `running`, `restarting`, `stopped` or `failed`."
          }
        }
      },
      "PluginRuntimeState": {
        "type": "string",
        "description": "Where a plugin's runtime is in its life.",
        "enum": [
          "starting",
          "running",
          "restarting",
          "stopped",
          "failed"
        ]
      },
      "PluginSettingFieldInfo": {
        "type": "object",
        "description": "One settings field a plugin declares.",
        "required": [
          "key",
          "label"
        ],
        "properties": {
          "help": {
            "type": "string",
            "description": "Help text."
          },
          "key": {
            "type": "string",
            "description": "Setting key."
          },
          "label": {
            "type": "string",
            "description": "Display label."
          },
          "secret": {
            "type": "boolean",
            "description": "Whether the value is secret (masked on read, encrypted at rest)."
          }
        }
      },
      "PluginSource": {
        "type": "object",
        "description": "One enabled plugin acquisition source.",
        "required": [
          "key",
          "health"
        ],
        "properties": {
          "configured": {
            "type": "boolean",
            "description": "Whether the plugin says it has the settings it needs."
          },
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "has_client": {
            "type": "boolean",
            "description": "Whether the plugin serves downloads for this source."
          },
          "has_indexer": {
            "type": "boolean",
            "description": "Whether the plugin serves searches for this source."
          },
          "health": {
            "$ref": "#/components/schemas/PluginSourceHealth",
            "description": "Health of the source."
          },
          "health_message": {
            "type": "string",
            "description": "The plugin's own health message, when it gave one."
          },
          "key": {
            "type": "string",
            "description": "Source key (`plugin:<name>` or `usenet`)."
          },
          "plugin": {
            "type": "string",
            "description": "Owning plugin name."
          },
          "target_source": {
            "type": "string",
            "description": "Indexer target source."
          }
        }
      },
      "PluginSourceHealth": {
        "type": "string",
        "description": "Health of one plugin source.",
        "enum": [
          "ok",
          "degraded",
          "error",
          "unknown"
        ]
      },
      "PluginSourceUpdateRequest": {
        "type": "object",
        "description": "Update an installed plugin from its GitHub source.",
        "properties": {
          "commit": {
            "type": [
              "string",
              "null"
            ],
            "description": "The exact commit the admin expects (from a preview). When set and\nthe source now resolves elsewhere, the update stops with 409."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "A release tag, tag, branch or commit to move to. Without one, a\nplugin installed from releases moves to the latest release, one\ninstalled from a branch moves to the branch tip, and one pinned to a\ntag or commit stays."
          }
        }
      },
      "PluginSourceUpdateResponse": {
        "type": "object",
        "description": "Outcome of an update from GitHub.",
        "required": [
          "updated",
          "plugin"
        ],
        "properties": {
          "plugin": {
            "$ref": "#/components/schemas/PluginInfo",
            "description": "The plugin after the update."
          },
          "updated": {
            "type": "boolean",
            "description": "False when the plugin was already at that commit."
          }
        }
      },
      "PluginSourcesResponse": {
        "type": "object",
        "description": "Plugin source listing.",
        "required": [
          "sources"
        ],
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PluginSource"
            },
            "description": "Enabled acquisition sources."
          }
        }
      },
      "PluginUpdateRequest": {
        "type": "object",
        "description": "Enable switch plus settings save. A secret field sent back as the mask\nkeeps its stored value.",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "New enable switch."
          },
          "settings": {
            "type": "object",
            "description": "New settings values.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "PolicyNodeKind": {
        "type": "string",
        "description": "Which kind of scope a policy-tree node stands for.",
        "enum": [
          "root",
          "rule"
        ]
      },
      "PrecacheRunResponse": {
        "type": "object",
        "description": "One precache run starting. The run continues in the background under\nthe `precache-library` job name; a second start while it is live is 409.",
        "required": [
          "job",
          "status"
        ],
        "properties": {
          "job": {
            "type": "string",
            "description": "Registered job name of the run."
          },
          "status": {
            "type": "string",
            "description": "`started`."
          }
        }
      },
      "PreparationCreateBody": {
        "type": "object",
        "description": "Start an identity preparation.",
        "required": [
          "idempotency_key"
        ],
        "properties": {
          "idempotency_key": {
            "type": "string",
            "description": "Makes a retried request return the same job."
          },
          "root_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Library roots to prepare; none means every root."
          }
        }
      },
      "PreparationEstimateView": {
        "type": "object",
        "description": "Where the albums Library Management may touch stand today.",
        "required": [
          "album_count",
          "ready_album_count",
          "mapping_required_count",
          "exact_release_required_count",
          "selected_root_count",
          "queued_preparation_count"
        ],
        "properties": {
          "album_count": {
            "type": "integer",
            "format": "int64"
          },
          "exact_release_required_count": {
            "type": "integer",
            "format": "int64"
          },
          "mapping_required_count": {
            "type": "integer",
            "format": "int64"
          },
          "queued_preparation_count": {
            "type": "integer",
            "format": "int64"
          },
          "ready_album_count": {
            "type": "integer",
            "format": "int64"
          },
          "selected_root_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "PreviewStatus": {
        "type": "string",
        "description": "Whether a queue card's YouTube preview was found.",
        "enum": [
          "available",
          "not_found",
          "unavailable"
        ]
      },
      "PreviewTrackItem": {
        "type": "object",
        "description": "One previewed track.",
        "required": [
          "title",
          "artist_name",
          "preview_url"
        ],
        "properties": {
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "duration_s": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Preview length in seconds, when known."
          },
          "position": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Album position, when known."
          },
          "preview_url": {
            "type": "string",
            "description": "Preview audio URL (short-lived, never long-cached)."
          },
          "title": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "ProfileNotificationSettings": {
        "type": "object",
        "description": "Post-publish notifications.",
        "properties": {
          "refresh_external_servers": {
            "type": "boolean",
            "description": "Refresh external servers.",
            "default": false
          }
        }
      },
      "ProfileResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/UserResponse",
            "description": "The account."
          }
        ],
        "description": "Own profile. Identity only; connected services and library stats belong\nto the connections and library routes."
      },
      "PromptService": {
        "type": "string",
        "description": "A service a connect-a-service card points at.",
        "enum": [
          "listenbrainz",
          "lastfm",
          "jellyfin",
          "download-client"
        ]
      },
      "ProofSubject": {
        "type": "string",
        "description": "What a credit proof is for: an album credit or a track credit.",
        "enum": [
          "album",
          "track"
        ]
      },
      "ProviderCallsView": {
        "type": "object",
        "description": "The calls one rate row sent at one priority that ended one way, since\nthe server started.",
        "required": [
          "source",
          "priority",
          "outcome",
          "calls",
          "calls_last_minute",
          "body_bytes"
        ],
        "properties": {
          "body_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Answer body bytes read, headers excluded.",
            "minimum": 0
          },
          "calls": {
            "type": "integer",
            "format": "int64",
            "description": "Calls sent, retries included.",
            "minimum": 0
          },
          "calls_last_minute": {
            "type": "integer",
            "format": "int64",
            "description": "Calls sent in the last minute.",
            "minimum": 0
          },
          "outcome": {
            "$ref": "#/components/schemas/CallOutcome",
            "description": "What came back."
          },
          "priority": {
            "$ref": "#/components/schemas/RequestPriority",
            "description": "How urgent the callers were."
          },
          "source": {
            "type": "string",
            "description": "Rate row name, as in the limiter rows, e.g. `musicbrainz`."
          }
        }
      },
      "ProviderChoiceBody": {
        "type": "string",
        "description": "What the surviving artist keeps when the merged artists name different\nMusicBrainz artists.",
        "enum": [
          "detach",
          "retain_survivor"
        ]
      },
      "ProviderDataSource": {
        "type": "string",
        "description": "Where a cached answer came from. Every key starts with one.",
        "enum": [
          "musicbrainz",
          "listenbrainz",
          "lastfm",
          "audiodb",
          "wikidata",
          "purchase",
          "plugins",
          "youtube",
          "lrclib",
          "previews"
        ]
      },
      "ProviderLimiterView": {
        "type": "object",
        "description": "One provider's limiter posture.",
        "required": [
          "source",
          "per_second",
          "burst",
          "remaining"
        ],
        "properties": {
          "burst": {
            "type": "integer",
            "format": "int32",
            "description": "Bucket capacity.",
            "minimum": 0
          },
          "per_second": {
            "type": "number",
            "format": "double",
            "description": "Sustained tokens per second."
          },
          "remaining": {
            "type": "integer",
            "format": "int32",
            "description": "Whole tokens currently available.",
            "minimum": 0
          },
          "source": {
            "type": "string",
            "description": "Provider name, e.g. `musicbrainz`."
          }
        }
      },
      "ProviderSourceStats": {
        "type": "object",
        "description": "What one provider holds in the cache file.",
        "required": [
          "source",
          "rows",
          "bytes"
        ],
        "properties": {
          "bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Their size in bytes.",
            "minimum": 0
          },
          "rows": {
            "type": "integer",
            "format": "int64",
            "description": "Answers held.",
            "minimum": 0
          },
          "source": {
            "$ref": "#/components/schemas/ProviderDataSource",
            "description": "The provider."
          }
        }
      },
      "ProviderStatsResponse": {
        "type": "object",
        "description": "Provider limiters and the outbound calls counted since start.",
        "required": [
          "limiters",
          "calls"
        ],
        "properties": {
          "calls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderCallsView"
            },
            "description": "Call counts per rate row, priority and outcome, in row order."
          },
          "limiters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderLimiterView"
            },
            "description": "Limiter posture per rate row, in name order."
          }
        }
      },
      "ProwlarrConnection": {
        "type": "object",
        "description": "Single Prowlarr connection (Prowlarr multiplexes its own indexers).",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "API key (encrypted at rest).",
            "default": ""
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "url": {
            "type": "string",
            "description": "Prowlarr base URL (LAN service, `http://` default).",
            "default": ""
          }
        }
      },
      "ProwlarrTestResponse": {
        "type": "object",
        "description": "Prowlarr test verdict: validity plus version and member-indexer count.",
        "required": [
          "valid",
          "message"
        ],
        "properties": {
          "indexer_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Enabled member indexers, when listed."
          },
          "message": {
            "type": "string",
            "description": "Human summary."
          },
          "valid": {
            "type": "boolean",
            "description": "Whether the submitted values checked out."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Server version, when known."
          }
        }
      },
      "PublicAddress": {
        "type": "object",
        "description": "The addresses at which this DroppedNeedle is served, for a deployment\nwhose reverse proxy leaves the server with the wrong idea of its own\naddress. The session origin check accepts a change from a page at one of\nthem, on top of the address it works out for itself.\n\nA section of its own, so that saving another one can never empty it.\n`origins` has no default for the same reason: a save that misspells the\nfield is refused, where a default would store an empty list. A settings\nfile with no such section still reads as the empty list.",
        "required": [
          "origins"
        ],
        "properties": {
          "origins": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Up to eight origins such as `https://music.example.com` or\n`http://192.168.1.5:8688`: scheme, host and optional port, no path.\nStored the way a browser sends `Origin`."
          }
        }
      },
      "PublishOutcome": {
        "type": "string",
        "description": "Outcome of one bundle publication.",
        "enum": [
          "committed",
          "cleanup_pending"
        ]
      },
      "PurchaseKind": {
        "type": "string",
        "description": "What kind of purchase a link offers.",
        "enum": [
          "digital",
          "physical",
          "free"
        ]
      },
      "PurchaseLink": {
        "type": "object",
        "description": "One \"where to buy\" link.",
        "required": [
          "store",
          "label",
          "url",
          "kind"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/PurchaseKind",
            "description": "Digital, physical or free."
          },
          "label": {
            "type": "string",
            "description": "Display name, or the bare domain for unknown stores."
          },
          "store": {
            "type": "string",
            "description": "Store key (`bandcamp`, `qobuz`, `itunes`, `amazon`, ..., `other`)."
          },
          "url": {
            "type": "string",
            "description": "Store page."
          }
        }
      },
      "PurchaseOptionsResponse": {
        "type": "object",
        "description": "`GET /albums/{album_id}/purchase-options`. Bandcamp sorts first, then\nspecialist stores, then the large storefronts.",
        "required": [
          "digital",
          "physical",
          "free",
          "bandcamp_search_url"
        ],
        "properties": {
          "bandcamp_search_url": {
            "type": "string",
            "description": "Bandcamp search for the album, always present as the fallback."
          },
          "digital": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchaseLink"
            },
            "description": "Download stores."
          },
          "free": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchaseLink"
            },
            "description": "Free downloads."
          },
          "physical": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PurchaseLink"
            },
            "description": "Mail-order stores."
          }
        }
      },
      "Purpose": {
        "type": "string",
        "description": "What a repair job checks, in `library_repair_snapshots.purpose`\nwith v2's names.",
        "enum": [
          "existing_matches",
          "management_readiness",
          "catalog_identity_hygiene",
          "play_history_filing"
        ]
      },
      "PutBackView": {
        "type": "object",
        "description": "What a put-back did not bring back.",
        "required": [
          "missing"
        ],
        "properties": {
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Files that were not put back because their copy is gone from the\nrecycle bin or changed there, as paths inside their library folder.\nEmpty when every file went back."
          }
        }
      },
      "QualityRecipeEntry": {
        "type": "object",
        "description": "One ordered, closed format-quality recipe entry. Unknown keys are\nrejected at decode so a future setting cannot silently become a\ndifferent recipe.",
        "required": [
          "format",
          "quality"
        ],
        "properties": {
          "bit_depth": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Custom FLAC bit depth."
          },
          "format": {
            "$ref": "#/components/schemas/RecipeFormat",
            "description": "Container."
          },
          "max_bitrate_kbps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Custom MP3 upper bound (`None` when open-ended), or canonical."
          },
          "min_bitrate_kbps": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Custom MP3 lower bound, or canonical standard bound."
          },
          "quality": {
            "$ref": "#/components/schemas/RecipeQuality",
            "description": "Quality id: one of the format's own, or `custom`."
          },
          "sample_rate_hz": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Custom FLAC sample rate."
          }
        },
        "additionalProperties": false
      },
      "QualityRecipeStatus": {
        "type": "string",
        "description": "How the stored quality settings read.",
        "enum": [
          "valid",
          "invalid"
        ]
      },
      "QuarantineEntry": {
        "type": "object",
        "description": "One blocklisted release.",
        "required": [
          "id",
          "source",
          "client_id",
          "username",
          "filename",
          "identity",
          "reason",
          "reason_text",
          "quarantined_at"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "description": "The client label: `slskd`, `sabnzbd`, or the source for plugins."
          },
          "detail": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the check found, when it was recorded."
          },
          "filename": {
            "type": "string",
            "description": "The blocked file (soulseek) or job (usenet)."
          },
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "identity": {
            "type": "string",
            "description": "The stored identity, as matched."
          },
          "quarantined_at": {
            "type": "number",
            "format": "double"
          },
          "reason": {
            "type": "string",
            "description": "Stable reason code."
          },
          "reason_code": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Reason"
              }
            ],
            "description": "The check that blocklisted it; null on entries from before it was\nrecorded."
          },
          "reason_text": {
            "type": "string",
            "description": "The reason as a plain sentence: the check's when it is recorded."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "description": "`soulseek`, `usenet` or `plugin:<key>`."
          },
          "username": {
            "type": "string",
            "description": "Soulseek peer, empty for other sources."
          }
        }
      },
      "QuarantineListResponse": {
        "type": "object",
        "description": "One page of the blocklist.",
        "required": [
          "items",
          "page"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuarantineEntry"
            }
          },
          "page": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "QueueAction": {
        "type": "string",
        "description": "What a generate trigger did.",
        "enum": [
          "started",
          "already_building",
          "already_ready",
          "disabled"
        ]
      },
      "QueueBuildStatus": {
        "type": "string",
        "description": "Where one user's queue build stands.",
        "enum": [
          "idle",
          "building",
          "ready",
          "error"
        ]
      },
      "QueueDepthView": {
        "type": "object",
        "description": "How deep one job kind's queue is.",
        "required": [
          "kind",
          "queued",
          "running",
          "failed"
        ],
        "properties": {
          "failed": {
            "type": "integer",
            "format": "int64",
            "description": "Jobs that failed for good and are still kept.",
            "minimum": 0
          },
          "kind": {
            "type": "string",
            "description": "Job kind, such as `scrobble.lastfm`."
          },
          "queued": {
            "type": "integer",
            "format": "int64",
            "description": "Jobs waiting to run.",
            "minimum": 0
          },
          "running": {
            "type": "integer",
            "format": "int64",
            "description": "Jobs running now.",
            "minimum": 0
          }
        }
      },
      "QueueEnrichment": {
        "type": "object",
        "description": "Enrichment behind one queue card.",
        "required": [
          "tags",
          "youtube_search_url",
          "youtube_search_available"
        ],
        "properties": {
          "artist_description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist biography snippet, when known."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz artist id, when known."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release country, when known."
          },
          "listen_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Artist listen count, when known."
          },
          "release_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release date, when known."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Genre/style tags."
          },
          "youtube_search_available": {
            "type": "boolean",
            "description": "Whether YouTube search is available at all."
          },
          "youtube_search_url": {
            "type": "string",
            "description": "YouTube search URL fallback."
          },
          "youtube_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "YouTube URL for the album, when found."
          }
        }
      },
      "QueueGenerateRequest": {
        "type": "object",
        "description": "Body triggering a queue build.",
        "properties": {
          "force": {
            "type": "boolean",
            "description": "Rebuild even when a fresh deck exists."
          }
        }
      },
      "QueueGenerateResponse": {
        "type": "object",
        "description": "What the generate trigger did, plus current build state.",
        "required": [
          "action",
          "status"
        ],
        "properties": {
          "action": {
            "$ref": "#/components/schemas/QueueAction",
            "description": "What the trigger did."
          },
          "built_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Build timestamp (unix seconds), when built."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Build failure, when failed."
          },
          "item_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Card count, when there is one."
          },
          "queue_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Build id, when there is one."
          },
          "stale": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True when the deck is older than its TTL."
          },
          "status": {
            "$ref": "#/components/schemas/QueueBuildStatus",
            "description": "Build state after the trigger."
          }
        }
      },
      "QueueIgnoreRequest": {
        "type": "object",
        "description": "Body ignoring one queue card.",
        "required": [
          "release_group_mbid",
          "artist_mbid",
          "release_name",
          "artist_name"
        ],
        "properties": {
          "artist_mbid": {
            "type": "string",
            "description": "MusicBrainz artist id behind the card."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name for the ignore ledger."
          },
          "release_group_mbid": {
            "type": "string",
            "description": "MusicBrainz release-group id to ignore."
          },
          "release_name": {
            "type": "string",
            "description": "Release name for the ignore ledger."
          }
        }
      },
      "QueueItemLight": {
        "type": "object",
        "description": "One lightweight queue card: the deck renders these before enrichment.",
        "required": [
          "musicbrainz_id",
          "title",
          "artist_name",
          "artist_id",
          "recommendation_reason",
          "is_wildcard",
          "in_library"
        ],
        "properties": {
          "artist_id": {
            "type": "string",
            "description": "The artist's MusicBrainz id."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover URL, when known."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when already owned."
          },
          "is_wildcard": {
            "type": "boolean",
            "description": "True for wildcard (out-of-profile) picks."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "MusicBrainz release-group id."
          },
          "recommendation_reason": {
            "type": "string",
            "description": "Human reason behind the pick."
          },
          "title": {
            "type": "string",
            "description": "Album title."
          }
        }
      },
      "QueueStatsResponse": {
        "type": "object",
        "description": "Background loops, job queues and the latest checkpoint pass.",
        "required": [
          "jobs",
          "queues"
        ],
        "properties": {
          "checkpoint": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CheckpointView"
              }
            ],
            "description": "Latest database checkpoint pass, once the checkpoint loop has\nrecorded one."
          },
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobView"
            },
            "description": "Background loops in name order."
          },
          "queues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QueueDepthView"
            },
            "description": "Job kinds with queued, running or failed jobs, in kind order."
          }
        }
      },
      "QueueValidateRequest": {
        "type": "object",
        "description": "Body checking which cards already landed in the library.",
        "required": [
          "release_group_mbids"
        ],
        "properties": {
          "release_group_mbids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Release-group ids to check."
          }
        }
      },
      "QueueValidateResponse": {
        "type": "object",
        "description": "Library membership behind the checked cards.",
        "properties": {
          "in_library": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The checked ids that are already owned."
          }
        }
      },
      "QuotaOverrideBody": {
        "type": "object",
        "description": "Per-user quota overrides. `None` fields inherit the global download-policy\ndefaults; an all-`None` body clears the row back to pure inherit.",
        "properties": {
          "request_quota_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Asks allowed per window (0 = unlimited).",
            "minimum": 0
          },
          "request_quota_days": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Window length in days.",
            "minimum": 0
          },
          "storage_quota_gb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Library bytes in GiB (0 = unlimited).",
            "minimum": 0
          }
        }
      },
      "QuotaOverrideView": {
        "type": "object",
        "description": "Stored override row for display.",
        "properties": {
          "request_quota_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Asks allowed per window, when overridden.",
            "minimum": 0
          },
          "request_quota_days": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Window length in days, when overridden.",
            "minimum": 0
          },
          "storage_quota_gb": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Library bytes in GiB, when overridden.",
            "minimum": 0
          }
        }
      },
      "QuotaResponse": {
        "type": "object",
        "description": "One user's quota standing for the admin editor.",
        "required": [
          "user_id",
          "quota_override",
          "effective_request_quota_count",
          "effective_request_quota_days",
          "effective_storage_quota_gb",
          "requests_in_window",
          "storage_bytes",
          "exempt"
        ],
        "properties": {
          "effective_request_quota_count": {
            "type": "integer",
            "format": "int32",
            "description": "Effective asks per window after overrides.",
            "minimum": 0
          },
          "effective_request_quota_days": {
            "type": "integer",
            "format": "int32",
            "description": "Effective window length in days after overrides.",
            "minimum": 0
          },
          "effective_storage_quota_gb": {
            "type": "integer",
            "format": "int64",
            "description": "Effective storage in GiB after overrides.",
            "minimum": 0
          },
          "exempt": {
            "type": "boolean",
            "description": "True for admin/trusted accounts, which skip per-user quotas."
          },
          "quota_override": {
            "$ref": "#/components/schemas/QuotaOverrideView",
            "description": "Stored override row (`None` fields inherit)."
          },
          "requests_in_window": {
            "type": "integer",
            "format": "int32",
            "description": "Asks inside the trailing window.",
            "minimum": 0
          },
          "storage_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Landed download bytes attributed to the user.",
            "minimum": 0
          },
          "user_id": {
            "type": "string",
            "description": "User id."
          }
        }
      },
      "RadioMode": {
        "type": "string",
        "description": "Which tracks a radio plan may use.",
        "enum": [
          "library",
          "hybrid"
        ]
      },
      "RadioPlanRequest": {
        "type": "object",
        "description": "Body planning track-level radio. The UI resolves playback per track\n(library rows use the native stream endpoint, the rest use YouTube or\n30-second previews).",
        "required": [
          "seed_type"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "Wanted track count."
          },
          "exclude_recording_mbids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Recording mbids to leave out."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RadioSeedItem"
            },
            "description": "Seed rows for `items` plans."
          },
          "mode": {
            "$ref": "#/components/schemas/RadioMode",
            "description": "Which tracks the plan may use."
          },
          "seed_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Seed id (mbid or genre name); empty for item seeds."
          },
          "seed_type": {
            "$ref": "#/components/schemas/RadioSeedKind",
            "description": "What the plan starts from."
          }
        }
      },
      "RadioPlanResponse": {
        "type": "object",
        "description": "A complete radio plan.",
        "required": [
          "title",
          "tracks"
        ],
        "properties": {
          "title": {
            "type": "string",
            "description": "Plan title."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RadioPlanTrack"
            },
            "description": "Planned tracks in order."
          }
        }
      },
      "RadioPlanTrack": {
        "type": "object",
        "description": "One planned radio track.",
        "required": [
          "track_name",
          "artist_name",
          "artist_mbid",
          "in_library"
        ],
        "properties": {
          "album_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz release id, when known."
          },
          "album_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title, when known."
          },
          "artist_mbid": {
            "type": "string",
            "description": "MusicBrainz artist id, when known."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "duration_s": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Duration in seconds, when known."
          },
          "file_format": {
            "type": [
              "string",
              "null"
            ],
            "description": "File container for owned rows, when known."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when owned (resolves to the native stream endpoint)."
          },
          "local_file_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Native file id for owned rows, when known."
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz recording id, when known."
          },
          "track_name": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "RadioRequest": {
        "type": "object",
        "description": "Body generating one radio shelf.",
        "required": [
          "seed_type",
          "seed_id"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "Wanted row count."
          },
          "seed_id": {
            "type": "string",
            "description": "Seed id (mbid or genre name)."
          },
          "seed_type": {
            "$ref": "#/components/schemas/RadioSeedKind",
            "description": "What the shelf starts from (`artist`, `album` or `genre`)."
          },
          "source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ListenSource"
              }
            ],
            "description": "Provider preference."
          }
        }
      },
      "RadioSeedItem": {
        "type": "object",
        "description": "One seed row for an item-seeded radio plan.",
        "required": [
          "artist_mbid"
        ],
        "properties": {
          "album_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Seed MusicBrainz release id, when seeded by album."
          },
          "album_name": {
            "type": "string",
            "description": "Seed album name."
          },
          "artist_mbid": {
            "type": "string",
            "description": "Seed MusicBrainz artist id."
          },
          "artist_name": {
            "type": "string",
            "description": "Seed artist name."
          }
        }
      },
      "RadioSeedKind": {
        "type": "string",
        "description": "The seed a radio shelf or plan starts from.",
        "enum": [
          "artist",
          "album",
          "genre",
          "items"
        ]
      },
      "RatedKind": {
        "type": "string",
        "description": "What a rating is on: the table's `item_kind` values.",
        "enum": [
          "artist",
          "album",
          "track"
        ]
      },
      "RatingLookupBody": {
        "type": "object",
        "description": "Rating-lookup body: local ids of each kind, at most 1000 of each.",
        "properties": {
          "album_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Album ids."
          },
          "artist_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Artist ids."
          },
          "track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Track ids."
          }
        }
      },
      "RatingLookupResponse": {
        "type": "object",
        "description": "The caller's ratings of the looked-up ids. Each map holds only the ids\nthe caller rated: an absent id is not rated.",
        "required": [
          "albums",
          "tracks",
          "artists"
        ],
        "properties": {
          "albums": {
            "type": "object",
            "description": "Album id to rating.",
            "additionalProperties": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "artists": {
            "type": "object",
            "description": "Artist id to rating.",
            "additionalProperties": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "tracks": {
            "type": "object",
            "description": "Track id to rating.",
            "additionalProperties": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "RatingMode": {
        "type": "string",
        "description": "Which side of `rating` a list keeps.",
        "enum": [
          "at_least",
          "at_most"
        ]
      },
      "RatingStatusResponse": {
        "type": "object",
        "description": "Rating-status answer.",
        "required": [
          "kind",
          "item_id",
          "rating"
        ],
        "properties": {
          "item_id": {
            "type": "string",
            "description": "The id the rating is stored under: the item's current id, which\ndiffers from the one sent after a merge."
          },
          "kind": {
            "$ref": "#/components/schemas/RatedKind",
            "description": "Rated kind."
          },
          "rating": {
            "type": "integer",
            "format": "int32",
            "description": "The caller's rating now, 0 when cleared.",
            "minimum": 0
          }
        }
      },
      "Reason": {
        "type": "string",
        "description": "One reason, stored and sent by its snake_case spelling.",
        "enum": [
          "weak_match",
          "no_artist_evidence",
          "mostly_unmatched",
          "tag_mismatch",
          "fingerprint_mismatch",
          "fingerprint_unconfirmed",
          "album_version_only",
          "no_release",
          "no_tracks",
          "version_lower_quality",
          "no_better_than_yours",
          "owned_elsewhere",
          "owned_on_album",
          "album_needs_check",
          "no_album_match",
          "album_not_found",
          "tags_disagree",
          "not_chosen_edition",
          "samples",
          "too_many_files",
          "interrupted",
          "import_failed",
          "held_by_earlier_version",
          "format_not_listed",
          "target_occupied",
          "upgrade_blocked",
          "library_changed",
          "library_unavailable",
          "naming_script_failed",
          "library_folder_missing",
          "library_off",
          "local_fault",
          "files_missing",
          "files_unlisted",
          "outside_downloads_folder",
          "size_mismatch",
          "corrupt",
          "no_audio",
          "sample",
          "wrong_edition",
          "not_pinned_edition",
          "wrong_album",
          "quality_rejected",
          "not_an_upgrade",
          "wrong_track",
          "stalled",
          "queue_timeout",
          "queue_gave_way",
          "never_started",
          "deadline",
          "source_failed",
          "no_source",
          "download_failed",
          "album_lookup_unavailable",
          "recording_unknown",
          "no_album_for_recording",
          "no_album_folder",
          "no_album_release",
          "album_releases_exhausted",
          "track_not_found",
          "nothing_allowed",
          "no_download_source",
          "settings_unreadable",
          "journal_unreadable",
          "musicbrainz_unavailable",
          "acoustid_unavailable",
          "held_for_review",
          "tracks_missing",
          "already_owned",
          "cancelled",
          "moved_on",
          "no_better_copy",
          "already_downloading",
          "already_in_library"
        ]
      },
      "ReasonCount": {
        "type": "object",
        "description": "How many reviews one reason holds.",
        "required": [
          "reason_code",
          "reason",
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "reason": {
            "$ref": "#/components/schemas/ReasonView"
          },
          "reason_code": {
            "type": "string",
            "description": "The reason code as filed (filter by this)."
          }
        }
      },
      "ReasonKind": {
        "type": "string",
        "description": "Where a reason shows and what it offers.",
        "enum": [
          "hold",
          "library",
          "source",
          "wait",
          "settled"
        ]
      },
      "ReasonView": {
        "type": "object",
        "description": "Why a job or work item ended where it did: a stable code, a plain\nsentence, and what to do about it.",
        "required": [
          "code",
          "message",
          "action"
        ],
        "properties": {
          "action": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "RecipeFormat": {
        "type": "string",
        "description": "A recipe entry's container.",
        "enum": [
          "flac",
          "mp3"
        ]
      },
      "RecipeQuality": {
        "type": "string",
        "description": "A recipe entry's quality: MP3 bitrate bands, FLAC resolutions, or\n`custom` for either.",
        "enum": [
          "below_192",
          "192_255",
          "256_319",
          "320_plus",
          "cd",
          "24_48",
          "24_96",
          "24_192",
          "hi_res",
          "custom"
        ]
      },
      "RecoveryCodeResponse": {
        "type": "object",
        "description": "A minted recovery code. The code appears here once, never again.",
        "required": [
          "recovery_code",
          "expires_at"
        ],
        "properties": {
          "expires_at": {
            "type": "integer",
            "format": "int64",
            "description": "Expiry time, unix seconds."
          },
          "recovery_code": {
            "type": "string",
            "description": "Display code (`XXXX-XXXX-XXXX-XXXX-XXXX`)."
          }
        }
      },
      "RecycleBinPage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Page_BinRemovalView"
          },
          {
            "type": "object",
            "required": [
              "bins_known"
            ],
            "properties": {
              "bins_known": {
                "type": "boolean",
                "description": "The bins can be looked at now."
              },
              "retention_days": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64",
                "description": "Days a copy stays in the bin; absent while it can't be read."
              }
            }
          }
        ],
        "description": "One page of the recycle bin, newest first."
      },
      "RecycleBinStatus": {
        "type": "object",
        "description": "Whether the bin is being emptied, and what the last run did.",
        "required": [
          "state"
        ],
        "properties": {
          "last_emptied": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Emptied"
              }
            ]
          },
          "state": {
            "$ref": "#/components/schemas/EmptyingState"
          }
        }
      },
      "RecycleBinSummary": {
        "type": "object",
        "description": "What emptying the bin now would delete.",
        "required": [
          "files",
          "bytes",
          "staying",
          "older_folders",
          "as_of"
        ],
        "properties": {
          "as_of": {
            "type": "integer",
            "format": "int64",
            "description": "When this was read, unix milliseconds. Empty deletes only what was\nin the bin then."
          },
          "bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Their bytes.",
            "minimum": 0
          },
          "files": {
            "type": "integer",
            "format": "int32",
            "description": "Files it would delete (one changed in the bin is kept instead).",
            "minimum": 0
          },
          "older_folders": {
            "type": "integer",
            "format": "int32",
            "description": "Older bin folders the app did not record, which it would empty.",
            "minimum": 0
          },
          "staying": {
            "type": "integer",
            "format": "int32",
            "description": "Files it would leave: held, in use by a put-back, not found, or in\na bin it may not empty.",
            "minimum": 0
          }
        }
      },
      "RecycleBinWarning": {
        "type": "object",
        "description": "Why the recycle bin path is not used.",
        "required": [
          "message",
          "accept_folder"
        ],
        "properties": {
          "accept_folder": {
            "type": "boolean",
            "description": "The folder is not the one used as the bin before, so files wait;\nan admin who moved the bin may use it\n(`POST /api/v3/library/recycle-bin/accept-folder`)."
          },
          "message": {
            "type": "string",
            "description": "What the settings say."
          }
        }
      },
      "RedactedPlaylist": {
        "type": "object",
        "description": "A private playlist the caller may not read: existence, count, and owner\nonly. Never the name, tracks, or covers. An admin also gets the ones with\nno owner, which they may delete.",
        "required": [
          "id",
          "track_count",
          "can_delete",
          "is_redacted"
        ],
        "properties": {
          "can_delete": {
            "type": "boolean",
            "description": "True for an admin when it has no owner."
          },
          "id": {
            "type": "string",
            "description": "Playlist id."
          },
          "is_redacted": {
            "type": "boolean",
            "description": "Always true."
          },
          "owner_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owner display name. None when it has no owner."
          },
          "track_count": {
            "type": "integer",
            "description": "Track count.",
            "minimum": 0
          }
        }
      },
      "ReenableBody": {
        "type": "object",
        "description": "Re-enable body: the exclusion revision the page showed.",
        "required": [
          "expected_exclusion_revision"
        ],
        "properties": {
          "expected_exclusion_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Row revision of the exclusion being cleared."
          }
        }
      },
      "ReenableResponse": {
        "type": "object",
        "description": "Re-enable answer.",
        "required": [
          "reenabled"
        ],
        "properties": {
          "reenabled": {
            "type": "boolean",
            "description": "False when the album was not excluded."
          }
        }
      },
      "RefreshCode": {
        "type": "string",
        "description": "Why a rescan did not go through. The handler stores these as the\njob's code; the run's page shows them.",
        "enum": [
          "EXTERNAL_REFRESH_NOT_CONFIGURED",
          "EXTERNAL_REFRESH_AUTH_FAILED",
          "EXTERNAL_REFRESH_NOT_FOUND",
          "EXTERNAL_REFRESH_UNREACHABLE",
          "EXTERNAL_REFRESH_FAILED",
          "EXTERNAL_REFRESH_INTERRUPTED"
        ]
      },
      "RefreshResponse": {
        "type": "object",
        "description": "Acknowledgement of a triggered background refresh.",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human message."
          },
          "status": {
            "type": "string",
            "description": "Always `ok` when the trigger lands."
          }
        }
      },
      "RefreshState": {
        "type": "string",
        "description": "Where a rescan stands.",
        "enum": [
          "queued",
          "running",
          "done",
          "failed",
          "no_record"
        ]
      },
      "RefreshTarget": {
        "type": "string",
        "description": "A media server Library Management can ask to rescan.",
        "enum": [
          "jellyfin",
          "plex",
          "navidrome"
        ]
      },
      "ReidentificationCandidateView": {
        "type": "object",
        "description": "One candidate a re-identification offers.",
        "required": [
          "candidate_key",
          "evidence_revision",
          "evidence",
          "automatic_safe"
        ],
        "properties": {
          "automatic_safe": {
            "type": "boolean",
            "description": "The matcher would have accepted it on its own: no confirmation\nneeded to choose it."
          },
          "candidate_key": {
            "type": "string",
            "description": "Choose the candidate by this key."
          },
          "evidence": {
            "$ref": "#/components/schemas/OperationCandidateEvidenceView"
          },
          "evidence_revision": {
            "type": "string",
            "description": "Changes whenever the job re-evaluates."
          }
        }
      },
      "ReimportResponse": {
        "type": "object",
        "description": "Reimport outcome: the task as the import left it.",
        "required": [
          "success",
          "status"
        ],
        "properties": {
          "reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DownloadTaskReason"
              }
            ],
            "description": "Why the import did not complete, when it did not."
          },
          "status": {
            "$ref": "#/components/schemas/TaskStatus",
            "description": "Task status after the import."
          },
          "success": {
            "type": "boolean",
            "description": "Whether the files reached the library (`completed` or `partial`)."
          }
        }
      },
      "RelationshipCreditSettings": {
        "type": "object",
        "description": "Relationship-credit handling.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": true
          },
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RelationshipType"
            },
            "description": "Credited relationship types.",
            "default": [
              "composer",
              "lyricist",
              "conductor",
              "performer",
              "arranger",
              "remixer",
              "producer"
            ]
          }
        }
      },
      "RelationshipType": {
        "type": "string",
        "description": "Credited relationship type.",
        "enum": [
          "composer",
          "lyricist",
          "conductor",
          "performer",
          "arranger",
          "remixer",
          "producer",
          "other"
        ]
      },
      "ReleaseDraft": {
        "type": "object",
        "required": [
          "schema_version",
          "title",
          "artist_credit",
          "release_date",
          "country",
          "label",
          "catalogue_number",
          "barcode",
          "packaging",
          "media"
        ],
        "properties": {
          "artist_credit": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "barcode": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "catalogue_number": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "country": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "label": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "media": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseMediumDraft"
            }
          },
          "packaging": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "release_date": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "schema_version": {
            "type": "integer",
            "format": "int32"
          },
          "title": {
            "$ref": "#/components/schemas/ReleaseTextField"
          }
        }
      },
      "ReleaseEditionSearchResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Page_ReleaseEditionView"
          },
          {
            "type": "object",
            "required": [
              "title_query",
              "artist_query"
            ],
            "properties": {
              "artist_query": {
                "type": "string"
              },
              "current_release_group_mbid": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The album's current release group, for \"every edition of this\nalbum\"."
              },
              "release_group_query": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The release group whose editions are listed, when the page is a\nrelease group listing rather than a search."
              },
              "title_query": {
                "type": "string"
              }
            }
          }
        ],
        "description": "One page of the edition finder, with MusicBrainz's count of matches as\nits total."
      },
      "ReleaseItem": {
        "type": "object",
        "description": "One release group on an artist page.",
        "required": [
          "id",
          "in_library",
          "requested"
        ],
        "properties": {
          "first_release_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "First release date."
          },
          "id": {
            "type": "string",
            "description": "Release-group MBID."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when the library holds this album."
          },
          "requested": {
            "type": "boolean",
            "description": "True when an acquisition request is open for it."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Title."
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary type (`Album`, `EP`, `Single`)."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "First release year."
          }
        }
      },
      "ReleaseMediumDraft": {
        "type": "object",
        "required": [
          "position",
          "title",
          "format",
          "tracks"
        ],
        "properties": {
          "format": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "position": {
            "type": "integer",
            "format": "int64"
          },
          "title": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseTrackDraft"
            }
          }
        }
      },
      "ReleaseMediumSnapshot": {
        "type": "object",
        "required": [
          "position",
          "title",
          "tracks"
        ],
        "properties": {
          "position": {
            "type": "integer",
            "format": "int64"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseTrackSnapshot"
            }
          }
        }
      },
      "ReleaseTextField": {
        "type": "object",
        "required": [
          "value",
          "source"
        ],
        "properties": {
          "source": {
            "$ref": "#/components/schemas/ContributionFieldSource"
          },
          "value": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ReleaseTrackDraft": {
        "type": "object",
        "required": [
          "local_track_id",
          "disc_number",
          "track_number",
          "title",
          "artist_name",
          "duration_seconds"
        ],
        "properties": {
          "artist_name": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "disc_number": {
            "type": "integer",
            "format": "int64"
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "local_track_id": {
            "type": "string"
          },
          "title": {
            "$ref": "#/components/schemas/ReleaseTextField"
          },
          "track_number": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ReleaseTrackSnapshot": {
        "type": "object",
        "required": [
          "local_track_id",
          "disc_number",
          "track_number",
          "title",
          "artist_name",
          "duration_seconds",
          "duration_reliable"
        ],
        "properties": {
          "artist_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "disc_number": {
            "type": "integer",
            "format": "int64"
          },
          "duration_reliable": {
            "type": "boolean"
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "local_track_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "track_number": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RemotesAlbumPage": {
        "type": "object",
        "description": "One page of albums.",
        "required": [
          "items",
          "total",
          "offset",
          "limit"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesAlbumView"
            },
            "description": "Page items."
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "description": "Echoed limit."
          },
          "offset": {
            "type": "integer",
            "format": "int64",
            "description": "Echoed offset."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total matching records upstream."
          }
        }
      },
      "RemotesAlbumView": {
        "type": "object",
        "description": "One remote album in list and detail views.",
        "required": [
          "source",
          "id",
          "title",
          "artist_name"
        ],
        "properties": {
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque remote artist id, when the source links one."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz artist id."
          },
          "artist_name": {
            "type": "string",
            "description": "Album artist display name."
          },
          "genre": {
            "type": [
              "string",
              "null"
            ],
            "description": "Genre label, when the source reports one."
          },
          "id": {
            "type": "string",
            "description": "Opaque remote id (Jellyfin item id, Subsonic id, Plex rating key)."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Relative images URL under `/api/v3`, when art exists."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz release-group id."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz release id."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          },
          "title": {
            "type": "string",
            "description": "Album title."
          },
          "track_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Track count, when the source reports one."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year, when known."
          }
        }
      },
      "RemotesArtistPage": {
        "type": "object",
        "description": "One page of artists.",
        "required": [
          "items",
          "total",
          "offset",
          "limit"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesArtistView"
            },
            "description": "Page items."
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "description": "Echoed limit."
          },
          "offset": {
            "type": "integer",
            "format": "int64",
            "description": "Echoed offset."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total matching records upstream."
          }
        }
      },
      "RemotesArtistView": {
        "type": "object",
        "description": "One remote artist.",
        "required": [
          "source",
          "id",
          "name"
        ],
        "properties": {
          "album_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Album count, when the source reports one."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz artist id."
          },
          "id": {
            "type": "string",
            "description": "Opaque remote id."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Relative images URL under `/api/v3`, when art exists."
          },
          "name": {
            "type": "string",
            "description": "Artist name."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          }
        }
      },
      "RemotesLyricLine": {
        "type": "object",
        "description": "One lyric line, with an optional sync offset in milliseconds.",
        "required": [
          "text"
        ],
        "properties": {
          "start_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Start offset in milliseconds, when synced."
          },
          "text": {
            "type": "string",
            "description": "Line text."
          }
        }
      },
      "RemotesLyricsView": {
        "type": "object",
        "description": "Unified lyrics passthrough.",
        "required": [
          "source",
          "text",
          "is_synced",
          "lines"
        ],
        "properties": {
          "is_synced": {
            "type": "boolean",
            "description": "True when line timings are present."
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesLyricLine"
            },
            "description": "Timed lines, when the source provides them."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          },
          "text": {
            "type": "string",
            "description": "Full text."
          }
        }
      },
      "RemotesPlaylistDetail": {
        "type": "object",
        "description": "Playlist with its tracks.",
        "required": [
          "playlist",
          "tracks"
        ],
        "properties": {
          "playlist": {
            "$ref": "#/components/schemas/RemotesPlaylistSummary",
            "description": "Playlist header."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesTrackView"
            },
            "description": "Playlist tracks in order."
          }
        }
      },
      "RemotesPlaylistSummary": {
        "type": "object",
        "description": "One remote playlist.",
        "required": [
          "source",
          "id",
          "name",
          "track_count",
          "duration_secs",
          "is_smart",
          "is_imported"
        ],
        "properties": {
          "duration_secs": {
            "type": "integer",
            "format": "int64",
            "description": "Total duration in seconds."
          },
          "id": {
            "type": "string",
            "description": "Opaque remote id."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Relative covers URL under `/api/v3`, when art exists."
          },
          "is_imported": {
            "type": "boolean",
            "description": "True when the caller already imported this playlist."
          },
          "is_smart": {
            "type": "boolean",
            "description": "True for a smart (rule-based) playlist. Only Plex reports it."
          },
          "name": {
            "type": "string",
            "description": "Playlist name."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          },
          "track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Track count."
          }
        }
      },
      "RemotesSearchResults": {
        "type": "object",
        "description": "Unified search results across the three buckets.",
        "required": [
          "artists",
          "albums",
          "tracks"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesAlbumView"
            },
            "description": "Matching albums."
          },
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesArtistView"
            },
            "description": "Matching artists."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesTrackView"
            },
            "description": "Matching tracks."
          }
        }
      },
      "RemotesStatsView": {
        "type": "object",
        "description": "Library totals for one source.",
        "required": [
          "total_albums",
          "total_artists",
          "total_tracks"
        ],
        "properties": {
          "total_albums": {
            "type": "integer",
            "format": "int64",
            "description": "Album count."
          },
          "total_artists": {
            "type": "integer",
            "format": "int64",
            "description": "Artist count."
          },
          "total_tracks": {
            "type": "integer",
            "format": "int64",
            "description": "Track count."
          }
        }
      },
      "RemotesTrackPage": {
        "type": "object",
        "description": "One page of tracks.",
        "required": [
          "items",
          "total",
          "offset",
          "limit"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RemotesTrackView"
            },
            "description": "Page items."
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "description": "Echoed limit."
          },
          "offset": {
            "type": "integer",
            "format": "int64",
            "description": "Echoed offset."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Total matching records upstream."
          }
        }
      },
      "RemotesTrackView": {
        "type": "object",
        "description": "One remote track.",
        "required": [
          "source",
          "id",
          "title",
          "album_name",
          "artist_name"
        ],
        "properties": {
          "album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque remote album id, when the source links one."
          },
          "album_name": {
            "type": "string",
            "description": "Album title."
          },
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque remote artist id, when the source links one."
          },
          "artist_name": {
            "type": "string",
            "description": "Track artist display name."
          },
          "disc_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Disc number."
          },
          "duration_secs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Duration in seconds."
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "The file's format in the library's names (`flac`, `mp3`, `alac`,\n`m4a` for an MP4 file whose codec the server did not say), when the\nsource reports it."
          },
          "id": {
            "type": "string",
            "description": "Opaque remote id."
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Relative images URL under `/api/v3`, when art exists."
          },
          "part_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plex part key for the stream gateway. Plex-only: Jellyfin and\nNavidrome stream by item id, so they always leave this empty."
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz recording id."
          },
          "source": {
            "$ref": "#/components/schemas/SourceName",
            "description": "Owning source."
          },
          "title": {
            "type": "string",
            "description": "Track title."
          },
          "track_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Track number within the disc."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year, when known."
          }
        }
      },
      "RemovalKind": {
        "type": "string",
        "description": "What kind of removal an undo record undoes, read from its reason code.",
        "enum": [
          "album",
          "track",
          "extras"
        ]
      },
      "RemovalResponse": {
        "type": "object",
        "description": "What a removal took out of the catalog.",
        "required": [
          "id",
          "removed_track_ids"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The removed album (canonical local id) or track id."
          },
          "removed_track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Track ids now gone from the catalog."
          }
        }
      },
      "RemoveExtrasBody": {
        "type": "object",
        "description": "Extra files to move to the recycle bin.",
        "required": [
          "track_ids",
          "expected_identity_revision"
        ],
        "properties": {
          "expected_identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `identity_revision` the edition plan showed."
          },
          "track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Local track ids the album's edition plan marks anything but `keep`."
          }
        }
      },
      "RemoveExtrasView": {
        "type": "object",
        "description": "What removing extras did.",
        "required": [
          "removed_track_ids"
        ],
        "properties": {
          "removed_track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RemoveTracksBody": {
        "type": "object",
        "description": "Bulk-remove body.",
        "required": [
          "track_ids"
        ],
        "properties": {
          "track_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Track row ids to remove."
          }
        }
      },
      "RemoveTracksResponse": {
        "type": "object",
        "description": "Bulk-remove answer.",
        "required": [
          "status",
          "message",
          "removed"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human message."
          },
          "removed": {
            "type": "integer",
            "description": "How many rows were removed.",
            "minimum": 0
          },
          "status": {
            "type": "string",
            "description": "Always \"ok\"."
          }
        }
      },
      "ReorderBody": {
        "type": "object",
        "description": "Reorder body.",
        "required": [
          "track_id",
          "new_position"
        ],
        "properties": {
          "new_position": {
            "type": "integer",
            "description": "Desired position. Past-the-end clamps to the last slot.",
            "minimum": 0
          },
          "track_id": {
            "type": "string",
            "description": "Track row id to move."
          }
        }
      },
      "ReorderResponse": {
        "type": "object",
        "description": "Reorder answer.",
        "required": [
          "status",
          "message",
          "actual_position"
        ],
        "properties": {
          "actual_position": {
            "type": "integer",
            "description": "Where the track actually landed.",
            "minimum": 0
          },
          "message": {
            "type": "string",
            "description": "Human message."
          },
          "status": {
            "type": "string",
            "description": "Always \"ok\"."
          }
        }
      },
      "RepairApplyBody": {
        "type": "object",
        "description": "Apply a ready report.",
        "required": [
          "expected_row_revision",
          "confirmation"
        ],
        "properties": {
          "confirmation": {
            "type": "boolean",
            "description": "Must be true: Apply changes album matches."
          },
          "expected_row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The job's `row_revision` as last read."
          }
        }
      },
      "RepairCreateBody": {
        "type": "object",
        "description": "Start an identity repair.",
        "required": [
          "idempotency_key"
        ],
        "properties": {
          "idempotency_key": {
            "type": "string",
            "description": "Makes a retried request return the same job."
          },
          "root_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Library roots to check; none means every root."
          },
          "source_matcher_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only recheck identities this matcher version wrote."
          },
          "target_matcher_version": {
            "type": "string"
          }
        }
      },
      "RepairEstimateView": {
        "type": "object",
        "description": "How many albums an identity repair would check.",
        "required": [
          "identity_count",
          "selected_root_count",
          "queued_repair_count"
        ],
        "properties": {
          "identity_count": {
            "type": "integer",
            "format": "int64"
          },
          "queued_repair_count": {
            "type": "integer",
            "format": "int64"
          },
          "selected_root_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "RepairFindingListView": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Page_RepairFindingView"
          },
          {
            "type": "object",
            "required": [
              "current_counts_by_finding",
              "refresh_required"
            ],
            "properties": {
              "current_counts_by_finding": {
                "type": "object",
                "description": "Findings per code that still describe their album.",
                "additionalProperties": {
                  "type": "integer",
                  "format": "int64"
                },
                "propertyNames": {
                  "type": "string"
                }
              },
              "refresh_required": {
                "type": "boolean",
                "description": "The report used older rules; run a fresh check before applying."
              }
            }
          }
        ],
        "description": "One page of findings."
      },
      "RepairSummaryView": {
        "type": "object",
        "description": "What a finished check found.",
        "required": [
          "total_identities",
          "remaining_identities",
          "input_track_count",
          "playable_after_detach_track_count",
          "estimated_apply_changes",
          "catalog_snapshot_revision",
          "target_matcher_version",
          "counts_by_finding",
          "counts_by_reason",
          "album_counts_by_root",
          "provider_deferred_count",
          "failed_evidence_count",
          "purpose",
          "ready_album_count",
          "mapping_candidate_count",
          "exact_release_required_count",
          "needs_review_count"
        ],
        "properties": {
          "album_counts_by_root": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "catalog_snapshot_revision": {
            "type": "integer",
            "format": "int64"
          },
          "counts_by_finding": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "counts_by_reason": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int64"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "estimated_apply_changes": {
            "type": "integer",
            "format": "int64",
            "description": "Albums Apply would change."
          },
          "exact_release_required_count": {
            "type": "integer",
            "format": "int64"
          },
          "failed_evidence_count": {
            "type": "integer",
            "format": "int64"
          },
          "input_track_count": {
            "type": "integer",
            "format": "int64"
          },
          "mapping_candidate_count": {
            "type": "integer",
            "format": "int64"
          },
          "needs_review_count": {
            "type": "integer",
            "format": "int64"
          },
          "playable_after_detach_track_count": {
            "type": "integer",
            "format": "int64"
          },
          "provider_deferred_count": {
            "type": "integer",
            "format": "int64"
          },
          "purpose": {
            "$ref": "#/components/schemas/Purpose"
          },
          "ready_album_count": {
            "type": "integer",
            "format": "int64"
          },
          "remaining_identities": {
            "type": "integer",
            "format": "int64"
          },
          "target_matcher_version": {
            "type": "string"
          },
          "total_identities": {
            "type": "integer",
            "format": "int64",
            "description": "Albums checked."
          }
        }
      },
      "ReplayGainManagementSettings": {
        "type": "object",
        "description": "ReplayGain enrichment block.",
        "properties": {
          "album_aware": {
            "type": "boolean",
            "description": "Album-aware gain.",
            "default": true
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "mode": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReplayGainMode"
              }
            ],
            "description": "Write mode.",
            "default": "preserve"
          },
          "required": {
            "type": "boolean",
            "description": "Gain required for completion.",
            "default": false
          }
        }
      },
      "ReplayGainMode": {
        "type": "string",
        "description": "ReplayGain write mode.",
        "enum": [
          "preserve",
          "fill_missing",
          "replace"
        ]
      },
      "RequestImported": {
        "type": "object",
        "description": "`request_imported`: another user (a curator) imported an album this\nuser had requested.",
        "required": [
          "event_id",
          "release_group_mbid",
          "artist_name",
          "album_title"
        ],
        "properties": {
          "album_title": {
            "type": "string",
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "event_id": {
            "type": "string",
            "description": "Id for de-duplication."
          },
          "release_group_mbid": {
            "type": "string",
            "description": "The imported release group."
          }
        }
      },
      "RequestItem": {
        "type": "object",
        "description": "One request row in list views.",
        "required": [
          "musicbrainz_id",
          "artist_name",
          "album_title",
          "requested_at",
          "status",
          "request_kind",
          "origin",
          "requester_count"
        ],
        "properties": {
          "album_title": {
            "type": "string",
            "description": "Album title."
          },
          "album_version_only": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "A failed track request whose download found only the album's\nversion of the song: it can be taken from the album instead. None\nwhen not applicable."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist MBID."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "can_reimport": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether an admin can reimport the linked task (failed with its\ncandidate still linked). None when not applicable."
          },
          "completed_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Epoch seconds when terminal, when terminal.",
            "minimum": 0
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom artwork URL override. None: artwork resolves client-side\nfrom the MBID."
          },
          "duration_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track length for exact-track rows."
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last failure text from the linked task, when failed."
          },
          "eta": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Epoch seconds when the transfer should finish. None: no live ETA\nsource exists.",
            "minimum": 0
          },
          "in_library": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the album is in the library. None: intake has\nno library seam; callers treat unknown as present for imported\nrows, which only land after the task completes."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Album or recording MBID."
          },
          "origin": {
            "$ref": "#/components/schemas/RequestOrigin",
            "description": "What made the request: a person's ask or a followed artist's new\nrelease."
          },
          "progress": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Download progress percent (0-100) from the linked task, when linked."
          },
          "protocol": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fetch source from the linked task (`soulseek`, `usenet`, ...)."
          },
          "quality": {
            "type": [
              "string",
              "null"
            ],
            "description": "Picked candidate quality from the linked task, once picked."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The edition (release MBID) the request fetches, when one is set."
          },
          "request_kind": {
            "$ref": "#/components/schemas/RequestKind",
            "description": "Whole album or one track."
          },
          "requested_at": {
            "type": "integer",
            "format": "int64",
            "description": "Epoch seconds when asked.",
            "minimum": 0
          },
          "requested_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owner display name."
          },
          "requester_count": {
            "type": "integer",
            "format": "int32",
            "description": "Co-requester count beyond the owner.",
            "minimum": 0
          },
          "reviewed_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Epoch seconds when reviewed, when reviewed.",
            "minimum": 0
          },
          "reviewed_by_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reviewer display name."
          },
          "size": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Total transfer bytes from the linked task, once known."
          },
          "size_remaining": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Bytes still to transfer from the linked task, once known."
          },
          "status": {
            "$ref": "#/components/schemas/RequestStatus",
            "description": "Row status."
          },
          "status_messages": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/RequestStatusMessage"
            },
            "description": "Task status detail groups behind the card's expander. None until a\nproducer exists."
          },
          "task_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked download task."
          },
          "task_state": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RequestTaskState"
              }
            ],
            "description": "The linked download's own state while it is in flight or held for\nreview, whoever started it: a request joined to another person's\ndownload reads it here. None when no download is live."
          },
          "track_release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Containing release group for exact-track rows (album context)."
          },
          "track_title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Track title for exact-track rows."
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Primary owner id."
          },
          "waiting_reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WaitingReason"
              }
            ],
            "description": "Why a live request has not started, when it waits."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year."
          }
        }
      },
      "RequestKind": {
        "type": "string",
        "description": "What kind of thing a request asks for.",
        "enum": [
          "album",
          "track"
        ]
      },
      "RequestOrigin": {
        "type": "string",
        "description": "What made a request row.",
        "enum": [
          "user",
          "follow"
        ]
      },
      "RequestPriority": {
        "type": "string",
        "description": "How urgent a provider call is. Lower wins ties in the rate limiter.\nThere is no default: every caller names its priority.",
        "enum": [
          "user_initiated",
          "image_fetch",
          "prefetch_visible",
          "background_sync",
          "opportunistic"
        ]
      },
      "RequestStatus": {
        "type": "string",
        "description": "A request row's status. The `request_history.status` CHECK lists\nexactly these values.",
        "enum": [
          "pending",
          "queued",
          "downloading",
          "awaiting_approval",
          "cancelling",
          "cancelled",
          "failed",
          "imported",
          "incomplete",
          "rejected"
        ]
      },
      "RequestStatusMessage": {
        "type": "object",
        "description": "One grouped status detail behind the request card's expander. Intake\nhas no producer for these yet, so views answer None until one exists.",
        "required": [
          "messages"
        ],
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Detail lines."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Group heading, when grouped."
          }
        }
      },
      "RequestTaskState": {
        "type": "string",
        "description": "A live download's state as a request card shows it.",
        "enum": [
          "searching",
          "awaiting_review",
          "queued",
          "downloading",
          "importing"
        ]
      },
      "RequestedControl": {
        "type": "string",
        "description": "Pending control on a run, as the runs table stores it and the API\nreports it.",
        "enum": [
          "none",
          "pause",
          "stop"
        ]
      },
      "RequestsRefreshResponse": {
        "type": "object",
        "description": "Personal-mix refresh outcome. The schema renames to avoid discover's\nunrelated `RefreshResponse` in the shared document.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "$ref": "#/components/schemas/MixRefreshStatus"
          }
        }
      },
      "ResolveSourcesResponse": {
        "type": "object",
        "description": "Source-resolution answer: each track id maps to its known sources.",
        "required": [
          "sources"
        ],
        "properties": {
          "sources": {
            "type": "object",
            "description": "Track id to sources.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ResolveTrackItem": {
        "type": "object",
        "description": "One track position to look up in the library.",
        "properties": {
          "disc_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Disc number; absent reads as disc 1."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz release group (or release, or local album id) the track\nbelongs to."
          },
          "track_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track number within the disc."
          }
        }
      },
      "ResolveTracksRequest": {
        "type": "object",
        "description": "Track positions to resolve to playable local files. At most the first\n200 items are answered.",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResolveTrackItem"
            },
            "description": "Positions in the caller's order."
          }
        }
      },
      "ResolveTracksResponse": {
        "type": "object",
        "description": "Resolved positions, in the asked order.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ResolvedTrack"
            },
            "description": "One answer per asked position (first 200)."
          }
        }
      },
      "ResolvedTrack": {
        "type": "object",
        "description": "One answered position. The `source` fields are set only when a local\nfile holds the position.",
        "properties": {
          "disc_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Echo of the asked disc."
          },
          "duration": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Duration of the file, seconds."
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Container or codec label of the file."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Echo of the asked album id."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "`local` when a library file holds the position."
          },
          "stream_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Stream path for the local track."
          },
          "track_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Echo of the asked track number."
          },
          "track_source_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Local track id to stream."
          }
        }
      },
      "RestoreCheck": {
        "type": "object",
        "description": "One pre-restore verification check.",
        "required": [
          "name",
          "passed",
          "detail"
        ],
        "properties": {
          "detail": {
            "type": "string",
            "description": "Plain-language detail."
          },
          "name": {
            "type": "string",
            "description": "Check name, e.g. `manifest-sha256`."
          },
          "passed": {
            "type": "boolean",
            "description": "Whether the check passed."
          }
        }
      },
      "RestoreReport": {
        "type": "object",
        "description": "Pre-restore verification report. Read-only: nothing here writes or moves\nthe live database (the actual restore stays an offline CLI).",
        "required": [
          "backup",
          "ok",
          "restorable",
          "checks"
        ],
        "properties": {
          "backup": {
            "type": "string",
            "description": "Backup file name the report covers."
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RestoreCheck"
            },
            "description": "Per-check results."
          },
          "ok": {
            "type": "boolean",
            "description": "True when every check passed."
          },
          "restorable": {
            "type": "boolean",
            "description": "True when an offline restore of this backup should succeed."
          }
        }
      },
      "ResultState": {
        "type": "string",
        "description": "Where one planned file's write is after apply.",
        "enum": [
          "pending",
          "running",
          "succeeded",
          "failed",
          "skipped",
          "not_scheduled"
        ]
      },
      "RetagFileView": {
        "type": "object",
        "description": "A file a retag would rewrite to the chosen edition's tags.",
        "required": [
          "track_id",
          "root_id",
          "rel_path"
        ],
        "properties": {
          "rel_path": {
            "type": "string"
          },
          "root_id": {
            "type": "string"
          },
          "track_id": {
            "type": "string"
          }
        }
      },
      "RetagPairAlbumView": {
        "type": "object",
        "description": "One album of a retag pair, as the card shows it.",
        "required": [
          "id",
          "title",
          "album_artist_name",
          "track_count",
          "identity_token"
        ],
        "properties": {
          "album_artist_name": {
            "type": "string"
          },
          "edition": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RetagPairEditionView"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "identity_token": {
            "type": "string",
            "description": "The edition as shown: its revision with what it names, `0` for\nnone. Send it back with a join, unread."
          },
          "title": {
            "type": "string"
          },
          "track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Indexed tracks."
          }
        }
      },
      "RetagPairDismissResponse": {
        "type": "object",
        "description": "A dismissed retag pair.",
        "required": [
          "dismissed"
        ],
        "properties": {
          "dismissed": {
            "type": "boolean",
            "description": "False when the pair was dismissed already."
          }
        }
      },
      "RetagPairEditionView": {
        "type": "object",
        "description": "An album's edition on a retag pair.",
        "required": [
          "release_group_mbid",
          "chosen",
          "custom"
        ],
        "properties": {
          "chosen": {
            "type": "boolean",
            "description": "Chosen by a person or carried over from v2."
          },
          "custom": {
            "type": "boolean",
            "description": "A custom edition is active. It does not carry over a join."
          },
          "release_group_mbid": {
            "type": "string"
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RetagPairJoinBody": {
        "type": "object",
        "description": "Join a retag pair.",
        "required": [
          "expected_identity_tokens"
        ],
        "properties": {
          "expected_identity_tokens": {
            "type": "object",
            "description": "Each album's `identity_token` as shown, by album id. Both albums\nmust be named.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "keep_edition_of": {
            "type": [
              "string",
              "null"
            ],
            "description": "The album whose chosen edition stays. Required when\n`editions_differ` is true, and must be absent otherwise."
          }
        }
      },
      "RetagPairJoinResponse": {
        "type": "object",
        "description": "A joined retag pair.",
        "required": [
          "album_id"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "The album that stays. The old album's id now opens it."
          }
        }
      },
      "RetagPairReasonView": {
        "type": "string",
        "description": "Why the scan left a retag pair for a person.",
        "enum": [
          "chosen_matches_differ",
          "tracks_elsewhere",
          "custom_edition",
          "replaced_hands_off"
        ]
      },
      "RetagPairView": {
        "type": "object",
        "description": "Two album rows that look like one retagged album, which the scan would\nnot join by itself.",
        "required": [
          "old_album",
          "new_album",
          "reason",
          "editions_differ",
          "recorded_at"
        ],
        "properties": {
          "editions_differ": {
            "type": "boolean",
            "description": "Two different chosen editions remain once a custom edition on the\nold album is left out: the join must name the one to keep."
          },
          "new_album": {
            "$ref": "#/components/schemas/RetagPairAlbumView",
            "description": "The row the files sit on now, or the album it was merged into\nsince. A join keeps this one."
          },
          "old_album": {
            "$ref": "#/components/schemas/RetagPairAlbumView",
            "description": "The row the files left. It holds the favorites, plays and links."
          },
          "reason": {
            "$ref": "#/components/schemas/RetagPairReasonView"
          },
          "recorded_at": {
            "type": "integer",
            "format": "int64",
            "description": "When the scan recorded the pair (Unix milliseconds)."
          }
        }
      },
      "RetryAllResponse": {
        "type": "object",
        "description": "Retry-all-failed outcome.",
        "required": [
          "retried"
        ],
        "properties": {
          "retried": {
            "type": "integer",
            "format": "int64",
            "description": "Failed downloads started again."
          }
        }
      },
      "RetryDownloadResponse": {
        "type": "object",
        "description": "Retry outcome: the new task carrying the retry.",
        "required": [
          "success",
          "task_id"
        ],
        "properties": {
          "success": {
            "type": "boolean"
          },
          "task_id": {
            "type": "string"
          }
        }
      },
      "ReviewActionBody": {
        "type": "object",
        "description": "An action on one review, decided on the revision the caller read.",
        "required": [
          "expected_revision"
        ],
        "properties": {
          "expected_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The review's `row_revision` when it was read. A review that changed\nsince is refused with `STALE_REVISION`."
          }
        }
      },
      "ReviewBulkBody": {
        "type": "object",
        "description": "A bulk review change: what to do, and to which reviews.",
        "required": [
          "action"
        ],
        "properties": {
          "action": {
            "$ref": "#/components/schemas/BulkAction"
          },
          "candidate_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Accept only: the release to use. Each review's best release when\nempty."
          },
          "filter": {
            "$ref": "#/components/schemas/ReviewsQuery",
            "description": "Reviews matching a list filter (paging is ignored)."
          },
          "preview_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "Apply only: the token the preview returned."
          },
          "review_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Reviews picked by hand. Combined with `filter` when both are given."
          }
        }
      },
      "ReviewBulkPreviewResponse": {
        "type": "object",
        "description": "What a bulk review change would do.",
        "required": [
          "matched",
          "eligible",
          "skipped",
          "preview_token",
          "shared_candidates"
        ],
        "properties": {
          "eligible": {
            "type": "integer",
            "format": "int32",
            "description": "Reviews the change would apply to.",
            "minimum": 0
          },
          "matched": {
            "type": "integer",
            "format": "int64",
            "description": "Reviews the selection matched.",
            "minimum": 0
          },
          "preview_token": {
            "type": "string",
            "description": "Pass back to apply exactly this change."
          },
          "shared_candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SharedCandidateView"
            },
            "description": "Releases every selected pending, unpinned review lists, best\nweakest score first; accept one for them all with its\n`candidate_key`. Empty when they share none."
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedReviews"
            },
            "description": "Reviews it would leave alone, grouped by why."
          }
        }
      },
      "ReviewBulkResponse": {
        "type": "object",
        "description": "What a bulk review change started.",
        "required": [
          "queued",
          "skipped"
        ],
        "properties": {
          "job": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OperationView"
              }
            ],
            "description": "The job; none when the preview left nothing to change."
          },
          "queued": {
            "type": "integer",
            "format": "int32",
            "description": "Reviews the job will change, each checked again when it is reached.",
            "minimum": 0
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedReviews"
            },
            "description": "Reviews the preview left alone, grouped by why."
          }
        }
      },
      "ReviewJobAction": {
        "type": "string",
        "description": "What a review job does to each of its reviews.",
        "enum": [
          "keep_tagged",
          "exclude",
          "accept",
          "retry"
        ]
      },
      "ReviewJobControl": {
        "type": "string",
        "description": "What to do with a review job.",
        "enum": [
          "pause",
          "resume",
          "stop"
        ]
      },
      "ReviewJobControlBody": {
        "type": "object",
        "description": "Pause, resume or stop a review job.",
        "required": [
          "control"
        ],
        "properties": {
          "control": {
            "$ref": "#/components/schemas/ReviewJobControl"
          }
        }
      },
      "ReviewJobView": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OperationView"
          },
          {
            "type": "object",
            "required": [
              "skipped"
            ],
            "properties": {
              "action": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/ReviewJobAction"
                  }
                ],
                "description": "What it does to each review; none when its work is gone."
              },
              "skipped": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SkippedReviews"
                },
                "description": "Reviews it left alone so far, grouped by why."
              }
            }
          }
        ],
        "description": "A review job: a bulk change or retry running in the background."
      },
      "ReviewJobsResponse": {
        "type": "object",
        "description": "The review jobs to show.",
        "required": [
          "jobs"
        ],
        "properties": {
          "jobs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewJobView"
            }
          }
        }
      },
      "ReviewResolveResponse": {
        "type": "object",
        "description": "Review resolution answer.",
        "required": [
          "review"
        ],
        "properties": {
          "identity": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/IdentityView"
              }
            ],
            "description": "Sealed identity (approvals only)."
          },
          "review": {
            "$ref": "#/components/schemas/ReviewView",
            "description": "The settled review."
          }
        }
      },
      "ReviewRetryAllBody": {
        "type": "object",
        "description": "Retry identification for many reviews.",
        "properties": {
          "confirm_local_metadata": {
            "type": "boolean",
            "description": "Confirms a one-off MusicBrainz lookup for files under a Local\nmetadata policy."
          },
          "filter": {
            "$ref": "#/components/schemas/ReviewsQuery",
            "description": "Pending reviews matching this list filter (paging is ignored)."
          },
          "preview": {
            "type": "boolean",
            "description": "Count what would start and why the rest would not; start nothing."
          },
          "scope_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Albums in these library folders and sub-folder rules, picked the\nway a scan picks them (overrides the filter's folder)."
          }
        }
      },
      "ReviewRetryAllResponse": {
        "type": "object",
        "description": "What a \"retry all\" started, or with `preview` would start.",
        "required": [
          "preview",
          "started",
          "skipped"
        ],
        "properties": {
          "job": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OperationView"
              }
            ],
            "description": "The job that retries them; none for a preview or when nothing was\npending."
          },
          "preview": {
            "type": "boolean",
            "description": "True when nothing started: the counts are what a real run would do."
          },
          "skipped": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SkippedReviews"
            },
            "description": "Preview only: reviews that would stay open, grouped by why."
          },
          "started": {
            "type": "integer",
            "format": "int32",
            "description": "Albums whose identification would start, or that the job will try.",
            "minimum": 0
          }
        }
      },
      "ReviewRetryBody": {
        "type": "object",
        "description": "Start identification again from a review.",
        "required": [
          "expected_revision"
        ],
        "properties": {
          "confirm_local_metadata": {
            "type": "boolean",
            "description": "Confirms a one-off MusicBrainz lookup for files under a Local\nmetadata policy."
          },
          "expected_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The review's `row_revision` when it was read."
          },
          "idempotency_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Makes a retried request return the same job (single review only)."
          }
        }
      },
      "ReviewSort": {
        "type": "string",
        "description": "How the review list is sorted.",
        "enum": [
          "newest",
          "oldest",
          "tracks",
          "title",
          "artist",
          "root",
          "reason"
        ]
      },
      "ReviewState": {
        "type": "string",
        "enum": [
          "pending",
          "approved",
          "rejected",
          "dismissed",
          "excluded"
        ]
      },
      "ReviewStateCounts": {
        "type": "object",
        "description": "Reviews matching a filter apart from its state, by state.",
        "required": [
          "pending",
          "approved",
          "rejected",
          "dismissed",
          "excluded"
        ],
        "properties": {
          "approved": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "dismissed": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "excluded": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "rejected": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ReviewView": {
        "type": "object",
        "description": "One identification review and the album it is about.",
        "required": [
          "id",
          "album_id",
          "album_title",
          "artist_name",
          "reason_code",
          "reason",
          "state",
          "candidates",
          "created_ms",
          "updated_ms",
          "manual_identity",
          "row_revision"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "Local album id."
          },
          "album_title": {
            "type": "string",
            "description": "Album title, as the library shows it."
          },
          "artist_name": {
            "type": "string",
            "description": "Album artist, as the library shows it."
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandidateView"
            },
            "description": "Scored candidates, best first."
          },
          "created_ms": {
            "type": "integer",
            "format": "int64",
            "description": "When the review was filed (Unix milliseconds)."
          },
          "id": {
            "type": "string",
            "description": "Review id."
          },
          "manual_identity": {
            "type": "boolean",
            "description": "The album's current match was picked by a person."
          },
          "reason": {
            "$ref": "#/components/schemas/ReasonView",
            "description": "Why the review exists and what to do, in plain words."
          },
          "reason_code": {
            "type": "string",
            "description": "Reason code the review was filed with."
          },
          "resolved_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Resolving user, once settled."
          },
          "row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Goes up whenever the review's state, candidates, reason or album\nchanges. Every action on the review sends the one it was decided\non."
          },
          "selected_candidate_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Selected candidate key, once approved."
          },
          "state": {
            "$ref": "#/components/schemas/ReviewState",
            "description": "Review state."
          },
          "updated_ms": {
            "type": "integer",
            "format": "int64",
            "description": "When it last changed (Unix milliseconds)."
          }
        }
      },
      "ReviewsQuery": {
        "type": "object",
        "description": "Review list filter and paging. A bulk change takes the same filter.",
        "properties": {
          "album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only this album's reviews."
          },
          "created_from": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Filed at or after this time (Unix milliseconds)."
          },
          "created_to": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Filed at or before this time (Unix milliseconds)."
          },
          "cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "`next_cursor` from the previous page."
          },
          "exclude_active_jobs": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Leave out albums whose identification is still queued or running."
          },
          "job_state": {
            "type": [
              "string",
              "null"
            ],
            "description": "Albums with an identification job in this state: `queued`,\n`running`, `deferred`, `succeeded`, `failed` or `attention`."
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Page size, 1 to 200 (default 50); more is read as 200.",
            "minimum": 0
          },
          "policy": {
            "type": [
              "string",
              "null"
            ],
            "description": "Albums with a file under this folder policy: `automatic`,\n`local_metadata` or `excluded`."
          },
          "reason_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only reviews filed with this reason code."
          },
          "root_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Albums with a file in this library folder."
          },
          "search": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title or artist contains this, ignoring case."
          },
          "sort": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ReviewSort"
              }
            ],
            "description": "Sort order; newest change first by default."
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": "`pending` (default), `approved`, `rejected`, `dismissed`,\n`excluded`, `resolved` (approved or dismissed) or `all`."
          },
          "updated_from": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Changed at or after this time (Unix milliseconds)."
          },
          "updated_to": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Changed at or before this time (Unix milliseconds)."
          },
          "with_candidates": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Only reviews that list at least one release."
          }
        }
      },
      "ReviewsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Page_ReviewView"
          },
          {
            "type": "object",
            "required": [
              "reason_counts",
              "state_counts"
            ],
            "properties": {
              "reason_counts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ReasonCount"
                },
                "description": "Reviews matching the filter apart from its reason, by reason."
              },
              "state_counts": {
                "$ref": "#/components/schemas/ReviewStateCounts",
                "description": "Reviews matching the filter apart from its state, by state."
              }
            }
          }
        ],
        "description": "One page of reviews, with the reviews matching the filter as its\ntotal."
      },
      "Role": {
        "type": "string",
        "description": "Account role. Meanings are unchanged from v2: `user` requests await\napproval; `trusted` and `admin` auto-approve and are quota-exempt.",
        "enum": [
          "user",
          "trusted",
          "admin"
        ]
      },
      "RoleUpdate": {
        "type": "object",
        "description": "Admin role change.",
        "required": [
          "role"
        ],
        "properties": {
          "role": {
            "$ref": "#/components/schemas/Role",
            "description": "New role."
          }
        }
      },
      "RunDetailResponse": {
        "type": "object",
        "description": "Run detail: the run, its scopes, and its discovered files.",
        "required": [
          "run",
          "scopes",
          "files"
        ],
        "properties": {
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanFileView"
            },
            "description": "Discovered files (bounded to the latest 500)."
          },
          "run": {
            "$ref": "#/components/schemas/ScanRunView",
            "description": "The run."
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanScopeView"
            },
            "description": "Scopes in the run."
          }
        }
      },
      "SabnzbdConnection": {
        "type": "object",
        "description": "SABnzbd connection. The key is the full key (the add-only nzbkey cannot\ndo queue/history/delete).",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Full API key (encrypted at rest).",
            "default": ""
          },
          "category": {
            "type": "string",
            "description": "Category (`*`: a fresh SABnzbd has no `droppedneedle` category).",
            "default": "*"
          },
          "downloads_mount": {
            "type": "string",
            "description": "Where DroppedNeedle sees SABnzbd's completed dir.",
            "default": "/sabnzbd-downloads"
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "priority": {
            "type": "integer",
            "format": "int64",
            "description": "Job priority.",
            "default": 0
          },
          "url": {
            "type": "string",
            "description": "SABnzbd base URL.",
            "default": ""
          }
        }
      },
      "ScanControlBody": {
        "type": "object",
        "description": "A pause, resume or stop request.",
        "required": [
          "expected_revision"
        ],
        "properties": {
          "expected_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The run's row revision as the caller last saw it.",
            "minimum": 0
          }
        }
      },
      "ScanControlResponse": {
        "type": "object",
        "description": "A run after pause, resume or stop.",
        "required": [
          "run_id",
          "state",
          "row_revision",
          "event_revision",
          "stream_revision"
        ],
        "properties": {
          "event_revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "row_revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "run_id": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/ScanState"
          },
          "stream_revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ScanDisposition": {
        "type": "string",
        "description": "How `request_run` disposed of a request.",
        "enum": [
          "started",
          "queued",
          "coalesced",
          "expanded",
          "conflict"
        ]
      },
      "ScanEstimateResponse": {
        "type": "object",
        "description": "Approximate size of a scan.",
        "required": [
          "approximate",
          "estimated_file_count",
          "estimated_at"
        ],
        "properties": {
          "approximate": {
            "type": "boolean",
            "description": "Always true: the count is catalog rows, not a fresh walk."
          },
          "estimated_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "When the count was taken (unix seconds)."
          },
          "estimated_file_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ScanFileVerdict": {
        "type": "string",
        "description": "Classify verdict. Its spelling is kept from v2, since the values are stored.",
        "enum": [
          "new",
          "changed",
          "unchanged",
          "excluded",
          "candidate_missing"
        ]
      },
      "ScanFileView": {
        "type": "object",
        "description": "One discovered file inside a run, with its scan-assigned track id.",
        "required": [
          "root_id",
          "relative_path",
          "verdict"
        ],
        "properties": {
          "relative_path": {
            "type": "string",
            "description": "Path relative to the root."
          },
          "root_id": {
            "type": "string",
            "description": "Root id."
          },
          "track_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Scan-assigned stable track id, once indexed."
          },
          "verdict": {
            "$ref": "#/components/schemas/ScanFileVerdict",
            "description": "Classify verdict."
          }
        }
      },
      "ScanFrequency": {
        "type": "string",
        "description": "Automatic-scan cadence values.",
        "enum": [
          "manual",
          "30min",
          "1hr",
          "6hr",
          "12hr",
          "24hr",
          "3d",
          "7d",
          "daily"
        ]
      },
      "ScanKind": {
        "type": "string",
        "description": "Scan kind. `rescan_files` re-reads every in-policy file even when its\nstat revision is unchanged; `policy_reconcile` walks but skips tag reads.",
        "enum": [
          "incremental",
          "rescan_files",
          "policy_reconcile"
        ]
      },
      "ScanKindBody": {
        "type": "string",
        "description": "Scan kind a caller can ask for.",
        "enum": [
          "incremental",
          "rescan_files",
          "policy_reconcile"
        ]
      },
      "ScanPhase": {
        "type": "string",
        "description": "A run's phase as the API reports it and the runs table stores it:\n`queued` before the run starts, then the phase it is in or reached.",
        "enum": [
          "queued",
          "discovering",
          "indexing",
          "reconciling"
        ]
      },
      "ScanRunCurrentResponse": {
        "type": "object",
        "description": "The run holding the worker and the next queued one.",
        "required": [
          "active",
          "queued"
        ],
        "properties": {
          "active": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScanRunView"
              }
            ]
          },
          "queued": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScanRunView"
              }
            ]
          }
        }
      },
      "ScanRunFailureItem": {
        "type": "object",
        "description": "One path a scan could not read or index.",
        "required": [
          "root_id",
          "relative_path",
          "failure_code",
          "message",
          "action",
          "failure_detail",
          "phase",
          "recorded_at"
        ],
        "properties": {
          "action": {
            "type": "string",
            "description": "What to do about it."
          },
          "failure_code": {
            "$ref": "#/components/schemas/FailureCode",
            "description": "Stable machine code, for example `TAG_READ_FAILED`."
          },
          "failure_detail": {
            "type": "string",
            "description": "Technical detail for diagnostics; not meant for display."
          },
          "message": {
            "type": "string",
            "description": "What happened, in plain words."
          },
          "phase": {
            "$ref": "#/components/schemas/ScanPhase",
            "description": "Phase the file failed in."
          },
          "recorded_at": {
            "type": "number",
            "format": "double",
            "description": "Unix seconds."
          },
          "relative_path": {
            "type": "string"
          },
          "root_id": {
            "type": "string"
          }
        }
      },
      "ScanRunRequestBody": {
        "type": "object",
        "description": "A scan request.",
        "properties": {
          "expected_policy_revision": {
            "type": "string",
            "description": "Policy revision from the library settings the caller last read.\nA request against older settings is refused with 409."
          },
          "kind": {
            "$ref": "#/components/schemas/ScanKindBody",
            "description": "What kind of scan to run."
          },
          "scope_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Root and path-rule ids to scan; empty means every root."
          }
        }
      },
      "ScanRunRequestedResponse": {
        "type": "object",
        "description": "Answer to a scan request.",
        "required": [
          "run_id",
          "disposition",
          "state",
          "row_revision",
          "queued_reason",
          "conflicting_kind"
        ],
        "properties": {
          "conflicting_kind": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScanKind"
              }
            ],
            "description": "Kind of the run in the way, on a conflict."
          },
          "disposition": {
            "$ref": "#/components/schemas/ScanDisposition"
          },
          "queued_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the request waits, when it does."
          },
          "row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "That run's row revision.",
            "minimum": 0
          },
          "run_id": {
            "type": "string",
            "description": "The run that will do the work."
          },
          "state": {
            "$ref": "#/components/schemas/ScanState",
            "description": "That run's state."
          }
        }
      },
      "ScanRunView": {
        "type": "object",
        "description": "One scan run.",
        "required": [
          "id",
          "kind",
          "trigger",
          "state",
          "phase",
          "aggregate_scope",
          "counters",
          "queued_at",
          "updated_at",
          "requested_control",
          "coalesced_request_count",
          "row_revision",
          "event_revision",
          "phase_timings"
        ],
        "properties": {
          "aggregate_scope": {
            "$ref": "#/components/schemas/AggregateScope"
          },
          "coalesced_request_count": {
            "type": "integer",
            "format": "int64",
            "description": "Requests folded into this run."
          },
          "counters": {
            "$ref": "#/components/schemas/Counters",
            "description": "Progress counters."
          },
          "event_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Event revision.",
            "minimum": 0
          },
          "id": {
            "type": "string",
            "description": "Run id."
          },
          "kind": {
            "$ref": "#/components/schemas/ScanKind",
            "description": "Run kind."
          },
          "phase": {
            "$ref": "#/components/schemas/ScanPhase",
            "description": "Current phase."
          },
          "phase_timings": {
            "type": "object",
            "description": "Seconds spent per phase.",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "queued_at": {
            "type": "number",
            "format": "double",
            "description": "Queue time (unix seconds)."
          },
          "requested_by_user_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Who asked for the run, when someone did."
          },
          "requested_control": {
            "$ref": "#/components/schemas/RequestedControl",
            "description": "Pending control."
          },
          "resume_phase": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScanPhase"
              }
            ],
            "description": "Phase a paused run picks up from."
          },
          "row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "Row revision; pause, resume and stop send it back.",
            "minimum": 0
          },
          "started_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Start time, when started."
          },
          "state": {
            "$ref": "#/components/schemas/ScanState",
            "description": "Run state."
          },
          "terminal_action": {
            "type": [
              "string",
              "null"
            ],
            "description": "What to do about the terminal code."
          },
          "terminal_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Terminal time, when terminal."
          },
          "terminal_code": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FailureCode"
              }
            ],
            "description": "Terminal code, when terminal."
          },
          "terminal_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "What the terminal code means, in plain words."
          },
          "trigger": {
            "$ref": "#/components/schemas/ScanTrigger",
            "description": "What triggered the run."
          },
          "updated_at": {
            "type": "number",
            "format": "double",
            "description": "Last update time."
          }
        }
      },
      "ScanScopeView": {
        "type": "object",
        "description": "One scope inside a run.",
        "required": [
          "root_id",
          "relative_path",
          "effective_policy"
        ],
        "properties": {
          "effective_policy": {
            "$ref": "#/components/schemas/EffectivePolicy",
            "description": "Effective policy for the scope."
          },
          "relative_path": {
            "type": "string",
            "description": "Path relative to the root."
          },
          "root_id": {
            "type": "string",
            "description": "Root id."
          }
        }
      },
      "ScanState": {
        "type": "string",
        "description": "A run's state, as the API reports it and the runs table stores it.",
        "enum": [
          "queued",
          "discovering",
          "indexing",
          "reconciling",
          "pausing",
          "paused",
          "stopping",
          "completed",
          "cancelled",
          "superseded_policy_changed",
          "failed"
        ]
      },
      "ScanTrigger": {
        "type": "string",
        "description": "What triggered the run.",
        "enum": [
          "manual",
          "automatic",
          "subsonic",
          "startup_resume",
          "policy_apply"
        ]
      },
      "ScriptNameSuggestion": {
        "type": "object",
        "description": "A misspelt name and the known name it is closest to.",
        "required": [
          "found",
          "name"
        ],
        "properties": {
          "found": {
            "type": "string",
            "description": "The name as the script wrote it."
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ScriptPreviewFault": {
        "type": "object",
        "description": "Why a script fails, and where.",
        "required": [
          "message",
          "line",
          "column"
        ],
        "properties": {
          "column": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "line": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "message": {
            "type": "string"
          },
          "suggestion": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScriptNameSuggestion"
              }
            ],
            "description": "The known name closest to the one the script misspelt."
          }
        }
      },
      "ScriptPreviewKind": {
        "type": "string",
        "description": "Which script is being written.",
        "enum": [
          "import_naming",
          "naming",
          "tagging"
        ]
      },
      "ScriptPreviewRequest": {
        "type": "object",
        "description": "A script to show against the example albums.",
        "required": [
          "kind",
          "source"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/ScriptPreviewKind"
          },
          "source": {
            "type": "string"
          }
        }
      },
      "ScriptPreviewResponse": {
        "type": "object",
        "description": "The script on every example album.",
        "required": [
          "samples"
        ],
        "properties": {
          "fault": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScriptPreviewFault"
              }
            ],
            "description": "Why the script does not compile or breaks a rule; the examples\nthen carry their values only."
          },
          "samples": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScriptPreviewSample"
            }
          }
        }
      },
      "ScriptPreviewSample": {
        "type": "object",
        "description": "The script on one example album.",
        "required": [
          "sample",
          "tags",
          "values"
        ],
        "properties": {
          "empty_name_parts": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The path's names as written, when one of them came out empty\n(each empty one as `\"\"`)."
          },
          "fault": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ScriptPreviewFault"
              }
            ],
            "description": "Why the script fails on this example."
          },
          "path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The path a naming script gives the example track."
          },
          "sample": {
            "$ref": "#/components/schemas/ExampleAlbum"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScriptTagChange"
            },
            "description": "The tags a tagging script changes, by name."
          },
          "values": {
            "type": "object",
            "description": "Every value the script can read here, as text.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ScriptTagChange": {
        "type": "object",
        "description": "One tag a tagging script changes; `after` is empty when it removes it.",
        "required": [
          "name",
          "before",
          "after"
        ],
        "properties": {
          "after": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "before": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ScrobbleNowPlayingRequest": {
        "type": "object",
        "description": "One native now-playing forward, by name.",
        "required": [
          "track_name",
          "artist_name"
        ],
        "properties": {
          "album_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track length in milliseconds, when known."
          },
          "mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recording MBID, when known."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release-group MBID, when known."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Playback source."
          },
          "track_name": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "ScrobblePreferences": {
        "type": "object",
        "description": "Per-user scrobble preferences.",
        "properties": {
          "auto_request_personal_mix": {
            "type": "boolean",
            "description": "Standing intent to auto-request the personal mix."
          },
          "auto_request_state": {
            "$ref": "#/components/schemas/MixGrantState",
            "description": "Standing-grant state for auto-request."
          },
          "navidrome_handles_external_scrobbles": {
            "type": "boolean",
            "description": "Navidrome owns external forwarding for Navidrome plays."
          },
          "now_playing_visibility": {
            "$ref": "#/components/schemas/NowPlayingVisibility",
            "description": "Who sees what the user plays."
          },
          "primary_music_source": {
            "$ref": "#/components/schemas/ListenSource",
            "description": "Where discovery reads the user's listening."
          },
          "scrobble_to_lastfm": {
            "type": "boolean",
            "description": "Forward plays to Last.fm."
          },
          "scrobble_to_listenbrainz": {
            "type": "boolean",
            "description": "Forward plays to ListenBrainz."
          }
        }
      },
      "ScrobblePreferencesUpdate": {
        "type": "object",
        "description": "Partial prefs update: absent fields keep their stored values.",
        "properties": {
          "auto_request_personal_mix": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "New personal-mix auto-request intent.",
            "default": null
          },
          "navidrome_handles_external_scrobbles": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "New Navidrome delegation switch.",
            "default": null
          },
          "now_playing_visibility": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NowPlayingVisibility"
              }
            ],
            "description": "New presence visibility.",
            "default": null
          },
          "primary_music_source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ListenSource"
              }
            ],
            "description": "New primary source.",
            "default": null
          },
          "scrobble_to_lastfm": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "New Last.fm forwarding switch.",
            "default": null
          },
          "scrobble_to_listenbrainz": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "New ListenBrainz forwarding switch.",
            "default": null
          }
        }
      },
      "ScrobbleResponse": {
        "type": "object",
        "description": "Answer to a scrobble or now-playing forward.",
        "required": [
          "accepted"
        ],
        "properties": {
          "accepted": {
            "type": "boolean",
            "description": "Whether the play counted. Submit is true when history recorded it,\neven with no linked account, and false when the play could not be\nsaved. Quirk (v2): now-playing is true only when at least one service\nhas it."
          },
          "services": {
            "type": "object",
            "description": "Per-service outcomes, keyed by service name.",
            "additionalProperties": {
              "$ref": "#/components/schemas/ServiceResult"
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "ScrobbleSubmitRequest": {
        "type": "object",
        "description": "One native scrobble, by name.",
        "required": [
          "track_name",
          "artist_name",
          "timestamp"
        ],
        "properties": {
          "album_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track length in milliseconds, when known."
          },
          "mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recording MBID, when known."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release-group MBID, when known."
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "Playback source."
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "description": "Play time, unix seconds."
          },
          "track_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The library track played. Files the play under that track, whose own\nrecording and release group replace any sent. Only for a play from\nthe library (source `local` or none)."
          },
          "track_name": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "SearchAlbumRequest": {
        "type": "object",
        "description": "Start a manual search for one album.",
        "required": [
          "artist_name",
          "album_title"
        ],
        "properties": {
          "album_title": {
            "type": "string",
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Album artist."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release group. An album the library already holds is not searched."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The edition to rank folders against (its tracklist)."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year, when known."
          }
        }
      },
      "SearchAlbumResponse": {
        "type": "object",
        "description": "What starting a search did.",
        "required": [
          "status"
        ],
        "properties": {
          "job_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The job to follow, while searching."
          },
          "status": {
            "type": "string",
            "description": "`searching`, or `already_in_library` when nothing was searched."
          }
        }
      },
      "SearchBucketResponse": {
        "type": "object",
        "description": "One bucket drill-down page.",
        "required": [
          "bucket",
          "limit",
          "offset",
          "results",
          "status"
        ],
        "properties": {
          "bucket": {
            "type": "string",
            "description": "Echoed bucket name."
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "description": "Echoed page size.",
            "minimum": 0
          },
          "offset": {
            "type": "integer",
            "format": "int32",
            "description": "Echoed offset.",
            "minimum": 0
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResultItem"
            },
            "description": "This page of hits, best first. Library rows page in step with\nMusicBrainz hits, so a page can hold up to `limit` of each."
          },
          "status": {
            "$ref": "#/components/schemas/SearchRemoteStatus",
            "description": "Provider health for this bucket."
          },
          "top_result": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchResultItem"
              }
            ],
            "description": "Standout hit, present only on the first page and only when one\nscored high enough to headline."
          }
        }
      },
      "SearchCandidateView": {
        "type": "object",
        "description": "One candidate as the search page shows it.",
        "required": [
          "candidate_index",
          "source",
          "title",
          "tier",
          "note",
          "files",
          "file_count",
          "size_bytes"
        ],
        "properties": {
          "candidate_index": {
            "type": "integer",
            "description": "Position in the job's list; send it back to pick this one.",
            "minimum": 0
          },
          "file_count": {
            "type": "integer",
            "description": "Files in the candidate (0 when the source does not say).",
            "minimum": 0
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandidateFile"
            },
            "description": "Files it would fetch, when the source lists them."
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Format label (`FLAC 24-bit`, `MP3 320`, `lossless`), when known."
          },
          "grabs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Usenet: how often it was grabbed, when the indexer says."
          },
          "has_free_slot": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Soulseek: the peer has a free upload slot."
          },
          "indexer": {
            "type": [
              "string",
              "null"
            ],
            "description": "Usenet: the indexer that listed it."
          },
          "length_misses": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Soulseek: held tracks whose length is unknown or off the edition's,\nwhen the tracklist is known.",
            "minimum": 0
          },
          "note": {
            "$ref": "#/components/schemas/CandidateNote",
            "description": "Why, in one sentence."
          },
          "posted_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Usenet: when it was posted (unix seconds)."
          },
          "queue_length": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Soulseek: files waiting in the peer's upload queue."
          },
          "refusal": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandidateRefusal"
            },
            "description": "Every way it is outside the download settings, the one to show\nfirst. Empty when it is inside them."
          },
          "score": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Plugin: the plugin's own score for it, from 0 to 1."
          },
          "size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Total size in bytes (0 when unknown).",
            "minimum": 0
          },
          "source": {
            "type": "string",
            "description": "`soulseek`, `usenet` or `plugin:<name>`."
          },
          "tier": {
            "$ref": "#/components/schemas/CandidateTier",
            "description": "How strongly it is recommended."
          },
          "title": {
            "type": "string",
            "description": "Folder name or release title."
          },
          "tracks_matched": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Edition tracks it holds (Soulseek, when the tracklist is known).",
            "minimum": 0
          },
          "tracks_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Tracks on the edition, when known.",
            "minimum": 0
          },
          "upload_speed": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Soulseek: the peer's upload speed in bytes per second."
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "description": "Soulseek peer or plugin account, when there is one."
          }
        }
      },
      "SearchJobResponse": {
        "type": "object",
        "description": "One manual search and what it found.",
        "required": [
          "job_id",
          "status",
          "artist_name",
          "album_title",
          "candidate_count",
          "candidates"
        ],
        "properties": {
          "album_title": {
            "type": "string"
          },
          "artist_name": {
            "type": "string"
          },
          "candidate_count": {
            "type": "integer",
            "minimum": 0
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchCandidateView"
            },
            "description": "Best first within each source; sources in the configured order."
          },
          "job_id": {
            "type": "string"
          },
          "reason": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DownloadReason"
              }
            ],
            "description": "Why the search failed or found nothing, and what to do."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The edition the candidates were ranked against."
          },
          "status": {
            "type": "string",
            "description": "`searching`, `completed`, `failed`, `matched` (a download started)\nor `cancelled`."
          },
          "task_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The download a pick started."
          },
          "tracks_total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Tracks on that edition, when its tracklist could be read.",
            "minimum": 0
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32"
          }
        }
      },
      "SearchJobUpdated": {
        "type": "object",
        "description": "`search_job_updated`: one of the user's manual album searches started,\nfinished, failed or was picked from. The web UI refetches the job.",
        "required": [
          "event_id",
          "job_id",
          "status",
          "candidate_count"
        ],
        "properties": {
          "candidate_count": {
            "type": "integer",
            "description": "Candidates found so far.",
            "minimum": 0
          },
          "event_id": {
            "type": "string",
            "description": "Id for de-duplication."
          },
          "job_id": {
            "type": "string",
            "description": "The search that moved."
          },
          "status": {
            "type": "string",
            "description": "Its status now: `searching`, `completed`, `failed`, `matched` or\n`cancelled`."
          }
        }
      },
      "SearchKind": {
        "type": "string",
        "description": "Which bucket a result came from.",
        "enum": [
          "artist",
          "album",
          "track"
        ]
      },
      "SearchRemoteStatus": {
        "type": "string",
        "description": "Per-bucket MusicBrainz health for one search call. The values match what\nthe web UI's notice and stale-time logic expects. Library hits show\nwhatever the status says.",
        "enum": [
          "ok",
          "partial",
          "timeout",
          "error",
          "stale"
        ]
      },
      "SearchRemoteTrackDetail": {
        "type": "object",
        "description": "What requesting a MusicBrainz song and showing its cover need: the\nrelease it is shown under (the one its request tries first), its group\nand the credited artist.",
        "required": [
          "release_group_mbid",
          "release_mbid"
        ],
        "properties": {
          "album_title": {
            "type": [
              "string",
              "null"
            ],
            "description": "The release's title."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "First credited artist."
          },
          "duration_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Recording length, whole seconds."
          },
          "release_group_mbid": {
            "type": "string",
            "description": "The release's group; covers come from it."
          },
          "release_mbid": {
            "type": "string",
            "description": "The release."
          }
        }
      },
      "SearchResponse": {
        "type": "object",
        "description": "Unified search response: one ranked list per bucket plus the standout\nhit per bucket, when one earns it.",
        "required": [
          "artists",
          "albums",
          "tracks",
          "artist_status",
          "album_status",
          "track_status"
        ],
        "properties": {
          "album_status": {
            "$ref": "#/components/schemas/SearchRemoteStatus",
            "description": "Provider health for the album bucket."
          },
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResultItem"
            },
            "description": "Matching albums, best first."
          },
          "artist_status": {
            "$ref": "#/components/schemas/SearchRemoteStatus",
            "description": "Provider health for the artist bucket."
          },
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResultItem"
            },
            "description": "Matching artists, best first."
          },
          "top_album": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchResultItem"
              }
            ],
            "description": "Standout album hit, if one scored high enough to headline."
          },
          "top_artist": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchResultItem"
              }
            ],
            "description": "Standout artist hit, if one scored high enough to headline."
          },
          "top_track": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchResultItem"
              }
            ],
            "description": "Standout track hit, if one scored high enough to headline."
          },
          "track_status": {
            "$ref": "#/components/schemas/SearchRemoteStatus",
            "description": "Provider health for the track bucket; `partial` while MusicBrainz's\nsongs are still on their way."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchResultItem"
            },
            "description": "Matching tracks, best first."
          }
        }
      },
      "SearchResultItem": {
        "type": "object",
        "description": "One search hit. Cover art is absent on purpose: the covers endpoints\nserve art by id, so search never duplicates those URLs.",
        "required": [
          "kind",
          "title",
          "in_library",
          "requested",
          "score",
          "art_missing"
        ],
        "properties": {
          "art_missing": {
            "type": "boolean",
            "description": "True when the server knows there is no cover to show: a library\nalbum, or a song's album, with no art of its own and no release\ngroup to look one up by. False means ask the cover routes."
          },
          "artist": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owning artist name, when the row has one."
          },
          "disambiguation": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz disambiguation comment."
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Library id, when the library holds this artist, album or track.\nAbsent for MusicBrainz hits the library lacks."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when the library holds this artist, album or song."
          },
          "kind": {
            "$ref": "#/components/schemas/SearchKind",
            "description": "Result bucket."
          },
          "musicbrainz_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz id: the hit's own for MusicBrainz hits, the match row's\nfor library rows. Absent means unidentified, never failure."
          },
          "remote_track": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchRemoteTrackDetail"
              }
            ],
            "description": "What requesting a song needs; present exactly when `kind` is\n`track` and the library lacks the song."
          },
          "requested": {
            "type": "boolean",
            "description": "True when an acquisition request is open for this album or song."
          },
          "score": {
            "type": "integer",
            "format": "int32",
            "description": "Match score, 0-100. MusicBrainz hits carry MusicBrainz's relevance;\nlibrary rows score 100 exact, 90 prefix, 70 substring, and songs\nmatched only through their artist or album 60. A MusicBrainz hit\nthe library holds carries the better of the two. Library rows that\nmatch exactly or as a prefix rank above every other row. Ranks\nhits, never filters them."
          },
          "title": {
            "type": "string",
            "description": "Display title (artist name, album title, or track title)."
          },
          "track": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchTrackDetail"
              }
            ],
            "description": "Library details of a song hit; present exactly when `kind` is\n`track` and the library holds the song."
          },
          "type_info": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist type, or an `Album + Live` style type label."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year, when known."
          }
        }
      },
      "SearchTrackDetail": {
        "type": "object",
        "description": "What playing a library song and linking its album need.",
        "required": [
          "album_id",
          "album_title",
          "disc_number",
          "track_number",
          "format",
          "cover_available"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "Owning library album id."
          },
          "album_title": {
            "type": "string",
            "description": "Album title as tagged on the track."
          },
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Library id of the first credited track artist, when credited."
          },
          "cover_available": {
            "type": "boolean",
            "description": "True when the owning album has artwork."
          },
          "disc_number": {
            "type": "integer",
            "format": "int64",
            "description": "Disc number."
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Duration, seconds, when probed."
          },
          "format": {
            "type": "string",
            "description": "Container or codec label, e.g. `flac`."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The album's release group, when identified; covers fall back to it."
          },
          "track_number": {
            "type": "integer",
            "format": "int64",
            "description": "Track number within the disc."
          }
        }
      },
      "SectionContent": {
        "oneOf": [
          {
            "type": "object",
            "description": "One shelf.",
            "required": [
              "shelf",
              "shape"
            ],
            "properties": {
              "shape": {
                "type": "string",
                "enum": [
                  "shelf"
                ]
              },
              "shelf": {
                "$ref": "#/components/schemas/ChartSection",
                "description": "The shelf."
              }
            }
          },
          {
            "type": "object",
            "description": "Several shelves (Daily Mixes, radio).",
            "required": [
              "shelves",
              "shape"
            ],
            "properties": {
              "shape": {
                "type": "string",
                "enum": [
                  "shelves"
                ]
              },
              "shelves": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/ChartSection"
                },
                "description": "The shelves."
              }
            }
          },
          {
            "type": "object",
            "description": "The \"because you listen to\" shelves.",
            "required": [
              "entries",
              "shape"
            ],
            "properties": {
              "entries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BecauseYouListenTo"
                },
                "description": "One per seed artist."
              },
              "shape": {
                "type": "string",
                "enum": [
                  "because"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "Top Picks.",
            "required": [
              "picks",
              "shape"
            ],
            "properties": {
              "picks": {
                "$ref": "#/components/schemas/TopPicksSection",
                "description": "The picks."
              },
              "shape": {
                "type": "string",
                "enum": [
                  "picks"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "The weekly exploration playlist.",
            "required": [
              "weekly",
              "shape"
            ],
            "properties": {
              "shape": {
                "type": "string",
                "enum": [
                  "weekly"
                ]
              },
              "weekly": {
                "$ref": "#/components/schemas/WeeklyExploration",
                "description": "The playlist."
              }
            }
          }
        ],
        "description": "A section's rows, tagged by `shape`."
      },
      "SectionItem": {
        "oneOf": [
          {
            "allOf": [
              {
                "$ref": "#/components/schemas/ArtistRef",
                "description": "An artist row."
              },
              {
                "type": "object",
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "artist"
                    ]
                  }
                }
              }
            ],
            "description": "An artist row."
          },
          {
            "allOf": [
              {
                "$ref": "#/components/schemas/AlbumRef",
                "description": "An album row."
              },
              {
                "type": "object",
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "album"
                    ]
                  }
                }
              }
            ],
            "description": "An album row."
          },
          {
            "allOf": [
              {
                "$ref": "#/components/schemas/TrackRef",
                "description": "A track row."
              },
              {
                "type": "object",
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "track"
                    ]
                  }
                }
              }
            ],
            "description": "A track row."
          },
          {
            "allOf": [
              {
                "$ref": "#/components/schemas/GenreRef",
                "description": "A genre row."
              },
              {
                "type": "object",
                "required": [
                  "kind"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "genre"
                    ]
                  }
                }
              }
            ],
            "description": "A genre row."
          }
        ],
        "description": "One row inside a section, tagged by `kind`."
      },
      "SectionKey": {
        "type": "string",
        "description": "One section of the home or discover page.",
        "enum": [
          "popular_albums",
          "trending_artists",
          "weekly_exploration",
          "your_top_albums",
          "recently_played",
          "recently_added",
          "genre_list",
          "favorite_artists",
          "library_artists",
          "library_albums",
          "discover_queue",
          "top_picks",
          "listeners_like_you",
          "playlist_discovery",
          "daily_mixes",
          "radio_sections",
          "because_you_listen_to",
          "artists_you_might_like",
          "popular_in_your_genres",
          "fresh_releases",
          "new_from_followed",
          "missing_essentials",
          "rediscover",
          "anniversaries",
          "lastfm_recent_scrobbles",
          "unexplored_genres",
          "globally_trending",
          "lastfm_weekly_artist_chart",
          "lastfm_weekly_album_chart"
        ]
      },
      "SectionKind": {
        "type": "string",
        "description": "What a section's rows are.",
        "enum": [
          "artists",
          "albums",
          "tracks",
          "genres"
        ]
      },
      "SectionPage": {
        "type": "string",
        "description": "A page whose sections a user can turn on and off.",
        "enum": [
          "home",
          "discover",
          "sidebar"
        ]
      },
      "SectionPrefItem": {
        "type": "object",
        "description": "One toggleable UI section.",
        "required": [
          "key",
          "title",
          "description",
          "zone",
          "enabled",
          "available",
          "turned_off"
        ],
        "properties": {
          "available": {
            "type": "boolean",
            "description": "Backend availability (requires + linked services)."
          },
          "description": {
            "type": "string",
            "description": "Description."
          },
          "enabled": {
            "type": "boolean",
            "description": "User toggle."
          },
          "key": {
            "type": "string",
            "description": "Section key."
          },
          "requires": {
            "type": [
              "string",
              "null"
            ],
            "description": "Service requirement, when any."
          },
          "title": {
            "type": "string",
            "description": "Display title."
          },
          "turned_off": {
            "type": "boolean",
            "description": "An admin switched off the service this section needs, so linking\nit would not make the section available."
          },
          "zone": {
            "type": "string",
            "description": "Layout zone."
          }
        }
      },
      "SectionPrefUpdateItem": {
        "type": "object",
        "description": "One section toggle update.",
        "required": [
          "key",
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "New toggle value."
          },
          "key": {
            "type": "string",
            "description": "Section key."
          }
        }
      },
      "SectionPrefsResponse": {
        "type": "object",
        "description": "Section prefs by page.",
        "properties": {
          "pages": {
            "type": "object",
            "description": "Sections per page (`home`, `discover`, `sidebar`).",
            "default": {},
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/SectionPrefItem"
              }
            },
            "propertyNames": {
              "type": "string"
            }
          }
        }
      },
      "SectionPrefsUpdate": {
        "type": "object",
        "description": "Section prefs update (one page per call).",
        "required": [
          "page",
          "sections"
        ],
        "properties": {
          "page": {
            "$ref": "#/components/schemas/SectionPage",
            "description": "Page to update."
          },
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SectionPrefUpdateItem"
            },
            "description": "Toggles to apply."
          }
        }
      },
      "SectionZone": {
        "type": "string",
        "description": "A group of sections on a page.",
        "enum": [
          "whats_hot",
          "for_you",
          "your_library",
          "browse_genres",
          "essentials",
          "made_for_you",
          "because_you_listened",
          "new_and_fresh",
          "from_your_library",
          "trending_now"
        ]
      },
      "SecuritySettings": {
        "type": "object",
        "description": "Security posture settings (no secrets; the HIBP path is a local file).",
        "properties": {
          "content_security_policy": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ContentSecurityPolicyMode"
              }
            ],
            "description": "How the web UI's content-security policy is sent.",
            "default": "enforce"
          },
          "frame_ancestors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Up to eight origins that may show DroppedNeedle in a frame, such as\na dashboard at `https://home.example.com`. Empty: nobody may.\nStored the way a browser sends `Origin`.",
            "default": []
          },
          "hibp_check": {
            "type": "boolean",
            "description": "Check passwords against Have-I-Been-Pwned.",
            "default": true
          },
          "hibp_local_path": {
            "type": "string",
            "description": "Local HIBP file; used instead of the API when present.",
            "default": ""
          },
          "hsts_include_subdomains": {
            "type": "boolean",
            "description": "HSTS include-subdomains flag.",
            "default": false
          },
          "hsts_max_age": {
            "type": "integer",
            "format": "int64",
            "description": "HSTS max-age in seconds; 0 disables.",
            "default": 0
          },
          "hsts_preload": {
            "type": "boolean",
            "description": "HSTS preload flag.",
            "default": false
          },
          "library_download_access": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DownloadAccess"
              }
            ],
            "description": "Who may download library files.",
            "default": "everyone"
          }
        }
      },
      "ServerWrappedResponse": {
        "type": "object",
        "description": "Server-wide year-in-review.",
        "required": [
          "year",
          "total_users_tracked",
          "total_listens_estimated",
          "leaderboard"
        ],
        "properties": {
          "leaderboard": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WrappedLeaderboardEntry"
            },
            "description": "Per-user listener leaderboard."
          },
          "top_album_sitewide": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WrappedAlbum"
              }
            ],
            "description": "Sitewide top album when known."
          },
          "top_artist_sitewide": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WrappedArtist"
              }
            ],
            "description": "Sitewide top artist when known."
          },
          "total_listens_estimated": {
            "type": "integer",
            "format": "int64",
            "description": "Estimated total listens."
          },
          "total_users_tracked": {
            "type": "integer",
            "format": "int32",
            "description": "Users included in the stats."
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "Year the stats cover."
          }
        }
      },
      "ServiceHealthItem": {
        "type": "object",
        "description": "One degraded service capability (v2 `ServiceHealthItem`).",
        "required": [
          "service",
          "capability",
          "severity",
          "message",
          "degraded_seconds"
        ],
        "properties": {
          "capability": {
            "type": "string",
            "description": "What is affected, e.g. `metadata`."
          },
          "degraded_seconds": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds since the service was first seen degraded.",
            "minimum": 0
          },
          "fallback": {
            "type": [
              "string",
              "null"
            ],
            "description": "Service used instead. No v3 source names one yet, so it is null."
          },
          "message": {
            "type": "string",
            "description": "One user-facing line."
          },
          "service": {
            "type": "string",
            "description": "Lowercase service key, e.g. `musicbrainz`."
          },
          "severity": {
            "type": "string",
            "description": "Always `degraded`; v2 also defined `down` but never sent it."
          }
        }
      },
      "ServicePrompt": {
        "type": "object",
        "description": "A card nudging the user to connect a service.",
        "required": [
          "service",
          "title",
          "description",
          "icon",
          "color",
          "features"
        ],
        "properties": {
          "color": {
            "type": "string",
            "description": "Accent color token."
          },
          "description": {
            "type": "string",
            "description": "Card body."
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Feature bullets."
          },
          "icon": {
            "type": "string",
            "description": "Icon name."
          },
          "service": {
            "$ref": "#/components/schemas/PromptService",
            "description": "The service to connect."
          },
          "title": {
            "type": "string",
            "description": "Card title."
          }
        }
      },
      "ServiceResult": {
        "type": "object",
        "description": "Per-service forwarding outcome. Delivery runs in the background, so this\nsays the report is waiting to be sent, not that the service took it.",
        "required": [
          "queued"
        ],
        "properties": {
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the report is not waiting (the play was not saved)."
          },
          "queued": {
            "type": "boolean",
            "description": "True when the report is waiting for that service. A scrobble waits\nin a kept queue and is sent, retried while the service is down,\nwithin two weeks of the play; a now-playing report is sent once."
          }
        }
      },
      "ServiceState": {
        "type": "string",
        "description": "How a listening service fared in a discover build.",
        "enum": [
          "degraded",
          "unavailable"
        ]
      },
      "SessionKind": {
        "type": "string",
        "description": "Session kind, v2 `session_kind` values kept verbatim.",
        "enum": [
          "standard",
          "companion"
        ]
      },
      "SessionListResponse": {
        "type": "object",
        "description": "Own sessions.",
        "required": [
          "sessions"
        ],
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionView"
            },
            "description": "All live sessions, current first."
          }
        }
      },
      "SessionView": {
        "type": "object",
        "description": "One session row for the sessions UI.",
        "required": [
          "id",
          "kind",
          "label",
          "created_at",
          "last_seen_at",
          "expires_at",
          "current"
        ],
        "properties": {
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Issue time, unix seconds."
          },
          "current": {
            "type": "boolean",
            "description": "True for the session making this request."
          },
          "expires_at": {
            "type": "integer",
            "format": "int64",
            "description": "Absolute expiry, unix seconds."
          },
          "id": {
            "type": "string",
            "description": "Session id."
          },
          "kind": {
            "$ref": "#/components/schemas/SessionKind",
            "description": "Browser or companion-device session."
          },
          "label": {
            "type": "string",
            "description": "Companion device name, or the browser user agent."
          },
          "last_seen_at": {
            "type": "integer",
            "format": "int64",
            "description": "Last use time, unix seconds."
          }
        }
      },
      "SetArtistLinkBody": {
        "type": "object",
        "description": "Link an artist to a MusicBrainz artist.",
        "required": [
          "musicbrainz_artist_id",
          "expected_revision"
        ],
        "properties": {
          "expected_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The `artist_revision` as last read."
          },
          "musicbrainz_artist_id": {
            "type": "string",
            "description": "The MusicBrainz artist id."
          }
        }
      },
      "SetFavoriteBody": {
        "type": "object",
        "description": "Set-favorite body.",
        "required": [
          "favorited"
        ],
        "properties": {
          "favorited": {
            "type": "boolean",
            "description": "True favorites the item; false unfavorites it."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name to keep, when favoriting."
          }
        }
      },
      "SetRatingBody": {
        "type": "object",
        "description": "Set-rating body.",
        "required": [
          "rating"
        ],
        "properties": {
          "rating": {
            "type": "integer",
            "format": "int32",
            "description": "1 to 5 stars, or 0 to clear the rating.",
            "minimum": 0
          }
        }
      },
      "SetupBody": {
        "type": "object",
        "description": "First-admin setup body. Runs only against an empty user table.",
        "required": [
          "username",
          "password"
        ],
        "properties": {
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "The code from the server log, when the setup status asks for one."
          },
          "display_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name; defaults to the username casing."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional email."
          },
          "password": {
            "type": "string",
            "description": "Initial password, at least 12 chars."
          },
          "transport": {
            "$ref": "#/components/schemas/TransportDto",
            "description": "Credential handoff; defaults to cookie."
          },
          "username": {
            "type": "string",
            "description": "Login username, 3-32 chars."
          }
        }
      },
      "SetupStatusBody": {
        "type": "object",
        "description": "Setup-required probe for the SPA first-run gate.",
        "required": [
          "setup_required",
          "code_required"
        ],
        "properties": {
          "code_required": {
            "type": "boolean",
            "description": "True when setup also needs the code from the server log: the server\nwas started fresh from v2 and no account exists yet."
          },
          "setup_required": {
            "type": "boolean",
            "description": "True when no users exist yet and setup must run."
          }
        }
      },
      "SharedCandidateView": {
        "type": "object",
        "description": "A release every selected review lists.",
        "required": [
          "candidate_key",
          "release_group_mbid",
          "album_title",
          "album_artist_name",
          "lowest_score"
        ],
        "properties": {
          "album_artist_name": {
            "type": "string"
          },
          "album_title": {
            "type": "string"
          },
          "candidate_key": {
            "type": "string",
            "description": "Accept the selection with this key."
          },
          "lowest_score": {
            "type": "number",
            "format": "double",
            "description": "Its weakest match score across the selected reviews."
          },
          "release_group_mbid": {
            "type": "string"
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ShelfSource": {
        "type": "string",
        "description": "Where a shelf's rows came from.",
        "enum": [
          "listenbrainz",
          "lastfm",
          "blended",
          "jellyfin",
          "musicbrainz",
          "library",
          "local"
        ]
      },
      "SimilarAlbumsResponse": {
        "type": "object",
        "description": "`GET /albums/{album_id}/similar`.",
        "required": [
          "albums",
          "source",
          "configured"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumRef"
            },
            "description": "Albums by similar artists."
          },
          "configured": {
            "type": "boolean",
            "description": "False when ListenBrainz is not set up."
          },
          "source": {
            "$ref": "#/components/schemas/ListenSource",
            "description": "Provider that answered."
          }
        }
      },
      "SimilarArtistsResponse": {
        "type": "object",
        "description": "`GET /artists/{artist_mbid}/similar`.",
        "required": [
          "similar_artists",
          "source",
          "configured",
          "asked_source",
          "unavailable_sources",
          "needs_account"
        ],
        "properties": {
          "asked_source": {
            "$ref": "#/components/schemas/ListenSource",
            "description": "The source the caller asked for (or the preferred one). When it\ndiffers from `source`, the other service stood in."
          },
          "configured": {
            "type": "boolean",
            "description": "False when the provider is not set up; the list is then empty."
          },
          "needs_account": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListenSource"
            },
            "description": "Services that give this list only to an account the person has not\nlinked (ListenBrainz's popular songs and albums). Not a failure."
          },
          "similar_artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistRef"
            },
            "description": "Similar artists, most similar first."
          },
          "source": {
            "$ref": "#/components/schemas/ListenSource",
            "description": "Provider that answered."
          },
          "unavailable_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListenSource"
            },
            "description": "Services that failed, or are switched off, while the list was built."
          }
        }
      },
      "SiteAppearance": {
        "type": "object",
        "description": "The site's appearance as every signed-in person reads it.",
        "required": [
          "css",
          "allow_user_css"
        ],
        "properties": {
          "allow_user_css": {
            "type": "boolean",
            "description": "Whether people's own CSS applies."
          },
          "css": {
            "type": "string",
            "description": "CSS loaded under every person's own."
          }
        }
      },
      "SkippedReviews": {
        "type": "object",
        "description": "Reviews one reason held back.",
        "required": [
          "reason",
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "reason": {
            "$ref": "#/components/schemas/ReasonView"
          }
        }
      },
      "SlskdConnection": {
        "type": "object",
        "description": "slskd download-client connection. Quality, timeouts and retries live in\nthe download policy.",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "API key (encrypted at rest).",
            "default": ""
          },
          "downloads_subpath": {
            "type": "string",
            "description": "Relative subpath inside the mount where slskd saves (confined).",
            "default": ""
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          },
          "slskd_incomplete_mount": {
            "type": "string",
            "description": "Absolute incomplete-downloads dir (\"\" disables the fallback).",
            "default": ""
          },
          "url": {
            "type": "string",
            "description": "slskd base URL.",
            "default": ""
          }
        }
      },
      "SlskdStatusResponse": {
        "type": "object",
        "description": "Live slskd client status. The mount check belongs to the downloads\nmodule.",
        "required": [
          "configured",
          "reachable",
          "message"
        ],
        "properties": {
          "configured": {
            "type": "boolean",
            "description": "Credentials/URL present."
          },
          "effective_downloads_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "The folder DroppedNeedle reads: the mount plus the downloads\nsubfolder."
          },
          "message": {
            "type": "string",
            "description": "User-safe summary."
          },
          "mount": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DownloadsMountView"
              }
            ],
            "description": "The downloads mount, once the first probe pass checked it."
          },
          "mount_advisory": {
            "type": [
              "string",
              "null"
            ],
            "description": "One plain sentence when the mount looks fine but cannot see slskd's\nfinished downloads, with what to change."
          },
          "reachable": {
            "type": "boolean",
            "description": "Live probe answered."
          },
          "slskd_downloads_dir": {
            "type": [
              "string",
              "null"
            ],
            "description": "slskd's own downloads folder (in slskd's container), when slskd\nreported it."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "slskd version, when the probe reached it."
          }
        }
      },
      "SourceName": {
        "type": "string",
        "description": "Which remote source a view or id belongs to.",
        "enum": [
          "jellyfin",
          "navidrome",
          "plex"
        ]
      },
      "SourcePriorityOrder": {
        "type": "object",
        "description": "Acquisition source try-order, e.g. `[\"soulseek\", \"usenet\"]`. Bundled\nsources are always present; well-formed `plugin:<name>` keys pass\nthrough order-preserved; anything else is dropped.",
        "properties": {
          "order": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Try-order, best first.",
            "default": []
          }
        }
      },
      "SourceReference": {
        "type": "object",
        "required": [
          "provider",
          "entity_type",
          "external_id",
          "canonical_url",
          "fetched_at"
        ],
        "properties": {
          "canonical_url": {
            "type": "string"
          },
          "entity_type": {
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "fetched_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "provider": {
            "type": "string"
          }
        }
      },
      "SourceStatus": {
        "type": "string",
        "description": "How one optional source fared while a page was built. Sources that\nanswered normally are left out of the map.",
        "enum": [
          "degraded",
          "error"
        ]
      },
      "SpotifyAuthUrlResponse": {
        "type": "object",
        "description": "Authorize URL for the caller's Spotify link flow.",
        "required": [
          "auth_url"
        ],
        "properties": {
          "auth_url": {
            "type": "string",
            "description": "`accounts.spotify.com/authorize` URL with state."
          }
        }
      },
      "SpotifyImportRequest": {
        "type": "object",
        "description": "Import start.",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name for the internal playlist record."
          }
        }
      },
      "SpotifyImportResponse": {
        "type": "object",
        "description": "Import acknowledgement. The populate runs\nas the `spotify:import` durable job; the id is usable immediately.",
        "required": [
          "playlist_id"
        ],
        "properties": {
          "playlist_id": {
            "type": "string",
            "description": "Internal playlist id."
          }
        }
      },
      "SpotifyPlaylistItem": {
        "type": "object",
        "description": "One owned Spotify playlist.",
        "required": [
          "id",
          "name",
          "description",
          "track_count",
          "owner"
        ],
        "properties": {
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Picked cover URL, smallest image at least 250 wide."
          },
          "description": {
            "type": "string",
            "description": "Playlist description."
          },
          "id": {
            "type": "string",
            "description": "Spotify playlist id."
          },
          "imported_playlist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Internal playlist id when already imported, else null."
          },
          "name": {
            "type": "string",
            "description": "Playlist name."
          },
          "owner": {
            "type": "string",
            "description": "Owner display name."
          },
          "track_count": {
            "type": "integer",
            "format": "int64",
            "description": "Track total from the `items`/`tracks` dict quirk."
          }
        }
      },
      "SpotifyPlaylistListResponse": {
        "type": "object",
        "description": "Owned playlists.",
        "required": [
          "playlists"
        ],
        "properties": {
          "playlists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SpotifyPlaylistItem"
            },
            "description": "Playlists owned by the caller's Spotify account."
          }
        }
      },
      "SpotifyRedirectUri": {
        "type": "object",
        "description": "The computed OAuth redirect URI.",
        "required": [
          "redirect_uri"
        ],
        "properties": {
          "redirect_uri": {
            "type": "string",
            "description": "Byte-exact URI registered in the Spotify dashboard."
          }
        }
      },
      "SpotifySettings": {
        "type": "object",
        "description": "Admin Spotify app settings (issue #298).",
        "required": [
          "client_id",
          "client_secret",
          "enabled",
          "spotify_redirect_origin"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "description": "Spotify app client id, returned unmasked."
          },
          "client_secret": {
            "type": "string",
            "description": "Spotify app secret, encrypted at rest, masked on read."
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch for Spotify OAuth."
          },
          "spotify_redirect_origin": {
            "type": "string",
            "description": "Optional absolute origin the OAuth redirect URI is built from."
          }
        }
      },
      "StatsRange": {
        "type": "string",
        "description": "A listening-statistics window: the chart pages' `range`, and the\nListenBrainz statistics range.",
        "enum": [
          "this_week",
          "this_month",
          "this_year",
          "all_time"
        ]
      },
      "StatsView": {
        "type": "object",
        "description": "Library totals. Track and size totals count streamable tracks only.",
        "required": [
          "total_albums",
          "total_artists",
          "total_tracks",
          "total_size_bytes",
          "format_breakdown",
          "favorite_albums",
          "favorite_artists",
          "favorite_tracks",
          "review_count",
          "guess_count",
          "not_found_count",
          "looks_wrong_count",
          "check_count",
          "local_only_count"
        ],
        "properties": {
          "check_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums to check, each once: a best guess, marked \"Looks wrong\" or\nwith an open review.",
            "minimum": 0
          },
          "favorite_albums": {
            "type": "integer",
            "format": "int64",
            "description": "Albums the caller favorited.",
            "minimum": 0
          },
          "favorite_artists": {
            "type": "integer",
            "format": "int64",
            "description": "Artists the caller favorited.",
            "minimum": 0
          },
          "favorite_tracks": {
            "type": "integer",
            "format": "int64",
            "description": "Tracks the caller favorited.",
            "minimum": 0
          },
          "format_breakdown": {
            "type": "object",
            "description": "Streamable-track counts by format label.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "guess_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums whose edition is a best guess.",
            "minimum": 0
          },
          "last_scan_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "When the last library scan finished successfully, unix seconds."
          },
          "local_only_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums with streamable tracks and no MusicBrainz identity.",
            "minimum": 0
          },
          "looks_wrong_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums someone marked \"Looks wrong\".",
            "minimum": 0
          },
          "not_found_count": {
            "type": "integer",
            "format": "int64",
            "description": "Albums nothing on MusicBrainz fits.",
            "minimum": 0
          },
          "review_count": {
            "type": "integer",
            "format": "int64",
            "description": "Identification reviews waiting on a person (\"Needs you\").",
            "minimum": 0
          },
          "total_albums": {
            "type": "integer",
            "format": "int64",
            "description": "Albums in the catalog.",
            "minimum": 0
          },
          "total_artists": {
            "type": "integer",
            "format": "int64",
            "description": "Artists in the catalog.",
            "minimum": 0
          },
          "total_size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "Summed streamable-track size, bytes."
          },
          "total_tracks": {
            "type": "integer",
            "format": "int64",
            "description": "Streamable tracks in the catalog.",
            "minimum": 0
          }
        }
      },
      "StatusMessage": {
        "type": "object",
        "description": "Plain status answer for uninstalls and disconnects.",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human detail."
          },
          "status": {
            "type": "string",
            "description": "`ok`."
          }
        }
      },
      "StatusResponse": {
        "type": "object",
        "description": "Generic status answer for deletes.",
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human message."
          },
          "status": {
            "type": "string",
            "description": "Always \"ok\"."
          }
        }
      },
      "StopRetriesResponse": {
        "type": "object",
        "description": "Stop-all-retries outcome.",
        "required": [
          "stopped"
        ],
        "properties": {
          "stopped": {
            "type": "integer",
            "format": "int64",
            "description": "Scheduled retries stopped."
          }
        }
      },
      "StreamEvent": {
        "oneOf": [
          {
            "type": "object",
            "description": "To everyone: library activity revisions moved.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/ActivityChanged",
                "description": "To everyone: library activity revisions moved."
              },
              "event": {
                "type": "string",
                "enum": [
                  "activity.changed"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To everyone: live listening sessions.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/NowPlayingSnapshot",
                "description": "To everyone: live listening sessions."
              },
              "event": {
                "type": "string",
                "enum": [
                  "snapshot"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To everyone: the download queue moved.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/DownloadsChanged",
                "description": "To everyone: the download queue moved."
              },
              "event": {
                "type": "string",
                "enum": [
                  "downloads.changed"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To everyone: library image precache progress.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/CacheSyncProgress",
                "description": "To everyone: library image precache progress."
              },
              "event": {
                "type": "string",
                "enum": [
                  "cache.sync"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: the wanted watcher found new candidates.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/WantedNotice",
                "description": "To one user: the wanted watcher found new candidates."
              },
              "event": {
                "type": "string",
                "enum": [
                  "wanted_new_candidates"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: the wanted watcher started a download.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/WantedNotice",
                "description": "To one user: the wanted watcher started a download."
              },
              "event": {
                "type": "string",
                "enum": [
                  "wanted_auto_dispatched"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: a wanted album reached the library.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/WantedNotice",
                "description": "To one user: a wanted album reached the library."
              },
              "event": {
                "type": "string",
                "enum": [
                  "wanted_fulfilled"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: a followed artist's new release was queued.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/AutoDownloadEnqueued",
                "description": "To one user: a followed artist's new release was queued."
              },
              "event": {
                "type": "string",
                "enum": [
                  "auto_download_enqueued"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: someone else imported an album they requested.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/RequestImported",
                "description": "To one user: someone else imported an album they requested."
              },
              "event": {
                "type": "string",
                "enum": [
                  "request_imported"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: an imported playlist has its tracks.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/PlaylistImported",
                "description": "To one user: an imported playlist has its tracks."
              },
              "event": {
                "type": "string",
                "enum": [
                  "playlist_imported"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: their drop-import job moved.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/DropImportUpdated",
                "description": "To one user: their drop-import job moved."
              },
              "event": {
                "type": "string",
                "enum": [
                  "drop_import_updated"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: their weekly mix was rebuilt, or could not be.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/PersonalMixRefreshed",
                "description": "To one user: their weekly mix was rebuilt, or could not be."
              },
              "event": {
                "type": "string",
                "enum": [
                  "personal_mix_refreshed"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: new concerts for an artist they follow.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/ConcertsNew",
                "description": "To one user: new concerts for an artist they follow."
              },
              "event": {
                "type": "string",
                "enum": [
                  "concerts_new"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: one of their downloads moved.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/DownloadProgress",
                "description": "To one user: one of their downloads moved."
              },
              "event": {
                "type": "string",
                "enum": [
                  "download_progress"
                ]
              }
            }
          },
          {
            "type": "object",
            "description": "To one user: one of their manual album searches moved.",
            "required": [
              "data",
              "event"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/SearchJobUpdated",
                "description": "To one user: one of their manual album searches moved."
              },
              "event": {
                "type": "string",
                "enum": [
                  "search_job_updated"
                ]
              }
            }
          }
        ],
        "description": "The events the stream sends, keyed by name, for the API document. On\nthe wire each one is an SSE frame whose `event:` line is `event` here\nand whose `data:` line is `data` as JSON. The hub encodes frames itself\n(`Frame::encode`); this type only describes them."
      },
      "SuggestResponse": {
        "type": "object",
        "description": "Typeahead response: one merged list across buckets, best first.",
        "required": [
          "results",
          "status"
        ],
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SuggestResult"
            },
            "description": "Suggestions, best first."
          },
          "status": {
            "$ref": "#/components/schemas/SearchRemoteStatus",
            "description": "Provider health for the suggestion call."
          }
        }
      },
      "SuggestResult": {
        "type": "object",
        "description": "One typeahead suggestion.",
        "required": [
          "kind",
          "title",
          "in_library",
          "requested",
          "score"
        ],
        "properties": {
          "artist": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owning artist name, when the row has one."
          },
          "disambiguation": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz disambiguation comment."
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Library id, when the library holds it."
          },
          "in_library": {
            "type": "boolean",
            "description": "True when the library holds it."
          },
          "kind": {
            "$ref": "#/components/schemas/SearchKind",
            "description": "Suggestion bucket."
          },
          "musicbrainz_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz id, when known."
          },
          "requested": {
            "type": "boolean",
            "description": "True when an acquisition request is open for this album."
          },
          "score": {
            "type": "integer",
            "format": "int32",
            "description": "Match score, 0-100, same scale as full search."
          },
          "title": {
            "type": "string",
            "description": "Display title."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year, when known."
          }
        }
      },
      "SuggestedEditionView": {
        "type": "object",
        "description": "The edition a preparation suggests for an album.",
        "required": [
          "release_mbid",
          "release_group_mbid",
          "title",
          "track_count",
          "competing_count"
        ],
        "properties": {
          "auto_gate": {
            "type": [
              "string",
              "null"
            ],
            "description": "With automatic edition acceptance on: `AUTO_ACCEPT`, or why the\nsuggestion waits for a person."
          },
          "competing_count": {
            "type": "integer",
            "format": "int32",
            "description": "How many editions fit the files.",
            "minimum": 0
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "date": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_group_mbid": {
            "type": "string"
          },
          "release_mbid": {
            "type": "string"
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "track_count": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "SuggestionReason": {
        "type": "string",
        "description": "Why a track was suggested: the pool it came from.",
        "enum": [
          "recent",
          "rediscover",
          "surprise",
          "same_era"
        ]
      },
      "SuggestionTrack": {
        "type": "object",
        "description": "One suggested track, tagged with why it was picked.",
        "required": [
          "track_id",
          "title",
          "album_title",
          "artist_name",
          "album_id",
          "cover_available",
          "format",
          "reason"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "Owning local album id."
          },
          "album_title": {
            "type": "string",
            "description": "Album title."
          },
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Local track-artist id, when credited."
          },
          "artist_name": {
            "type": "string",
            "description": "Track artist display name."
          },
          "cover_available": {
            "type": "boolean",
            "description": "True when the owning album has a folder image or an embedded picture."
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Duration, seconds."
          },
          "format": {
            "type": "string",
            "description": "Container or codec label."
          },
          "reason": {
            "$ref": "#/components/schemas/SuggestionReason",
            "description": "Which pool the track came from."
          },
          "title": {
            "type": "string",
            "description": "Track title."
          },
          "track_id": {
            "type": "string",
            "description": "Local track id."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Release year, when known."
          }
        }
      },
      "SuggestionsResponse": {
        "type": "object",
        "description": "Suggestion listing.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SuggestionTrack"
            },
            "description": "Reason-tagged tracks, pools interleaved."
          }
        }
      },
      "SystemHealthResponse": {
        "type": "object",
        "description": "Degraded services, empty when everything is healthy (v2\n`SystemHealthResponse`).",
        "required": [
          "degraded"
        ],
        "properties": {
          "degraded": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceHealthItem"
            },
            "description": "Live degraded entries, sorted by service then capability."
          }
        }
      },
      "TaggingScript": {
        "type": "object",
        "description": "One tagging script.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Script id.",
            "default": ""
          },
          "name": {
            "type": "string",
            "description": "Display name.",
            "default": ""
          },
          "preset_origin": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preset origin.",
            "default": null
          },
          "preset_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Preset version.",
            "default": null
          },
          "revision": {
            "type": "string",
            "description": "Content revision.",
            "default": ""
          },
          "source": {
            "type": "string",
            "description": "Script source.",
            "default": ""
          }
        }
      },
      "TaskStatus": {
        "type": "string",
        "description": "Persisted download-task status.",
        "enum": [
          "queued",
          "downloading",
          "processing",
          "completed",
          "partial",
          "failed",
          "cancelled"
        ]
      },
      "TestConnectionResponse": {
        "type": "object",
        "description": "slskd test verdict: validity plus the reported version.",
        "required": [
          "valid",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human summary."
          },
          "valid": {
            "type": "boolean",
            "description": "Whether the submitted values checked out."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Server version, when known."
          }
        }
      },
      "ThemeChoice": {
        "type": "string",
        "description": "The theme a person chose.",
        "enum": [
          "system",
          "light",
          "dark",
          "midnight"
        ]
      },
      "TopAlbumsResponse": {
        "type": "object",
        "description": "`GET /artists/{artist_mbid}/top-albums`.",
        "required": [
          "albums",
          "source",
          "configured",
          "asked_source",
          "unavailable_sources",
          "needs_account"
        ],
        "properties": {
          "albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlbumRef"
            },
            "description": "Albums, most played first."
          },
          "asked_source": {
            "$ref": "#/components/schemas/ListenSource",
            "description": "The source the caller asked for (or the preferred one). When it\ndiffers from `source`, the other service stood in."
          },
          "configured": {
            "type": "boolean",
            "description": "False when the provider is not set up."
          },
          "needs_account": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListenSource"
            },
            "description": "Services that give this list only to an account the person has not\nlinked (ListenBrainz's popular songs and albums). Not a failure."
          },
          "source": {
            "$ref": "#/components/schemas/ListenSource",
            "description": "Provider that answered."
          },
          "unavailable_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListenSource"
            },
            "description": "Services that failed, or are switched off, while the list was built."
          }
        }
      },
      "TopPickItem": {
        "type": "object",
        "description": "One personalized top pick.",
        "required": [
          "album",
          "match_pct",
          "reasons"
        ],
        "properties": {
          "album": {
            "$ref": "#/components/schemas/AlbumRef",
            "description": "Picked album."
          },
          "match_pct": {
            "type": "integer",
            "format": "int64",
            "description": "Match score, 0-100."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Human reasons behind the pick."
          },
          "seed_artist": {
            "type": [
              "string",
              "null"
            ],
            "description": "Seed artist name, when there is one."
          }
        }
      },
      "TopPicksSection": {
        "type": "object",
        "description": "The personalized top-picks shelf.",
        "required": [
          "title",
          "items",
          "personalizing"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TopPickItem"
            },
            "description": "Ranked picks."
          },
          "personalizing": {
            "type": "boolean",
            "description": "True while picks are trending-only because personalization has not\nresolved yet (the UI shows a \"still personalising\" hint)."
          },
          "source": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ShelfSource"
              }
            ],
            "description": "Provider behind the picks, when it has one."
          },
          "title": {
            "type": "string",
            "description": "Shelf title."
          }
        }
      },
      "TopSong": {
        "type": "object",
        "description": "One of an artist's most played songs.",
        "required": [
          "title",
          "artist_name"
        ],
        "properties": {
          "artist_name": {
            "type": "string",
            "description": "Credited artist."
          },
          "disc_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Disc of the song on that release, once its tracklist is known.",
            "minimum": 0
          },
          "listen_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Listen or play count, when the provider sent one."
          },
          "original_release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release the listens point at, when known."
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Recording MBID, when known."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release group the listens point at, when known."
          },
          "release_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "That release's title, when known."
          },
          "title": {
            "type": "string",
            "description": "Song title."
          },
          "track_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Track number on that disc, once the tracklist is known.",
            "minimum": 0
          }
        }
      },
      "TopSongsResponse": {
        "type": "object",
        "description": "`GET /artists/{artist_mbid}/top-songs`.",
        "required": [
          "songs",
          "source",
          "configured",
          "asked_source",
          "unavailable_sources",
          "needs_account"
        ],
        "properties": {
          "asked_source": {
            "$ref": "#/components/schemas/ListenSource",
            "description": "The source the caller asked for (or the preferred one). When it\ndiffers from `source`, the other service stood in."
          },
          "configured": {
            "type": "boolean",
            "description": "False when the provider is not set up."
          },
          "needs_account": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListenSource"
            },
            "description": "Services that give this list only to an account the person has not\nlinked (ListenBrainz's popular songs and albums). Not a failure."
          },
          "songs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TopSong"
            },
            "description": "Songs, most played first."
          },
          "source": {
            "$ref": "#/components/schemas/ListenSource",
            "description": "Provider that answered."
          },
          "unavailable_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListenSource"
            },
            "description": "Services that failed, or are switched off, while the list was built."
          }
        }
      },
      "TrackAlignment": {
        "type": "object",
        "required": [
          "local_track_id",
          "provider_position",
          "classification"
        ],
        "properties": {
          "classification": {
            "$ref": "#/components/schemas/AlignmentClassification"
          },
          "local_track_id": {
            "type": "string"
          },
          "provider_position": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "TrackEvidenceView": {
        "type": "object",
        "description": "How one file fits a candidate release.",
        "required": [
          "local_track_id",
          "title",
          "classification",
          "evidence_kinds"
        ],
        "properties": {
          "classification": {
            "$ref": "#/components/schemas/EvidenceClass"
          },
          "evidence_kinds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the verdict rests on (`recording_id`, `title`, `length`, ...)."
          },
          "local_track_id": {
            "type": "string"
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The MusicBrainz recording the file matched, when it matched one."
          },
          "release_track_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The release's track it matched, when it matched one."
          },
          "title": {
            "type": "string",
            "description": "The file's title as the library shows it."
          }
        }
      },
      "TrackIdentifier": {
        "type": "object",
        "description": "Track identity for membership checks.",
        "required": [
          "track_name",
          "artist_name",
          "album_name"
        ],
        "properties": {
          "album_name": {
            "type": "string",
            "description": "Album name."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "track_name": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "TrackInput": {
        "type": "object",
        "description": "One track to add.",
        "required": [
          "track_name",
          "artist_name",
          "album_name"
        ],
        "properties": {
          "album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album id, when known."
          },
          "album_name": {
            "type": "string",
            "description": "Album name."
          },
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist id, when known."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "available_sources": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Sources carrying this track, when known."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover art address, when known. Kept only when it is one of\nDroppedNeedle's own cover routes (a base path before `/api/v3/` is\ncut off) or an https image on Spotify, Deezer, Last.fm, TheAudioDB or\nYouTube; any other address is dropped and the track is still added."
          },
          "disc_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Disc number, when known."
          },
          "duration": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Duration in seconds, when known."
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": "Audio format, when known."
          },
          "plex_rating_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plex rating key, when the track came from Plex."
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The MusicBrainz recording `source_type` gave for this entry. Anything\nthat is not an MBID is left out."
          },
          "source_type": {
            "type": "string",
            "description": "Preferred source type."
          },
          "track_name": {
            "type": "string",
            "description": "Track title."
          },
          "track_number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Track number, when known."
          },
          "track_source_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Library track source id, when known."
          }
        }
      },
      "TrackIntake": {
        "type": "object",
        "description": "Exact-track intake body.",
        "required": [
          "recording_mbid",
          "artist_name",
          "track_title"
        ],
        "properties": {
          "album_title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title, when known."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist MBID."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "duration_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Track length in seconds."
          },
          "recording_mbid": {
            "type": "string",
            "description": "Recording MBID."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Containing release-group MBID, when known."
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Release MBID."
          },
          "track_title": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "TrackIntakeResponse": {
        "type": "object",
        "description": "Exact-track intake response.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "$ref": "#/components/schemas/RequestStatus",
            "description": "`queued` or `awaiting_approval`."
          },
          "task_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked download task, when dispatched."
          }
        }
      },
      "TrackListPage": {
        "type": "object",
        "description": "One page of the track list.",
        "required": [
          "items",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackView"
            },
            "description": "This page of tracks."
          },
          "next": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `after` for the next page; absent on the last page."
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Tracks matching the filter, all pages.",
            "minimum": 0
          }
        }
      },
      "TrackListSort": {
        "type": "string",
        "description": "How the track list is sorted.",
        "enum": [
          "title",
          "date_added",
          "artist",
          "album",
          "random"
        ]
      },
      "TrackPage": {
        "type": "object",
        "description": "One page of catalog tracks.",
        "required": [
          "items",
          "total",
          "offset",
          "limit"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackView"
            },
            "description": "This page of tracks."
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "description": "Echo of the requested limit.",
            "minimum": 0
          },
          "offset": {
            "type": "integer",
            "format": "int64",
            "description": "Echo of the requested offset.",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Tracks matching the filter, all pages.",
            "minimum": 0
          }
        }
      },
      "TrackPreviewResponse": {
        "type": "object",
        "description": "A 30-second track preview. Empty (no URL) means no provider had one.",
        "properties": {
          "duration_s": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Preview length in seconds, when known."
          },
          "preview_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preview audio URL, when found."
          },
          "provider": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provider that served the preview, when found."
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "Track title, when found."
          }
        }
      },
      "TrackRef": {
        "type": "object",
        "description": "One track inside a section.",
        "required": [
          "title"
        ],
        "properties": {
          "album_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album title, when known."
          },
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The artist's MusicBrainz id, when known."
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist name, when known."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover URL, when known."
          },
          "listen_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Listen or play count behind the row, when known."
          },
          "listened_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "Last listen timestamp (RFC 3339), when known."
          },
          "musicbrainz_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz recording id, when known."
          },
          "title": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "TrackView": {
        "type": "object",
        "description": "One catalog track. Only streamable tracks are listed; missing or\nexcluded files read as absent (404 on the detail route).",
        "required": [
          "id",
          "title",
          "album_id",
          "album_title",
          "artist_name",
          "album_artist_name",
          "disc_number",
          "track_number",
          "format",
          "file_size_bytes",
          "cover_available",
          "art_missing",
          "favorite",
          "row_revision"
        ],
        "properties": {
          "album_artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Local album-artist id of the owning album."
          },
          "album_artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz id of the album artist, when identified."
          },
          "album_artist_name": {
            "type": "string",
            "description": "Album artist display name."
          },
          "album_id": {
            "type": "string",
            "description": "Owning local album id."
          },
          "album_title": {
            "type": "string",
            "description": "Album title."
          },
          "art_missing": {
            "type": "boolean",
            "description": "The owning album's `art_missing`: true when the server knows its\ncover routes answer 404. False means ask."
          },
          "artist_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Local track-artist id, when credited."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz id of the track artist (the album artist when\nthe track carries no credit), when identified."
          },
          "artist_name": {
            "type": "string",
            "description": "Track artist display name."
          },
          "bit_depth": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Bit depth, when probed (lossless and PCM files)."
          },
          "bit_rate": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Bit rate in kbit/s, when probed."
          },
          "channels": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Channel count, when probed."
          },
          "cover_available": {
            "type": "boolean",
            "description": "True when the owning album has art of its own: a folder image or an\nembedded picture."
          },
          "date_added": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Import time, unix seconds."
          },
          "disc_number": {
            "type": "integer",
            "format": "int64",
            "description": "Disc number."
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Duration, seconds."
          },
          "favorite": {
            "type": "boolean",
            "description": "True when the caller favorited this track."
          },
          "file_size_bytes": {
            "type": "integer",
            "format": "int64",
            "description": "File size, bytes."
          },
          "format": {
            "type": "string",
            "description": "Container or codec label, e.g. `flac`."
          },
          "genre": {
            "type": [
              "string",
              "null"
            ],
            "description": "First genre tag, when tagged."
          },
          "id": {
            "type": "string",
            "description": "Local track id."
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked MusicBrainz recording, when identified."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Linked release group of the owning album, when identified."
          },
          "row_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The track row's revision, which its removal echoes."
          },
          "sample_rate": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Sample rate, when probed."
          },
          "title": {
            "type": "string",
            "description": "Track title."
          },
          "track_number": {
            "type": "integer",
            "format": "int64",
            "description": "Track number within the disc."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Release year, when known."
          }
        }
      },
      "TracksMode": {
        "type": "string",
        "description": "Which side of `min_tracks` a list keeps.",
        "enum": [
          "at_least",
          "below"
        ]
      },
      "TransportDto": {
        "type": "string",
        "description": "Credential handoff for session-issuing routes. Mirrors the session login\n`TransportParam` (which owns the mechanism) so this layer stays the only\nplace that needs `ToSchema`.",
        "enum": [
          "cookie",
          "bearer"
        ]
      },
      "UnicodeNormalization": {
        "type": "string",
        "description": "Unicode normalization for paths.",
        "enum": [
          "NFC",
          "NFKC"
        ]
      },
      "UnseenCountResponse": {
        "type": "object",
        "description": "Unseen-count answer.",
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "description": "Sightings newer than the caller's seen watermark.",
            "minimum": 0
          }
        }
      },
      "UpdateCheckResponse": {
        "type": "object",
        "description": "Update-check answer.",
        "required": [
          "current_version",
          "update_available",
          "comparison_failed"
        ],
        "properties": {
          "comparison_failed": {
            "type": "boolean",
            "description": "True when the two tags could not be compared."
          },
          "current_version": {
            "type": "string",
            "description": "Running version."
          },
          "latest_release": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/GitHubRelease"
              }
            ],
            "description": "Latest release detail, present only when an update is available."
          },
          "latest_version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Latest known tag, absent when the lookup found nothing."
          },
          "update_available": {
            "type": "boolean",
            "description": "True when a newer release exists (or a dev build failed comparison)."
          }
        }
      },
      "UpdatePlaylistBody": {
        "type": "object",
        "description": "Rename-playlist body. A missing name leaves the playlist unchanged.",
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "New display name. Must not be blank when present."
          }
        }
      },
      "UpdateTrackBody": {
        "type": "object",
        "description": "Track source-update body.",
        "properties": {
          "available_sources": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Sources carrying this track."
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preferred source type."
          }
        }
      },
      "UpgradeAddress": {
        "oneOf": [
          {
            "type": "object",
            "description": "A full address.",
            "required": [
              "value",
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "full"
                ]
              },
              "value": {
                "type": "string",
                "description": "A full address."
              }
            }
          },
          {
            "type": "object",
            "description": "A path, the base path included.",
            "required": [
              "value",
              "kind"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "path"
                ]
              },
              "value": {
                "type": "string",
                "description": "A path, the base path included."
              }
            }
          }
        ],
        "description": "An address, whole when v2's settings name the host, else the path to\nput after the scheme and host DroppedNeedle is opened at."
      },
      "UpgradeAlbumRequest": {
        "type": "object",
        "description": "Upgrade one album.",
        "required": [
          "release_group_mbid",
          "artist_name",
          "album_title"
        ],
        "properties": {
          "album_title": {
            "type": "string"
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist_name": {
            "type": "string"
          },
          "release_group_mbid": {
            "type": "string"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "UpgradeBackupFolders": {
        "type": "object",
        "description": "The two folders the v2 files are kept in.",
        "required": [
          "config",
          "cache"
        ],
        "properties": {
          "cache": {
            "type": "string",
            "description": "The cache folder's backup."
          },
          "config": {
            "type": "string",
            "description": "The config folder's backup."
          }
        }
      },
      "UpgradeBlocker": {
        "type": "object",
        "description": "Something that stops the upgrade until it is fixed.",
        "required": [
          "code",
          "message",
          "fix"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/UpgradeCode",
            "description": "What it is."
          },
          "fix": {
            "type": "string",
            "description": "What to do about it, as a sentence."
          },
          "message": {
            "type": "string",
            "description": "What is wrong, as a sentence."
          }
        }
      },
      "UpgradeCallbackFeature": {
        "type": "string",
        "description": "A feature whose callback address changes with the upgrade.",
        "enum": [
          "single_sign_on",
          "spotify",
          "musicbrainz_contributions"
        ]
      },
      "UpgradeCheck": {
        "type": "object",
        "description": "What `upgrade --check` found. It runs every check the upgrade runs\nbefore it moves anything, and leaves the v2 files as they are: its\nexport goes into the cache folder's `.upgrade-check` and is removed.",
        "required": [
          "layout",
          "orphans",
          "blockers",
          "warnings"
        ],
        "properties": {
          "blockers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpgradeBlocker"
            },
            "description": "What stops the upgrade until it is fixed."
          },
          "counts": {
            "type": [
              "object",
              "null"
            ],
            "description": "What the export carries, by the names `upgrade-report.json` counts\nunder: what the upgrade would move, at most. The import can still\nleave a record out, and its report then lists it. None when the\nexport could not be tried.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "layout": {
            "$ref": "#/components/schemas/UpgradeFoundLayout",
            "description": "What the folders hold."
          },
          "orphans": {
            "type": "integer",
            "format": "int64",
            "description": "Follows and approvals of deleted users the upgrade would remove\nfrom the v2 database first. They are not in `counts`.",
            "minimum": 0
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpgradeWarning"
            },
            "description": "Addresses that change with the upgrade, which `--callbacks-changed`\nacknowledges."
          }
        }
      },
      "UpgradeCode": {
        "type": "string",
        "description": "Why the upgrade cannot start, or why a run failed.",
        "enum": [
          "UNKNOWN_LAYOUT",
          "UNSUPPORTED_PATHS",
          "DATABASE_BEHIND_LINK",
          "NON_LOCAL_FILESYSTEM",
          "BACKUP_EXISTS",
          "V2_WAL_UNREADABLE",
          "NOT_ENOUGH_DISK",
          "V2_KEY_NOT_FOUND",
          "V2_KEY_INVALID",
          "V2_KEY_MISMATCH",
          "V2_CONFIG_UNREADABLE",
          "V2_CONFIG_INVALID",
          "MISSING_INSTANCE_ID",
          "V2_DATABASE_ERROR",
          "V2_TOO_OLD",
          "EXPORT_FAILED",
          "VALIDATION_FAILED",
          "CALLBACKS_TO_CHANGE",
          "NO_ADMIN_CAN_SIGN_IN",
          "LOCKED",
          "TOOL_RUNNING",
          "FILE_ERROR",
          "OCCUPIED",
          "NOT_A_FOLDER",
          "RANDOM_FAILED",
          "ORPHAN_REPAIR_FAILED",
          "IMPORT_SETUP_FAILED",
          "IMPORT_FAILED",
          "ROLLBACK_FAILED",
          "BACKUP_NOT_REMOVED",
          "NO_BACKUP",
          "ALREADY_V2",
          "BACKUP_STILL_NEEDED",
          "CONFIRMATION_NEEDED",
          "USAGE",
          "ENVIRONMENT_INVALID",
          "INTERNAL"
        ]
      },
      "UpgradeFailure": {
        "type": "object",
        "description": "The run failed or stopped.",
        "required": [
          "code",
          "message",
          "v2_files"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/UpgradeCode",
            "description": "What went wrong."
          },
          "message": {
            "type": "string",
            "description": "The error, as the tool prints it."
          },
          "v2_files": {
            "$ref": "#/components/schemas/UpgradeV2Files",
            "description": "Where the v2 files are now."
          }
        }
      },
      "UpgradeFoundLayout": {
        "type": "string",
        "description": "What the data folders hold, as the check found them.",
        "enum": [
          "v2",
          "interrupted",
          "v3",
          "empty",
          "unknown"
        ]
      },
      "UpgradeFreshBody": {
        "type": "object",
        "description": "Start fresh's confirmation.",
        "required": [
          "confirm"
        ],
        "properties": {
          "confirm": {
            "type": "boolean",
            "description": "Must be true: nothing comes across from v2."
          }
        }
      },
      "UpgradeLayout": {
        "type": "string",
        "description": "Where the upgrade stands.",
        "enum": [
          "needs_upgrade",
          "interrupted",
          "finished"
        ]
      },
      "UpgradeOutcome": {
        "type": "string",
        "description": "How a run ended well.",
        "enum": [
          "upgraded",
          "started_fresh",
          "undone",
          "already_v3",
          "no_v2_data"
        ]
      },
      "UpgradePreflightBody": {
        "type": "object",
        "description": "What the pre-flight found: the check, or why it could not run.",
        "properties": {
          "check": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeCheck"
              }
            ],
            "description": "The check's findings: counts, blockers with their fixes, and the\naddress changes to acknowledge."
          },
          "failure": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeFailure"
              }
            ],
            "description": "Why the check could not run."
          }
        }
      },
      "UpgradeProgressBody": {
        "type": "object",
        "description": "The latest run and where the upgrade stands.",
        "required": [
          "layout"
        ],
        "properties": {
          "layout": {
            "$ref": "#/components/schemas/UpgradeLayout",
            "description": "Where the upgrade stands."
          },
          "run": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeRun"
              }
            ],
            "description": "The latest upgrade, fresh start or undo; none yet."
          }
        }
      },
      "UpgradeRequestResponse": {
        "type": "object",
        "description": "What an upgrade ask did.",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "`queued`, or `satisfied` when nothing needed queueing (the copy\nmeets the cutoff, upgrades are off, or it is already downloading)."
          },
          "task_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "UpgradeResult": {
        "type": "object",
        "description": "The run finished.",
        "required": [
          "outcome"
        ],
        "properties": {
          "backup": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeBackupFolders"
              }
            ],
            "description": "Where the v2 files are kept; none when there are none to keep."
          },
          "outcome": {
            "$ref": "#/components/schemas/UpgradeOutcome",
            "description": "How it ended."
          },
          "summary": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeSummary"
              }
            ],
            "description": "What an upgrade moved; only after an upgrade."
          }
        }
      },
      "UpgradeRun": {
        "type": "object",
        "description": "The latest run of the upgrade, a fresh start or an undo.",
        "required": [
          "task",
          "running"
        ],
        "properties": {
          "done": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Parts of the step done, when it counts them.",
            "minimum": 0
          },
          "failure": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeFailure"
              }
            ],
            "description": "Why it failed, once it has."
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "The step's label."
          },
          "result": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeResult"
              }
            ],
            "description": "How the run finished, once it has."
          },
          "running": {
            "type": "boolean",
            "description": "True until it ends."
          },
          "step": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeStep"
              }
            ],
            "description": "The step under way, or the last one."
          },
          "task": {
            "$ref": "#/components/schemas/UpgradeTask",
            "description": "What the run does."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Parts the step has, when it knows.",
            "minimum": 0
          }
        }
      },
      "UpgradeSignInBody": {
        "oneOf": [
          {
            "type": "object",
            "description": "A v2 admin's username and password.",
            "required": [
              "username",
              "password",
              "method"
            ],
            "properties": {
              "method": {
                "type": "string",
                "enum": [
                  "password"
                ]
              },
              "password": {
                "type": "string",
                "description": "The v2 password."
              },
              "username": {
                "type": "string",
                "description": "The v2 username."
              }
            }
          },
          {
            "type": "object",
            "description": "The one-time code from the server's log.",
            "required": [
              "code",
              "method"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "The code, with or without its dashes."
              },
              "method": {
                "type": "string",
                "enum": [
                  "code"
                ]
              }
            }
          }
        ],
        "description": "How to sign in to the upgrade page."
      },
      "UpgradeStartBody": {
        "type": "object",
        "description": "What start needs.",
        "properties": {
          "acknowledged": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AcknowledgedWarning"
            },
            "description": "Every address change the latest pre-flight listed."
          }
        }
      },
      "UpgradeStateBody": {
        "type": "object",
        "description": "Where the upgrade stands, for anyone.",
        "required": [
          "layout",
          "signed_in"
        ],
        "properties": {
          "layout": {
            "$ref": "#/components/schemas/UpgradeLayout",
            "description": "Where the upgrade stands."
          },
          "signed_in": {
            "type": "boolean",
            "description": "Whether this caller's upgrade sign-in is valid."
          }
        }
      },
      "UpgradeStep": {
        "type": "string",
        "description": "The steps a run goes through, in the order they can come.",
        "enum": [
          "recover",
          "move_aside",
          "export",
          "export_again",
          "dry_run",
          "import",
          "remove_backup",
          "roll_back",
          "undo"
        ]
      },
      "UpgradeSummary": {
        "type": "object",
        "description": "What the upgrade did, as its text summary says it.",
        "required": [
          "moved",
          "needs_attention",
          "orphans_removed",
          "left_behind",
          "notes",
          "settings_defaulted",
          "report"
        ],
        "properties": {
          "left_behind": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What stayed behind in v2, one line each."
          },
          "moved": {
            "type": "object",
            "description": "Records moved to v3, by the names the report counts under; kinds\nwith none moved are left out.",
            "additionalProperties": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "needs_attention": {
            "type": "integer",
            "format": "int64",
            "description": "Records left out or changed on the way, each listed in the report.",
            "minimum": 0
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What is worth a look, one line each."
          },
          "orphans_removed": {
            "type": "integer",
            "format": "int64",
            "description": "Follows and approvals of deleted users removed from the v2 database.",
            "minimum": 0
          },
          "report": {
            "type": "string",
            "description": "Where the full report, `upgrade-report.json`, was saved."
          },
          "settings_defaulted": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Settings v2 had nothing saved for, now at v3's defaults."
          }
        }
      },
      "UpgradeTask": {
        "type": "string",
        "description": "What a run in the progress read does.",
        "enum": [
          "upgrade",
          "fresh",
          "undo"
        ]
      },
      "UpgradeTrackRequest": {
        "type": "object",
        "description": "Upgrade one track.",
        "required": [
          "recording_mbid",
          "artist_name",
          "track_title"
        ],
        "properties": {
          "album_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "artist_name": {
            "type": "string"
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "recording_mbid": {
            "type": "string"
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "track_title": {
            "type": "string"
          }
        }
      },
      "UpgradeV2Files": {
        "type": "string",
        "description": "Where the v2 files are after a failed run.",
        "enum": [
          "untouched",
          "put_back",
          "in_backup"
        ]
      },
      "UpgradeWarning": {
        "type": "object",
        "description": "A change at an outside service to acknowledge before the upgrade.",
        "required": [
          "feature",
          "message"
        ],
        "properties": {
          "feature": {
            "$ref": "#/components/schemas/UpgradeCallbackFeature",
            "description": "The feature it concerns."
          },
          "message": {
            "type": "string",
            "description": "What to do, as sentences."
          },
          "new_address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeAddress"
              }
            ],
            "description": "The address v3 uses; none for MusicBrainz contributions."
          },
          "old_address": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpgradeAddress"
              }
            ],
            "description": "The address v2 registered; none for MusicBrainz contributions."
          }
        }
      },
      "UsenetBackend": {
        "type": "string",
        "description": "Which Usenet search side is active. Reads collapse unknown values to\n`Indexers` (v2: pre-existing setups behave as before with no migration);\nsaves only accept known values (the derived decode and `parse` are\nboth strict).",
        "enum": [
          "indexers",
          "prowlarr"
        ]
      },
      "UsenetClientTestResponse": {
        "type": "object",
        "description": "Usenet client test verdict (SABnzbd or NZBGet): version plus the\ncategory list (for the picker), the client-side completed dir (the mount hint), and the mount\ndiagnosis over the submitted mount.",
        "required": [
          "valid",
          "message",
          "categories"
        ],
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Known categories."
          },
          "complete_dir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Client-side completed dir, when known."
          },
          "message": {
            "type": "string",
            "description": "Human summary."
          },
          "mount_has_files": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the submitted mount holds files, when diagnosed."
          },
          "mount_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Actionable mount guidance, when the mount looks wrong."
          },
          "resolvable_downloads": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Sampled downloads resolving under the submitted mount."
          },
          "sampled_downloads": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Sampled downloads."
          },
          "valid": {
            "type": "boolean",
            "description": "Whether the submitted values checked out."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Server version, when known."
          }
        }
      },
      "UsenetSearchBackend": {
        "type": "object",
        "description": "The active Usenet search backend (either/or): `\"indexers\"` for the\nnative Newznab priority list, `\"prowlarr\"` for the single Prowlarr\nconnection. Unknown values are a 400, never a silent reset.",
        "properties": {
          "backend": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UsenetBackend"
              }
            ],
            "description": "Active backend.",
            "default": "indexers"
          }
        }
      },
      "UsenetStatusResponse": {
        "type": "object",
        "description": "Live Usenet client (SABnzbd or NZBGet) status against the saved config.",
        "required": [
          "valid",
          "message",
          "categories"
        ],
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Category list, when the probe reached it."
          },
          "complete_dir": {
            "type": [
              "string",
              "null"
            ],
            "description": "Completed dir (the mount hint), when the probe reached it."
          },
          "message": {
            "type": "string",
            "description": "User-safe summary."
          },
          "valid": {
            "type": "boolean",
            "description": "True when the saved config probes clean."
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "Client version, when the probe reached it."
          }
        }
      },
      "UserDirectoryEntry": {
        "type": "object",
        "description": "One user as everyone signed in may see them: enough to pick them\nwhen sharing.",
        "required": [
          "id",
          "display_name"
        ],
        "properties": {
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "id": {
            "type": "string",
            "description": "User id."
          }
        }
      },
      "UserDirectoryResponse": {
        "type": "object",
        "description": "Every user who set a display name, by that name.",
        "required": [
          "users"
        ],
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserDirectoryEntry"
            },
            "description": "Users."
          }
        }
      },
      "UserPreferences": {
        "type": "object",
        "description": "Release-type filters for discovery and search.",
        "properties": {
          "primary_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Primary release types (album, ep, single, ...).",
            "default": [
              "album",
              "ep",
              "single"
            ]
          },
          "secondary_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Secondary release types (studio, live, ...).",
            "default": [
              "studio"
            ]
          }
        }
      },
      "UserResponse": {
        "type": "object",
        "description": "Public account shape.",
        "required": [
          "id",
          "display_name",
          "role",
          "providers",
          "created_at"
        ],
        "properties": {
          "avatar_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Served avatar URL, when an avatar is set."
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Creation time, unix seconds."
          },
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email, when set."
          },
          "id": {
            "type": "string",
            "description": "User id."
          },
          "last_login_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Last login time, unix seconds."
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Bound provider names (e.g. `local`)."
          },
          "role": {
            "$ref": "#/components/schemas/Role",
            "description": "Account role."
          },
          "username": {
            "type": [
              "string",
              "null"
            ],
            "description": "Lowercased login identifier, when set."
          },
          "username_display": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preferred username casing, when set."
          }
        }
      },
      "UserWrappedResponse": {
        "type": "object",
        "description": "Per-user year-in-review. `loved_tracks_count` and `total_listens_estimated`\nare both approximations: ListenBrainz caps the loved endpoint at 100 rows\nper request, and the total sums only the returned top artists rather than\nevery play.",
        "required": [
          "user_id",
          "display_name",
          "year",
          "has_data",
          "top_artists",
          "top_tracks",
          "top_albums",
          "top_genres",
          "loved_tracks_count",
          "total_listens_estimated"
        ],
        "properties": {
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "has_data": {
            "type": "boolean",
            "description": "False (with empty lists) when the user has no linked ListenBrainz\naccount or no listens for the year."
          },
          "loved_tracks_count": {
            "type": "integer",
            "format": "int64",
            "description": "Loved-track sample size (capped at 100 by ListenBrainz), not a total."
          },
          "top_albums": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WrappedAlbum"
            },
            "description": "Top albums."
          },
          "top_artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WrappedArtist"
            },
            "description": "Top artists."
          },
          "top_genres": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WrappedGenre"
            },
            "description": "Top genres."
          },
          "top_tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WrappedTrack"
            },
            "description": "Top tracks."
          },
          "total_listens_estimated": {
            "type": "integer",
            "format": "int64",
            "description": "Sum over the returned top artists, not the true play count."
          },
          "user_id": {
            "type": "string",
            "description": "User id."
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "Year the stats cover."
          }
        }
      },
      "UsernameUpdate": {
        "type": "object",
        "description": "Change username.",
        "required": [
          "username"
        ],
        "properties": {
          "username": {
            "type": "string",
            "description": "New username: 3-32 chars of letters, digits, `.`, `_`, `-`."
          }
        }
      },
      "VerifyConnectionResponse": {
        "type": "object",
        "description": "Generic connection-test verdict. Reachable/bad-credential distinctions\nride in the body, never as a leaked 5xx, and the URL or host is never\nechoed back.",
        "required": [
          "valid",
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Human summary."
          },
          "valid": {
            "type": "boolean",
            "description": "Whether the submitted values checked out."
          }
        }
      },
      "VersionInfo": {
        "type": "object",
        "description": "Running build identity.",
        "required": [
          "version"
        ],
        "properties": {
          "build_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Build timestamp when the image records one."
          },
          "version": {
            "type": "string",
            "description": "Release tag, or `dev` on a checkout build."
          }
        }
      },
      "VisibilityBody": {
        "type": "object",
        "description": "Visibility-toggle body.",
        "required": [
          "is_public"
        ],
        "properties": {
          "is_public": {
            "type": "boolean",
            "description": "True makes the playlist public; false makes it private."
          }
        }
      },
      "WaitingAlbumView": {
        "type": "object",
        "description": "One album whose match waits for a look.",
        "required": [
          "album_id",
          "title",
          "artist_name",
          "state",
          "reason",
          "updated_at",
          "identity_revision",
          "file_count",
          "looks_wrong_count"
        ],
        "properties": {
          "album_id": {
            "type": "string"
          },
          "artist_name": {
            "type": "string"
          },
          "file_count": {
            "type": "integer",
            "format": "int32",
            "description": "Indexed files the album holds.",
            "minimum": 0
          },
          "guess": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WaitingGuessView"
              }
            ],
            "description": "What \"That's right\" confirms, for a best guess."
          },
          "identity_revision": {
            "type": "integer",
            "format": "int64",
            "description": "The identity's row revision, 0 when the album has none. \"That's\nright\" echoes it."
          },
          "looks_wrong_count": {
            "type": "integer",
            "format": "int32",
            "description": "How many people marked the match \"Looks wrong\".",
            "minimum": 0
          },
          "reason": {
            "$ref": "#/components/schemas/ReasonView"
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "$ref": "#/components/schemas/EditionState",
            "description": "`unconfirmed` or `unmatched`; in the \"Looks wrong\" list, any state."
          },
          "title": {
            "type": "string",
            "description": "The album as its files have it."
          },
          "updated_at": {
            "type": "number",
            "format": "double",
            "description": "When it was listed (epoch seconds): the match, or the newest\n\"Looks wrong\" mark."
          }
        }
      },
      "WaitingGuessView": {
        "type": "object",
        "description": "The guess an album holds, as its row in the list names it.",
        "required": [
          "title",
          "artist_name",
          "release_group_mbid",
          "matched_files"
        ],
        "properties": {
          "artist_name": {
            "type": "string"
          },
          "matched_files": {
            "type": "integer",
            "format": "int32",
            "description": "Files the guess accounts for closely.",
            "minimum": 0
          },
          "release_group_mbid": {
            "type": "string"
          },
          "release_mbid": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          }
        }
      },
      "WaitingReason": {
        "type": "string",
        "description": "Why a live request waits. It starts by itself once the cause clears.",
        "enum": [
          "no_download_source",
          "request_quota_full",
          "storage_full",
          "waiting_to_start"
        ]
      },
      "WantedActionResponse": {
        "type": "object",
        "description": "Wanted mutation outcome.",
        "required": [
          "success",
          "state"
        ],
        "properties": {
          "state": {
            "$ref": "#/components/schemas/WatchState",
            "description": "Watch state after this call."
          },
          "success": {
            "type": "boolean",
            "description": "Whether the action applied."
          }
        }
      },
      "WantedItem": {
        "type": "object",
        "description": "One wanted watch.",
        "required": [
          "musicbrainz_id",
          "artist_name",
          "album_title",
          "kind",
          "state",
          "check_count",
          "new_candidate_count",
          "created_at"
        ],
        "properties": {
          "album_title": {
            "type": "string",
            "description": "Album title."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist MBID."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "check_count": {
            "type": "integer",
            "format": "int32",
            "description": "Passed checks so far.",
            "minimum": 0
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom artwork URL override. None: artwork resolves client-side\nfrom the MBID."
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Epoch seconds when created.",
            "minimum": 0
          },
          "kind": {
            "$ref": "#/components/schemas/WatchKind",
            "description": "The whole album or the gaps of a short one."
          },
          "last_outcome": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/WatchOutcome"
              }
            ],
            "description": "What the last check found, once one ran."
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Release-group MBID."
          },
          "new_candidate_count": {
            "type": "integer",
            "format": "int32",
            "description": "Unseen candidate count.",
            "minimum": 0
          },
          "next_check_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Epoch seconds when the next check is due, when scheduled.",
            "minimum": 0
          },
          "state": {
            "$ref": "#/components/schemas/WatchState",
            "description": "Watch state."
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owner id (admins see every row)."
          },
          "user_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owner display name (admins only; the \"watched for\" chip)."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year."
          }
        }
      },
      "WantedNotice": {
        "type": "object",
        "description": "`wanted_new_candidates`, `wanted_auto_dispatched` and `wanted_fulfilled`.",
        "required": [
          "event_id",
          "release_group_mbid",
          "artist_name",
          "album_title"
        ],
        "properties": {
          "album_title": {
            "type": "string",
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "event_id": {
            "type": "string",
            "description": "Id for de-duplication."
          },
          "new_candidates": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "New candidates found (`wanted_new_candidates` only).",
            "minimum": 0
          },
          "release_group_mbid": {
            "type": "string",
            "description": "The wanted album's release group."
          },
          "task_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Download task started (`wanted_auto_dispatched` for whole albums)."
          },
          "tracks": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Tracks started (`wanted_auto_dispatched` for a partial album).",
            "minimum": 0
          }
        }
      },
      "WantedRemovalResponse": {
        "type": "object",
        "description": "How many wanted watches a removal took off the list.",
        "required": [
          "removed"
        ],
        "properties": {
          "removed": {
            "type": "integer",
            "format": "int64",
            "description": "Watches removed.",
            "minimum": 0
          }
        }
      },
      "WantedResponse": {
        "type": "object",
        "description": "Wanted list: watches plus the still-retrying set.",
        "required": [
          "items",
          "count",
          "retrying"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int32",
            "description": "Watch count.",
            "minimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WantedItem"
            },
            "description": "Watches."
          },
          "retrying": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WantedRetryingItem"
            },
            "description": "Still-scheduled auto-retries."
          }
        }
      },
      "WantedRetryingItem": {
        "type": "object",
        "description": "One auto-retry entry behind the wanted view.",
        "required": [
          "musicbrainz_id",
          "artist_name",
          "album_title",
          "retry_count",
          "max_attempts"
        ],
        "properties": {
          "album_title": {
            "type": "string",
            "description": "Album title."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Artist MBID."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Custom artwork URL override. None: artwork resolves client-side\nfrom the MBID."
          },
          "max_attempts": {
            "type": "integer",
            "format": "int32",
            "description": "Attempts allowed.",
            "minimum": 0
          },
          "musicbrainz_id": {
            "type": "string",
            "description": "Release-group MBID."
          },
          "next_retry_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Epoch seconds when the next try is due, when scheduled.",
            "minimum": 0
          },
          "retry_count": {
            "type": "integer",
            "format": "int32",
            "description": "Attempts so far.",
            "minimum": 0
          },
          "user_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owner id (admins see every row)."
          },
          "user_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Owner display name (admins only; the \"requested by\" chip)."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Release year."
          }
        }
      },
      "WantedWatcher": {
        "type": "object",
        "description": "Wanted watcher toggles. Cadence stays code constants on purpose.",
        "properties": {
          "auto_download_on_find": {
            "type": "boolean",
            "description": "Off means badge-only even for auto-tier finds.",
            "default": true
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch (rollback lever, read per sweep).",
            "default": true
          },
          "max_checks_per_sweep": {
            "type": "integer",
            "format": "int64",
            "description": "Max artist checks per sweep.",
            "default": 3
          },
          "watch_partial_albums": {
            "type": "boolean",
            "description": "Watch partial albums too.",
            "default": true
          }
        }
      },
      "WatchKind": {
        "type": "string",
        "description": "What a wanted watch waits for. The `wanted_watches.kind` CHECK lists\nexactly these values.",
        "enum": [
          "missing",
          "partial"
        ]
      },
      "WatchOutcome": {
        "type": "string",
        "description": "What a wanted watch's last check found.",
        "enum": [
          "found",
          "seen",
          "dispatched",
          "quiet",
          "outside_settings",
          "error",
          "in_library",
          "imported"
        ]
      },
      "WatchState": {
        "type": "string",
        "description": "A wanted watch's state. The `wanted_watches.state` CHECK lists exactly\nthese values.",
        "enum": [
          "watching",
          "stopped",
          "fulfilled"
        ]
      },
      "WeeklyExploration": {
        "type": "object",
        "description": "The weekly exploration playlist shelf.",
        "required": [
          "title",
          "playlist_date",
          "tracks",
          "source_url"
        ],
        "properties": {
          "playlist_date": {
            "type": "string",
            "description": "Playlist date (`YYYY-MM-DD`)."
          },
          "source_url": {
            "type": "string",
            "description": "Provider playlist URL, when there is one."
          },
          "title": {
            "type": "string",
            "description": "Shelf title."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WeeklyTrack"
            },
            "description": "Playlist tracks in order."
          }
        }
      },
      "WeeklyTrack": {
        "type": "object",
        "description": "One track of the weekly exploration playlist.",
        "required": [
          "title",
          "artist_name",
          "album_name"
        ],
        "properties": {
          "album_name": {
            "type": "string",
            "description": "Album title."
          },
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz artist id, when known."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover art URL, when resolved."
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Duration in milliseconds, when known."
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz recording id, when known."
          },
          "release_group_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz release-group id, when known."
          },
          "title": {
            "type": "string",
            "description": "Track title."
          }
        }
      },
      "WorkEffect": {
        "type": "string",
        "description": "What the work does to the library.",
        "enum": [
          "catalog_only",
          "file_writing",
          "attention"
        ]
      },
      "WorkItem": {
        "type": "object",
        "description": "One work stack entry.",
        "required": [
          "id",
          "kind",
          "state",
          "phase",
          "mode",
          "effect",
          "processed",
          "total",
          "unit",
          "indeterminate",
          "remaining_count",
          "subject_count",
          "started_at",
          "updated_at",
          "origin",
          "profile_name",
          "scope_label",
          "new_count",
          "changed_count",
          "missing_count",
          "warning_count",
          "blocked_count",
          "succeeded_count",
          "failed_count",
          "skipped_count",
          "priority",
          "failure_event_id",
          "failure_at",
          "synthetic"
        ],
        "properties": {
          "blocked_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "catalog_settled": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "False while a settled scan still has albums waiting to identify."
          },
          "changed_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "effect": {
            "$ref": "#/components/schemas/WorkEffect"
          },
          "failed_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "failure_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "failure_event_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string",
            "description": "Run id, or a fixed id for queue-wide entries."
          },
          "indeterminate": {
            "type": "boolean"
          },
          "kind": {
            "$ref": "#/components/schemas/WorkKind"
          },
          "missing_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "mode": {
            "type": [
              "string",
              "null"
            ]
          },
          "new_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "origin": {
            "type": [
              "string",
              "null"
            ]
          },
          "pending_identification": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Albums still waiting to identify, on the drain card.",
            "minimum": 0
          },
          "phase": {
            "type": [
              "string",
              "null"
            ]
          },
          "priority": {
            "type": "integer",
            "format": "int64",
            "description": "Lower sorts first: 0 needs attention, 20 is the running scan."
          },
          "processed": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "profile_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "remaining_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "scope_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Administrators see which part of the library a scan covers."
          },
          "skipped_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "started_at": {
            "type": [
              "number",
              "null"
            ],
            "format": "double"
          },
          "state": {
            "$ref": "#/components/schemas/ActivityState"
          },
          "subject_count": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "succeeded_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "synthetic": {
            "type": "boolean",
            "description": "True for the drain card, which names no real run."
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "unit": {
            "$ref": "#/components/schemas/WorkUnit"
          },
          "updated_at": {
            "type": "number",
            "format": "double"
          },
          "warning_count": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "WorkKind": {
        "type": "string",
        "description": "What kind of work one stack entry is.",
        "enum": [
          "scan",
          "identification",
          "identity_preparation",
          "reidentification",
          "identity_review",
          "maintenance",
          "library_management",
          "recovery"
        ]
      },
      "WorkState": {
        "type": "string",
        "description": "Where one work item is.",
        "enum": [
          "pending",
          "running",
          "succeeded",
          "failed",
          "skipped"
        ]
      },
      "WorkUnit": {
        "type": "string",
        "description": "What a work entry counts.",
        "enum": [
          "files",
          "albums",
          "releases",
          "items"
        ]
      },
      "WrappedAlbum": {
        "type": "object",
        "description": "Top album row.",
        "required": [
          "name",
          "artist_name",
          "listen_count"
        ],
        "properties": {
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "listen_count": {
            "type": "integer",
            "format": "int64",
            "description": "Listen count."
          },
          "mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz release-group id when known."
          },
          "name": {
            "type": "string",
            "description": "Album name."
          }
        }
      },
      "WrappedArtist": {
        "type": "object",
        "description": "Top artist row.",
        "required": [
          "name",
          "listen_count"
        ],
        "properties": {
          "artist_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "MusicBrainz artist id when known."
          },
          "listen_count": {
            "type": "integer",
            "format": "int64",
            "description": "Listen count."
          },
          "name": {
            "type": "string",
            "description": "Artist name."
          }
        }
      },
      "WrappedGenre": {
        "type": "object",
        "description": "Top genre row.",
        "required": [
          "genre",
          "listen_count"
        ],
        "properties": {
          "genre": {
            "type": "string",
            "description": "Genre label."
          },
          "listen_count": {
            "type": "integer",
            "format": "int64",
            "description": "Listen count."
          }
        }
      },
      "WrappedLeaderboardEntry": {
        "type": "object",
        "description": "Server leaderboard row.",
        "required": [
          "display_name",
          "listen_count"
        ],
        "properties": {
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "listen_count": {
            "type": "integer",
            "format": "int64",
            "description": "Listen count."
          }
        }
      },
      "WrappedSettings": {
        "type": "object",
        "description": "Shared secret for the wrapped endpoints (service-to-service).",
        "properties": {
          "api_key": {
            "type": "string",
            "description": "API key (encrypted at rest).",
            "default": ""
          }
        }
      },
      "WrappedTrack": {
        "type": "object",
        "description": "Top track row.",
        "required": [
          "name",
          "artist_name",
          "listen_count"
        ],
        "properties": {
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "listen_count": {
            "type": "integer",
            "format": "int64",
            "description": "Listen count."
          },
          "name": {
            "type": "string",
            "description": "Track name."
          }
        }
      },
      "WrappedUserSummary": {
        "type": "object",
        "description": "One user row in the listing.",
        "required": [
          "id",
          "display_name",
          "has_listenbrainz"
        ],
        "properties": {
          "display_name": {
            "type": "string",
            "description": "Display name."
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Email when known."
          },
          "has_listenbrainz": {
            "type": "boolean",
            "description": "True when a ListenBrainz account is linked."
          },
          "id": {
            "type": "string",
            "description": "User id."
          }
        }
      },
      "WrappedUsersResponse": {
        "type": "object",
        "description": "User listing answer.",
        "required": [
          "year",
          "users"
        ],
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WrappedUserSummary"
            },
            "description": "Every user with its ListenBrainz link status."
          },
          "year": {
            "type": "integer",
            "format": "int32",
            "description": "Year the stats cover."
          }
        }
      },
      "YouTubeConnection": {
        "type": "object",
        "description": "YouTube connection.",
        "properties": {
          "api_enabled": {
            "type": "boolean",
            "description": "API search switch.",
            "default": false
          },
          "api_key": {
            "type": "string",
            "description": "API key (encrypted at rest; v2 returned it plaintext on GET).",
            "default": ""
          },
          "daily_quota_limit": {
            "type": "integer",
            "format": "int64",
            "description": "Daily quota limit (1-10000).",
            "default": 80
          },
          "enabled": {
            "type": "boolean",
            "description": "Master switch.",
            "default": false
          }
        }
      },
      "YouTubeLink": {
        "type": "object",
        "description": "A saved album entry. It holds a full-album video, track videos, or both:\nan entry created by track generation alone has no `video_id`.",
        "required": [
          "album_id",
          "album_name",
          "artist_name",
          "created_at",
          "is_manual",
          "track_count"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "Album id (a release-group MBID, or `manual-...` for hand-made links)."
          },
          "album_name": {
            "type": "string",
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover image URL, when known."
          },
          "created_at": {
            "type": "string",
            "description": "When the link was saved (ISO-8601, UTC)."
          },
          "embed_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Embed URL for the full-album video, when one is saved."
          },
          "is_manual": {
            "type": "boolean",
            "description": "True when a person pasted the video rather than search finding it."
          },
          "track_count": {
            "type": "integer",
            "format": "int64",
            "description": "How many track videos the album has."
          },
          "video_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full-album video id, when one is saved."
          }
        }
      },
      "YouTubeLinkGenerateRequest": {
        "type": "object",
        "description": "Body for `POST /youtube/generate`.",
        "required": [
          "artist_name",
          "album_name",
          "album_id"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "Album id the link is saved under."
          },
          "album_name": {
            "type": "string",
            "description": "Album title to search for."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name to search for."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover image URL to show with the link."
          }
        }
      },
      "YouTubeLinkResponse": {
        "type": "object",
        "description": "Answer of `POST /youtube/generate`.",
        "required": [
          "link",
          "quota"
        ],
        "properties": {
          "link": {
            "$ref": "#/components/schemas/YouTubeLink",
            "description": "The saved (or already saved) album link."
          },
          "quota": {
            "$ref": "#/components/schemas/YouTubeQuotaStatus",
            "description": "Search budget after the call."
          }
        }
      },
      "YouTubeLinkUpdateRequest": {
        "type": "object",
        "description": "Body for `PUT /youtube/link/{album_id}`. Fields left out keep their\nsaved value; `cover_url: null` clears the cover.",
        "properties": {
          "album_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "New album title."
          },
          "artist_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "New artist name."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "New cover URL; `null` clears it, leaving it out keeps it."
          },
          "youtube_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "New YouTube URL or video id."
          }
        }
      },
      "YouTubeManualLinkRequest": {
        "type": "object",
        "description": "Body for `POST /youtube/manual`.",
        "required": [
          "album_name",
          "artist_name",
          "youtube_url"
        ],
        "properties": {
          "album_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Album id to save under. Left out, a `manual-...` id is made up."
          },
          "album_name": {
            "type": "string",
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover image URL."
          },
          "youtube_url": {
            "type": "string",
            "description": "A YouTube URL or a bare 11-character video id."
          }
        }
      },
      "YouTubeQuotaStatus": {
        "type": "object",
        "description": "Today's YouTube search budget.",
        "required": [
          "used",
          "limit",
          "remaining",
          "date"
        ],
        "properties": {
          "date": {
            "type": "string",
            "description": "Quota day the numbers belong to (it starts at 08:00 UTC), YYYY-MM-DD."
          },
          "limit": {
            "type": "integer",
            "format": "int64",
            "description": "Daily budget."
          },
          "remaining": {
            "type": "integer",
            "format": "int64",
            "description": "Searches left today, never negative."
          },
          "used": {
            "type": "integer",
            "format": "int64",
            "description": "Searches spent today."
          }
        }
      },
      "YouTubeSearchResponse": {
        "type": "object",
        "description": "A resolved YouTube video. `error: \"not_found\"` means the search ran and\nfound nothing; absence of both video and error never happens.",
        "properties": {
          "cached": {
            "type": "boolean",
            "description": "True when the answer came from cache."
          },
          "embed_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Embed URL, when found."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Failure reason (`not_found`), when the search found nothing."
          },
          "video_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Resolved video id, when found."
          }
        }
      },
      "YouTubeTrackInput": {
        "type": "object",
        "description": "One track in a batch generation.",
        "required": [
          "track_name",
          "track_number"
        ],
        "properties": {
          "disc_number": {
            "type": "integer",
            "format": "int64",
            "description": "Disc number, 1 when left out."
          },
          "track_name": {
            "type": "string",
            "description": "Track title to search for."
          },
          "track_number": {
            "type": "integer",
            "format": "int64",
            "description": "Track position on its disc."
          }
        }
      },
      "YouTubeTrackLink": {
        "type": "object",
        "description": "A saved video for one track.",
        "required": [
          "album_id",
          "album_name",
          "disc_number",
          "track_number",
          "track_name",
          "video_id",
          "artist_name",
          "embed_url",
          "created_at"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "Album id the track belongs to."
          },
          "album_name": {
            "type": "string",
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name."
          },
          "created_at": {
            "type": "string",
            "description": "When the link was saved (ISO-8601, UTC)."
          },
          "disc_number": {
            "type": "integer",
            "format": "int64",
            "description": "Disc number, 1 for single-disc albums."
          },
          "embed_url": {
            "type": "string",
            "description": "Embed URL for the video."
          },
          "recording_mbid": {
            "type": [
              "string",
              "null"
            ],
            "description": "The MusicBrainz recording the link stands for, when known. It names\nthe track, not what the video holds."
          },
          "track_name": {
            "type": "string",
            "description": "Track title."
          },
          "track_number": {
            "type": "integer",
            "format": "int64",
            "description": "Track position on its disc."
          },
          "video_id": {
            "type": "string",
            "description": "Video id."
          }
        }
      },
      "YouTubeTrackLinkBatchGenerateRequest": {
        "type": "object",
        "description": "Body for `POST /youtube/generate-tracks`.",
        "required": [
          "album_id",
          "album_name",
          "artist_name",
          "tracks"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "Album id the tracks belong to."
          },
          "album_name": {
            "type": "string",
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name to search for."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover image URL for the album entry."
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YouTubeTrackInput"
            },
            "description": "Tracks to find videos for."
          }
        }
      },
      "YouTubeTrackLinkBatchResponse": {
        "type": "object",
        "description": "Answer of `POST /youtube/generate-tracks`.",
        "required": [
          "track_links",
          "failed",
          "quota"
        ],
        "properties": {
          "failed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YouTubeTrackLinkFailure"
            },
            "description": "Tracks without a video."
          },
          "quota": {
            "$ref": "#/components/schemas/YouTubeQuotaStatus",
            "description": "Search budget after the call."
          },
          "track_links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/YouTubeTrackLink"
            },
            "description": "Saved links, including tracks that already had one."
          }
        }
      },
      "YouTubeTrackLinkFailure": {
        "type": "object",
        "description": "A track the batch could not find a video for.",
        "required": [
          "disc_number",
          "track_number",
          "track_name",
          "reason"
        ],
        "properties": {
          "disc_number": {
            "type": "integer",
            "format": "int64",
            "description": "Disc number."
          },
          "reason": {
            "type": "string",
            "description": "Why, in a sentence for the user."
          },
          "track_name": {
            "type": "string",
            "description": "Track title."
          },
          "track_number": {
            "type": "integer",
            "format": "int64",
            "description": "Track position on its disc."
          }
        }
      },
      "YouTubeTrackLinkGenerateRequest": {
        "type": "object",
        "description": "Body for `POST /youtube/generate-track`.",
        "required": [
          "album_id",
          "album_name",
          "artist_name",
          "track_name",
          "track_number"
        ],
        "properties": {
          "album_id": {
            "type": "string",
            "description": "Album id the track belongs to."
          },
          "album_name": {
            "type": "string",
            "description": "Album title."
          },
          "artist_name": {
            "type": "string",
            "description": "Artist name to search for."
          },
          "cover_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cover image URL for the album entry."
          },
          "disc_number": {
            "type": "integer",
            "format": "int64",
            "description": "Disc number, 1 when left out."
          },
          "track_name": {
            "type": "string",
            "description": "Track title to search for."
          },
          "track_number": {
            "type": "integer",
            "format": "int64",
            "description": "Track position on its disc."
          }
        }
      },
      "YouTubeTrackLinkResponse": {
        "type": "object",
        "description": "Answer of `POST /youtube/generate-track`.",
        "required": [
          "track_link",
          "quota"
        ],
        "properties": {
          "quota": {
            "$ref": "#/components/schemas/YouTubeQuotaStatus",
            "description": "Search budget after the call."
          },
          "track_link": {
            "$ref": "#/components/schemas/YouTubeTrackLink",
            "description": "The saved (or already saved) track link."
          }
        }
      }
    },
    "securitySchemes": {
      "session": {
        "type": "http",
        "scheme": "bearer",
        "description": "A session token. A browser sends the same session as the `droppedneedle_sid` or `__Secure-droppedneedle_sid` cookie. The scope names the posture, not a stored role: `user` is any signed-in account, `curator` is trusted or admin, `admin` is admin only."
      },
      "upgrade_session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "droppedneedle_upgrade",
        "description": "The upgrade page's own sign-in, served only by a server started on v2 data, as `droppedneedle_upgrade` or `__Secure-droppedneedle_upgrade`. No session satisfies it."
      },
      "wrapped_key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Wrapped-API-Key",
        "description": "The shared secret of the wrapped API. No session satisfies it."
      }
    }
  }
}
