milmilmilmil
API 參考

Libraries

Library CRUD, scanning, browsing, completeness, capacity and connection tests

GET
/api/v1/libraries

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries"
[  {    "id": "string",    "name": "string",    "path": "string",    "enabled": 0,    "scan_interval_minutes": 0,    "last_scanned_at": "string",    "created_at": "string",    "updated_at": "string"  }]
POST
/api/v1/libraries

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/libraries" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "path": "string"  }'
{  "id": "string",  "name": "string",  "path": "string",  "enabled": 0,  "scan_interval_minutes": 0,  "last_scanned_at": "string",  "created_at": "string",  "updated_at": "string"}
POST
/api/v1/libraries/browse

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/libraries/browse" \  -H "Content-Type: application/json" \  -d '{}'
[  {    "name": "string",    "path": "string",    "is_dir": true,    "children": [      {}    ]  }]
GET
/api/v1/libraries/discover-network

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/discover-network"
[  {    "host": "string",    "name": "string"  }]
POST
/api/v1/libraries/test-connection

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/libraries/test-connection" \  -H "Content-Type: application/json" \  -d '{}'
{  "ok": true,  "error": "string"}
GET
/api/v1/libraries/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/string"
{  "id": "string",  "name": "string",  "path": "string",  "enabled": 0,  "scan_interval_minutes": 0,  "last_scanned_at": "string",  "created_at": "string",  "updated_at": "string"}
DELETE
/api/v1/libraries/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

curl -X DELETE "https://example.com/api/v1/libraries/string"
Empty
PUT
/api/v1/libraries/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PUT "https://example.com/api/v1/libraries/string" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "path": "string"  }'
{  "id": "string",  "name": "string",  "path": "string",  "enabled": 0,  "scan_interval_minutes": 0,  "last_scanned_at": "string",  "created_at": "string",  "updated_at": "string"}
GET
/api/v1/libraries/{id}/anime

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/string/anime"
[  {    "bangumi_id": 0,    "anilist_id": 0,    "title": "string",    "title_original": "string",    "title_en": "string",    "cover_image": "string",    "air_date": "string",    "episode_count": 0,    "score": 0  }]
DELETE
/api/v1/libraries/{id}/anime/{animeId}

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string
animeId*string

Response Body

curl -X DELETE "https://example.com/api/v1/libraries/string/anime/string"
Empty
GET
/api/v1/libraries/{id}/capacity

Returns total/used/free bytes for the library's root path (local sources only). Remote sources or unreachable paths report available=false with zero values.

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/string/capacity"
{  "total_bytes": 0,  "free_bytes": 0,  "used_bytes": 0,  "available": true,  "downloaded_this_month_bytes": 0}
GET
/api/v1/libraries/{id}/connection-status

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/string/connection-status"
{  "connected": true,  "error": "string"}
GET
/api/v1/libraries/{id}/duplicates

Returns one DupSet per episode that has 2+ media files, grouped across all anime in the library.

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/string/duplicates"
[  {    "anime_id": "string",    "anime_title": "string",    "episode_id": "string",    "episode_number": 0.1,    "preferred_id": "string",    "manually_set": true,    "files": [      {        "id": "string",        "path": "string",        "filename": "string",        "size_bytes": 0,        "resolution": 0,        "subgroup": "string",        "mod_time": "2019-08-24T14:15:22Z"      }    ],    "wasted_bytes": 0  }]
POST
/api/v1/libraries/{id}/duplicates/cleanup

Iterates duplicate episodes and deletes every file that isn't the preferred copy. Episodes with no preferred copy are skipped (no rank → nothing to keep). Returns counts and reclaimed bytes.

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X POST "https://example.com/api/v1/libraries/string/duplicates/cleanup"
{  "deleted": 0,  "reclaimed_bytes": 0,  "skipped": 0,  "errors": [    "string"  ]}
GET
/api/v1/libraries/{id}/file-tree

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/string/file-tree"
[  {    "name": "string",    "path": "string",    "is_dir": true,    "children": [      {}    ]  }]
POST
/api/v1/libraries/{id}/match

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

curl -X POST "https://example.com/api/v1/libraries/string/match"
Empty
GET
/api/v1/libraries/{id}/media-files

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Query Parameters

sort_by?string
sort_order?string

Value in

  • "asc"
  • "desc"

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/string/media-files"
[  {    "id": "string",    "library_id": "string",    "path": "string",    "filename": "string",    "size": 0,    "duration": 0,    "bangumi_id": 0,    "bangumi_episode_id": 0,    "episode_number": 0,    "created_at": "string",    "updated_at": "string"  }]
GET
/api/v1/libraries/{id}/missing-summary

Returns one CompletenessReport per anime in the library; useful for dashboards that surface incomplete series. Always emits an array (empty when nothing is missing).

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/string/missing-summary"
[  {    "anime_id": "string",    "bangumi_id": 0,    "title": "string",    "total": 0,    "have": [      0    ],    "missing": [      0    ],    "airing_pending": [      0    ],    "unknown_total": true,    "generated_at": "2019-08-24T14:15:22Z"  }]
POST
/api/v1/libraries/{id}/scan

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

curl -X POST "https://example.com/api/v1/libraries/string/scan"
Empty
GET
/api/v1/libraries/{id}/scan-summaries

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/libraries/string/scan-summaries"
[  {    "id": "string",    "library_id": "string",    "started_at": "string",    "completed_at": "string",    "files_found": 0,    "files_matched": 0,    "files_unmatched": 0,    "errors": "string"  }]
GET
/api/v1/library/{id}/scan/wait

Used by CLI/agents to block on scan completion. Returns immediately when no scan is running, or polls (default 300s, max 1800s) until completion. Note the singular /library/... path (CLI surface), distinct from the plural /libraries/... group.

Authorization

bearerAuth
AuthorizationBearer <token>

Pass an API token obtained from POST /api/v1/auth/login or POST /api/v1/api-tokens. Tokens have the prefix mlml_.

In: header

Path Parameters

id*string

Query Parameters

timeout?integer

Seconds to wait (1-1800, default 300)

Range1 <= value <= 1800
Default300

Response Body

application/json

curl -X GET "https://example.com/api/v1/library/string/scan/wait"
{  "library_id": "string",  "status": "complete",  "started_at": "2019-08-24T14:15:22Z",  "completed_at": "2019-08-24T14:15:22Z"}
GET
/api/v1/rclone/remotes

Response Body

application/json

curl -X GET "https://example.com/api/v1/rclone/remotes"
[  "string"]