[Bug]: Library ID not found when using API #2070

Closed
opened 2026-04-25 00:03:09 +02:00 by adam · 2 comments
Owner

Originally created by @0507spc on GitHub (Jun 23, 2024).

What happened?

When trying to upload files via API I get:

HTTPError: 404 - Not Found
Response content: Library not found with id undefined

What did you expect to happen?

Upload should work / Library ID should be found.

Steps to reproduce the issue

  1. Using:
    API_URL_LIBRARIES=${API_BASE_URL}/libraries
    API_URL_UPLOAD=${API_BASE_URL}/upload
  2. Call LIBRARIES and get libraries.1.folders.1.libraryId and libraries.1.folders.1.id for library / folder
  3. Use this in the upload call and I get the error Library not found, I have tried with library name too and get the same error.

Audiobookshelf version

V2.10.1

How are you running audiobookshelf?

Docker

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

No response

Additional Notes

No response

Originally created by @0507spc on GitHub (Jun 23, 2024). ### What happened? When trying to upload files via API I get: HTTPError: 404 - Not Found Response content: Library not found with id undefined ### What did you expect to happen? Upload should work / Library ID should be found. ### Steps to reproduce the issue 1. Using: API_URL_LIBRARIES=${API_BASE_URL}/libraries API_URL_UPLOAD=${API_BASE_URL}/upload 2. Call LIBRARIES and get libraries.1.folders.1.libraryId and libraries.1.folders.1.id for library / folder 3. Use this in the upload call and I get the error Library not found, I have tried with library name too and get the same error. ### Audiobookshelf version V2.10.1 ### How are you running audiobookshelf? Docker ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs _No response_ ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:03:09 +02:00
adam closed this issue 2026-04-25 00:03:09 +02:00
Author
Owner

@advplyr commented on GitHub (Jun 23, 2024):

Please share the exact API request you are making, excluding the API key

@advplyr commented on GitHub (Jun 23, 2024): Please share the exact API request you are making, excluding the API key
Author
Owner

@0507spc commented on GitHub (Jun 24, 2024):

Sorry about that, it was me:

I had:

response = requests.post(f"{API_BASE_URL}/upload", headers=authenticate(), data=form_data)

it should have been with files separated in the call:

response = requests.post(f"{API_BASE_URL}/upload", headers=authenticate(), data=form_data, files=files)

@0507spc commented on GitHub (Jun 24, 2024): Sorry about that, it was me: I had: response = requests.post(f"{API_BASE_URL}/upload", headers=authenticate(), data=form_data) it should have been with files separated in the call: response = requests.post(f"{API_BASE_URL}/upload", headers=authenticate(), data=form_data, files=files)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2070