REST API Reference
AutoBangumi exposes a REST API at /api/v1. All endpoints (except login and setup) require JWT authentication.
Base URL: http://your-host:7892/api/v1
Authentication: Include the JWT token as a cookie or Authorization: Bearer <token> header.
Interactive Docs: When running in development mode, Swagger UI is available at http://your-host:7892/docs.
Authentication
Login
POST /auth/loginAuthenticate with username and password.
Request Body:
{
"username": "string",
"password": "string"
}Response: Sets authentication cookie with JWT token.
Refresh Token
GET /auth/refresh_tokenRefresh the current authentication token.
Logout
GET /auth/logoutClear authentication cookies and log out.
Update Credentials
POST /auth/updateUpdate username and/or password.
Request Body:
{
"username": "string",
"password": "string"
}Passkey / WebAuthn v3.2+
Passwordless authentication using WebAuthn/FIDO2 Passkeys.
Register Passkey
POST /passkey/register/optionsGet WebAuthn registration options (challenge, relying party info).
POST /passkey/register/verifyVerify and save the Passkey registration response from the browser.
Authenticate with Passkey
POST /passkey/auth/optionsGet WebAuthn authentication challenge options.
POST /passkey/auth/verifyVerify the Passkey authentication response and issue a JWT token.
Manage Passkeys
GET /passkey/listList all registered Passkeys for the current user.
POST /passkey/deleteDelete a registered Passkey by credential ID.
Configuration
Get Configuration
GET /config/getRetrieve the current application configuration.
Response: Full configuration object including program, downloader, rss_parser, bangumi_manager, notification, proxy, and experimental_openai sections.
Update Configuration
PATCH /config/updatePartially update the application configuration. Only include fields you want to change.
Request Body: Partial configuration object.
Bangumi (Anime Rules)
List All Bangumi
GET /bangumi/get/allGet all anime download rules.
Get Bangumi by ID
GET /bangumi/get/{bangumi_id}Get a specific anime rule by ID.
Update Bangumi
PATCH /bangumi/update/{bangumi_id}Update an anime rule's metadata (title, season, episode offset, etc.).
Delete Bangumi
DELETE /bangumi/delete/{bangumi_id}Delete a single anime rule and its associated torrents.
DELETE /bangumi/delete/many/Batch delete multiple anime rules.
Request Body:
{
"bangumi_ids": [1, 2, 3]
}Disable / Enable Bangumi
DELETE /bangumi/disable/{bangumi_id}Disable an anime rule (keeps files, stops downloading).
DELETE /bangumi/disable/many/Batch disable multiple anime rules.
GET /bangumi/enable/{bangumi_id}Re-enable a previously disabled anime rule.
Poster Refresh
GET /bangumi/refresh/poster/allRefresh poster images for all anime from TMDB.
GET /bangumi/refresh/poster/{bangumi_id}Refresh the poster image for a specific anime.
Calendar
GET /bangumi/refresh/calendarRefresh the anime broadcast calendar data from Bangumi.tv.
Reset All
GET /bangumi/reset/allDelete all anime rules. Use with caution.
RSS Feeds
List All Feeds
GET /rssGet all configured RSS feeds.
Add Feed
POST /rss/addAdd a new RSS feed subscription.
Request Body:
{
"url": "string",
"aggregate": true,
"parser": "mikan"
}Enable / Disable Feeds
POST /rss/enable/manyEnable multiple RSS feeds.
PATCH /rss/disable/{rss_id}Disable a single RSS feed.
POST /rss/disable/manyBatch disable multiple RSS feeds.
Delete Feeds
DELETE /rss/delete/{rss_id}Delete a single RSS feed.
POST /rss/delete/manyBatch delete multiple RSS feeds.
Update Feed
PATCH /rss/update/{rss_id}Update an RSS feed's configuration.
Refresh Feeds
GET /rss/refresh/allManually trigger a refresh of all RSS feeds.
GET /rss/refresh/{rss_id}Refresh a specific RSS feed.
Get Torrents from Feed
GET /rss/torrent/{rss_id}Get the list of torrents parsed from a specific RSS feed.
Analysis & Subscription
POST /rss/analysisAnalyze an RSS URL and extract anime metadata without subscribing.
Request Body:
{
"url": "string"
}POST /rss/collectDownload all episodes from an RSS feed (for completed anime).
POST /rss/subscribeSubscribe to an RSS feed for automatic ongoing downloads.
Search
Search Bangumi (Server-Sent Events)
GET /search/bangumi?keyword={keyword}&provider={provider}Search for anime torrents. Returns results as a Server-Sent Events (SSE) stream for real-time updates.
Query Parameters:
keyword— Search keywordprovider— Search provider (e.g.,mikan,nyaa,dmhy)
Response: SSE stream with parsed search results.
List Search Providers
GET /search/providerGet the list of available search providers.
Program Control
Get Status
GET /statusGet program status including version, running state, and first_run flag.
Response:
{
"status": "running",
"version": "3.2.0",
"first_run": false
}Start Program
GET /startStart the main program (RSS checking, downloading, renaming).
Restart Program
GET /restartRestart the main program.
Stop Program
GET /stopStop the main program (WebUI remains accessible).
Shutdown
GET /shutdownShutdown the entire application (restarts the Docker container).
Check Downloader
GET /check/downloaderTest connectivity to the configured downloader (qBittorrent).
Downloader Management v3.2+
Manage torrents in the downloader directly from AutoBangumi.
List Torrents
GET /downloader/torrentsGet all torrents in the Bangumi category.
Pause Torrents
POST /downloader/torrents/pausePause torrents by hash.
Request Body:
{
"hashes": ["hash1", "hash2"]
}Resume Torrents
POST /downloader/torrents/resumeResume paused torrents by hash.
Request Body:
{
"hashes": ["hash1", "hash2"]
}Delete Torrents
POST /downloader/torrents/deleteDelete torrents with optional file deletion.
Request Body:
{
"hashes": ["hash1", "hash2"],
"delete_files": false
}Setup Wizard v3.2+
These endpoints are only available during first-run setup (before setup is complete). They do not require authentication. After setup completes, all endpoints return 403 Forbidden.
Check Setup Status
GET /setup/statusCheck if setup wizard is needed (first run).
Response:
{
"need_setup": true
}Test Downloader Connection
POST /setup/test-downloaderTest connection to a downloader with provided credentials.
Request Body:
{
"type": "qbittorrent",
"host": "172.17.0.1:8080",
"username": "admin",
"password": "adminadmin",
"ssl": false
}Test RSS Feed
POST /setup/test-rssValidate an RSS feed URL is accessible and parseable.
Request Body:
{
"url": "https://mikanime.tv/RSS/MyBangumi?token=xxx"
}Test Notification
POST /setup/test-notificationSend a test notification with provided settings.
Request Body:
{
"type": "telegram",
"token": "bot_token",
"chat_id": "chat_id"
}Complete Setup
POST /setup/completeSave all configuration and mark setup as complete. Creates the sentinel file config/.setup_complete.
Request Body: Full configuration object.
Logs
Get Logs
GET /logRetrieve the full application log file.
Clear Logs
GET /log/clearClear the log file.
Response Format
All API responses follow a consistent format:
{
"msg_en": "Success message in English",
"msg_zh": "Success message in Chinese",
"status": true
}Error responses include appropriate HTTP status codes (400, 401, 403, 404, 500) with error messages in both languages.