{"openapi":"3.1.0","info":{"title":"qBittorrent WebUI API","description":"Torrent management and download control via qBittorrent WebUI","version":"2.9","contact":{"name":"qBittorrent Project","url":"https://www.qbittorrent.org"},"license":{"name":"GPL-2.0","url":"https://www.gnu.org/licenses/gpl-2.0.html"}},"servers":[{"url":"https://qbittorrent.haiven.site","description":"Production qBittorrent via Traefik"},{"url":"http://qbittorrent:8080","description":"Internal Docker network access"}],"tags":[{"name":"App","description":"Application information and control"},{"name":"Torrents","description":"Torrent management operations"},{"name":"Transfer","description":"Global transfer statistics"}],"security":[{"basicAuth":[]}],"paths":{"/api/v2/app/version":{"get":{"summary":"Get application version","description":"Retrieve the qBittorrent application version string","tags":["App"],"operationId":"getAppVersion","responses":{"200":{"description":"Version string returned successfully","content":{"text/plain":{"schema":{"type":"string","example":"v4.5.0"}}}},"401":{"description":"Unauthorized - invalid credentials"},"500":{"description":"Internal server error"}}}},"/api/v2/app/webapiVersion":{"get":{"summary":"Get WebAPI version","description":"Retrieve the WebAPI version supported by this qBittorrent instance","tags":["App"],"operationId":"getWebApiVersion","responses":{"200":{"description":"WebAPI version","content":{"text/plain":{"schema":{"type":"string","example":"2.9"}}}},"401":{"description":"Unauthorized - invalid credentials"}}}},"/api/v2/torrents/info":{"get":{"summary":"List torrents","description":"Retrieve information about torrents, with optional filtering and sorting","tags":["Torrents"],"operationId":"listTorrents","parameters":[{"name":"filter","in":"query","description":"Filter torrents by status","schema":{"type":"string","enum":["all","downloading","seeding","completed","paused","active","inactive"],"default":"all"}},{"name":"category","in":"query","description":"Filter by category name","schema":{"type":"string"}},{"name":"sort","in":"query","description":"Sort field (e.g., name, size, progress, added_on)","schema":{"type":"string","default":"name"}},{"name":"reverse","in":"query","description":"Reverse sort order","schema":{"type":"boolean","default":false}},{"name":"limit","in":"query","description":"Limit number of results","schema":{"type":"integer","minimum":1}},{"name":"offset","in":"query","description":"Offset for pagination","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Torrent list","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TorrentInfo"}}}}},"401":{"description":"Unauthorized - invalid credentials"},"500":{"description":"Internal server error"}}}},"/api/v2/torrents/properties":{"get":{"summary":"Get torrent properties","description":"Retrieve detailed properties for a specific torrent","tags":["Torrents"],"operationId":"getTorrentProperties","parameters":[{"name":"hash","in":"query","required":true,"description":"Torrent hash","schema":{"type":"string"}}],"responses":{"200":{"description":"Torrent properties","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TorrentProperties"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Torrent not found"}}}},"/api/v2/torrents/add":{"post":{"summary":"Add torrent","description":"Add a new torrent via URL, magnet link, or file upload","tags":["Torrents"],"operationId":"addTorrent","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"urls":{"type":"string","description":"Newline-separated list of torrent URLs or magnet links","example":"magnet:?xt=urn:btih:...\nhttp://example.com/torrent.torrent"},"torrents":{"type":"string","format":"binary","description":"Torrent file(s) to upload"},"savepath":{"type":"string","description":"Download destination path","example":"/downloads/movies"},"category":{"type":"string","description":"Category name","example":"movies"},"paused":{"type":"boolean","description":"Start torrent in paused state","default":false},"autoTMM":{"type":"boolean","description":"Use automatic torrent management","default":true},"sequentialDownload":{"type":"boolean","description":"Download sequentially","default":false},"firstLastPiecePriority":{"type":"boolean","description":"Prioritize first and last pieces","default":false}},"anyOf":[{"required":["urls"]},{"required":["torrents"]}]}}}},"responses":{"200":{"description":"Torrent added successfully","content":{"text/plain":{"schema":{"type":"string","example":"Ok."}}}},"400":{"description":"Invalid request (no URLs/files provided)"},"401":{"description":"Unauthorized"},"500":{"description":"Server error"}}}},"/api/v2/torrents/delete":{"post":{"summary":"Delete torrents","description":"Remove torrents from the client, optionally deleting data files","tags":["Torrents"],"operationId":"deleteTorrents","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"hashes":{"type":"string","description":"Pipe-separated list of torrent hashes, or 'all' for all torrents","example":"abc123|def456"},"deleteFiles":{"type":"boolean","description":"Delete associated files","default":false}},"required":["hashes"]}}}},"responses":{"200":{"description":"Torrents deleted successfully","content":{"text/plain":{"schema":{"type":"string","example":"Ok."}}}},"401":{"description":"Unauthorized"},"404":{"description":"Torrent not found"}}}},"/api/v2/torrents/pause":{"post":{"summary":"Pause torrents","description":"Pause one or more torrents","tags":["Torrents"],"operationId":"pauseTorrents","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"hashes":{"type":"string","description":"Pipe-separated list of torrent hashes, or 'all'","example":"abc123|def456"}},"required":["hashes"]}}}},"responses":{"200":{"description":"Torrents paused successfully","content":{"text/plain":{"schema":{"type":"string","example":"Ok."}}}},"401":{"description":"Unauthorized"},"404":{"description":"Torrent not found"}}}},"/api/v2/torrents/resume":{"post":{"summary":"Resume torrents","description":"Resume one or more paused torrents","tags":["Torrents"],"operationId":"resumeTorrents","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"hashes":{"type":"string","description":"Pipe-separated list of torrent hashes, or 'all'","example":"abc123|def456"}},"required":["hashes"]}}}},"responses":{"200":{"description":"Torrents resumed successfully","content":{"text/plain":{"schema":{"type":"string","example":"Ok."}}}},"401":{"description":"Unauthorized"},"404":{"description":"Torrent not found"}}}},"/api/v2/torrents/recheck":{"post":{"summary":"Recheck torrents","description":"Force recheck torrent integrity for one or more torrents","tags":["Torrents"],"operationId":"recheckTorrents","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"hashes":{"type":"string","description":"Pipe-separated list of torrent hashes, or 'all'","example":"abc123|def456"}},"required":["hashes"]}}}},"responses":{"200":{"description":"Recheck initiated","content":{"text/plain":{"schema":{"type":"string","example":"Ok."}}}},"401":{"description":"Unauthorized"}}}},"/api/v2/torrents/setLocation":{"post":{"summary":"Set torrent location","description":"Move or change the save location for torrents","tags":["Torrents"],"operationId":"setTorrentLocation","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"hashes":{"type":"string","description":"Pipe-separated list of torrent hashes"},"location":{"type":"string","description":"New save location path"}},"required":["hashes","location"]}}}},"responses":{"200":{"description":"Location changed","content":{"text/plain":{"schema":{"type":"string","example":"Ok."}}}},"400":{"description":"Invalid path"},"401":{"description":"Unauthorized"}}}},"/api/v2/torrents/setCategory":{"post":{"summary":"Set torrent category","description":"Assign or change category for torrents","tags":["Torrents"],"operationId":"setTorrentCategory","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"hashes":{"type":"string","description":"Pipe-separated list of torrent hashes"},"category":{"type":"string","description":"Category name (empty to clear)"}},"required":["hashes"]}}}},"responses":{"200":{"description":"Category set","content":{"text/plain":{"schema":{"type":"string","example":"Ok."}}}},"401":{"description":"Unauthorized"}}}},"/api/v2/transfer/info":{"get":{"summary":"Get global transfer info","description":"Retrieve global bandwidth, connection, and transfer statistics","tags":["Transfer"],"operationId":"getTransferInfo","responses":{"200":{"description":"Transfer statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferInfo"}}}},"401":{"description":"Unauthorized"}}}},"/api/v2/transfer/speedLimitsMode":{"get":{"summary":"Get speed limits mode","description":"Check if global speed limits are enabled","tags":["Transfer"],"operationId":"getSpeedLimitsMode","responses":{"200":{"description":"Speed limits mode","content":{"application/json":{"schema":{"type":"object","properties":{"limitUpl":{"type":"boolean","description":"Upload speed limit enabled"},"limitDl":{"type":"boolean","description":"Download speed limit enabled"}}}}}},"401":{"description":"Unauthorized"}}}},"/api/v2/transfer/setSpeedLimitsMode":{"post":{"summary":"Set speed limits mode","description":"Enable or disable global speed limits","tags":["Transfer"],"operationId":"setSpeedLimitsMode","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"mode":{"type":"integer","description":"0 = disable, 1 = enable","enum":[0,1]}},"required":["mode"]}}}},"responses":{"200":{"description":"Mode updated","content":{"text/plain":{"schema":{"type":"string","example":"Ok."}}}},"401":{"description":"Unauthorized"}}}}},"components":{"schemas":{"TorrentInfo":{"type":"object","description":"Basic torrent information","properties":{"hash":{"type":"string","description":"Torrent hash","example":"abc123def456"},"name":{"type":"string","description":"Torrent name","example":"Example Torrent"},"magnet_uri":{"type":"string","description":"Magnet link"},"category":{"type":"string","description":"Category name","example":"movies"},"state":{"type":"string","description":"Torrent state","enum":["allocating","metaDL","forcedDL","downloading","forcedUP","uploading","stalledDL","stalledUP","paused_DL","paused_UP","queuedForChecking","checkingUP","checkingDL","checkingResumeData","missingFiles","error"],"example":"downloading"},"progress":{"type":"number","description":"Progress as decimal (0-1)","example":0.75},"size":{"type":"integer","description":"Total torrent size in bytes","example":1073741824},"downloaded":{"type":"integer","description":"Downloaded size in bytes","example":805306368},"uploaded":{"type":"integer","description":"Uploaded size in bytes","example":2147483648},"ratio":{"type":"number","description":"Share ratio","example":2.5},"upspeed":{"type":"integer","description":"Upload speed in bytes/second","example":1048576},"dlspeed":{"type":"integer","description":"Download speed in bytes/second","example":2097152},"eta":{"type":"integer","description":"Estimated time to completion in seconds","example":3600},"added_on":{"type":"integer","description":"Unix timestamp when torrent was added","example":1701619200},"completion_on":{"type":"integer","description":"Unix timestamp when torrent completed (-1 if incomplete)","example":1701625200},"seen_complete":{"type":"integer","description":"Unix timestamp when torrent was last seen complete","example":1701625200},"time_active":{"type":"integer","description":"Total active time in seconds","example":86400},"total_wasted":{"type":"integer","description":"Wasted bytes (failed pieces)","example":0},"seeding_time":{"type":"integer","description":"Total seeding time in seconds","example":43200},"num_seeds":{"type":"integer","description":"Number of seeds","example":10},"num_leechs":{"type":"integer","description":"Number of leeches","example":5},"num_incomplete":{"type":"integer","description":"Number of incomplete peers","example":3},"last_seen":{"type":"integer","description":"Unix timestamp of last activity","example":1701625200},"peers":{"type":"integer","description":"Number of connected peers","example":15},"peers_total":{"type":"integer","description":"Total number of peers known","example":25},"seeds":{"type":"integer","description":"Number of connected seeds","example":10},"seeds_total":{"type":"integer","description":"Total number of seeds known","example":15},"max_ratio":{"type":"number","description":"Maximum share ratio (-1 = unlimited)","example":2.0},"max_seeding_time":{"type":"integer","description":"Maximum seeding time in seconds (-1 = unlimited)","example":-1},"availability":{"type":"number","description":"Swarm availability","example":1.25},"auto_tmm":{"type":"boolean","description":"Automatic torrent management enabled"},"has_metadata":{"type":"boolean","description":"Metadata is available"},"host_queue_position":{"type":"integer","description":"Queue position","example":5},"save_path":{"type":"string","description":"Save path for files","example":"/downloads/movies"},"super_seeding":{"type":"boolean","description":"Super seeding enabled"},"tags":{"type":"array","items":{"type":"string"},"description":"Associated tags"},"total_downloaded":{"type":"integer","description":"Total downloaded across all sessions","example":805306368},"total_uploaded":{"type":"integer","description":"Total uploaded across all sessions","example":2147483648}}},"TorrentProperties":{"type":"object","description":"Detailed torrent properties","allOf":[{"$ref":"#/components/schemas/TorrentInfo"},{"type":"object","properties":{"addition_date":{"type":"integer","description":"Unix timestamp of addition"},"comment":{"type":"string","description":"Torrent comment"},"created_by":{"type":"string","description":"Creator string"},"creation_date":{"type":"integer","description":"Unix timestamp of creation"},"dl_limit":{"type":"integer","description":"Download speed limit (bytes/s, -1 = unlimited)"},"up_limit":{"type":"integer","description":"Upload speed limit (bytes/s, -1 = unlimited)"},"infohash_v1":{"type":"string","description":"v1 info hash"},"infohash_v2":{"type":"string","description":"v2 info hash"},"is_seed":{"type":"boolean","description":"Is seeding"},"nb_connections":{"type":"integer","description":"Number of connections"},"nb_connections_limit":{"type":"integer","description":"Connection limit"},"private":{"type":"boolean","description":"Private torrent"},"piece_size":{"type":"integer","description":"Piece size in bytes"},"pieces_have":{"type":"integer","description":"Number of pieces downloaded"},"pieces_num":{"type":"integer","description":"Total number of pieces"},"reannounce":{"type":"integer","description":"Seconds to next announce"},"share_limit":{"type":"number","description":"Share limit ratio"}}}]},"TransferInfo":{"type":"object","description":"Global transfer statistics","properties":{"dl_info_speed":{"type":"integer","description":"Current download speed in bytes/second","example":2097152},"dl_info_data":{"type":"integer","description":"Total downloaded in bytes","example":10737418240},"up_info_speed":{"type":"integer","description":"Current upload speed in bytes/second","example":1048576},"up_info_data":{"type":"integer","description":"Total uploaded in bytes","example":21474836480},"dl_rate_limit":{"type":"integer","description":"Download rate limit in bytes/second (-1 = unlimited)","example":-1},"up_rate_limit":{"type":"integer","description":"Upload rate limit in bytes/second (-1 = unlimited)","example":-1},"dht_nodes":{"type":"integer","description":"Number of DHT nodes connected","example":150},"connection_status":{"type":"string","description":"Connection status","enum":["connected","firewalled","disconnected"],"example":"connected"},"queueing":{"type":"boolean","description":"Queueing is enabled"},"use_alt_speed_limits":{"type":"boolean","description":"Alternative speed limits are active"},"refresh_interval":{"type":"integer","description":"Refresh interval in milliseconds","example":1500},"global_ratio":{"type":"number","description":"Global share ratio","example":2.15},"global_dl_limit":{"type":"integer","description":"Global download limit (bytes/s)","example":-1},"global_up_limit":{"type":"integer","description":"Global upload limit (bytes/s)","example":-1},"total_wasted":{"type":"integer","description":"Total wasted bytes","example":1048576},"total_peer_connections":{"type":"integer","description":"Total peer connections","example":45},"total_queued_size":{"type":"integer","description":"Total size of queued torrents","example":5368709120},"total_downloaded":{"type":"integer","description":"Total downloaded in session","example":10737418240},"total_uploaded":{"type":"integer","description":"Total uploaded in session","example":21474836480},"free_space_on_disk":{"type":"integer","description":"Free space on disk in bytes","example":107374182400}}}},"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"HTTP Basic Authentication (username:password)"}}}}