--- method: POST path: /api/libraries/:id/scan auth: jwt+admin area: libraries --- # Scan Library Enqueues a full scan of one library's configured folders. The library id comes from the path — no request body is needed (the generic `POST /api/scanner/scan` variant is the one that takes `folder_paths`). Scans are **coalesced**: if a scan for this library is already pending or running you get **409** with the active job id instead of a second scan. ## Example response (202 Accepted) ```json example-response { "message": "scan job enqueued", "job_id": "dd0e8400-e29b-41d4-a716-446655440000", "status": "pending" } ``` ## Errors | Status | Body | When | | ------ | ---- | ---- | | 400 | `{"error": "invalid library id"}` / `{"error": "library has no folders configured"}` | malformed id / empty library | | 404 | `{"error": "library not found or has no folders"}` | unknown library | | 409 | `{"error": "a scan for this library is already pending or running", "active_job_id": "..."}` | scan coalescing | | 500 | `{"error": "failed to enqueue scan job: ..."}` | queue failure |