API request via cURL
I feel like I'm an idiot, I'm trying to trigger library rescan via API ( https://immich.app/docs/api/scan-library )
To do that, I need to get library ID(s) - https://immich.app/docs/api/get-all-libraries/
Here's my command:
the response I get:
{"id":"9adf1f07-5d22-49a0-a853-6c143b00cd4c","ownerId":"my_user_id","name":"New External Library","createdAt":"2025-01-02T15:11:08.046Z","updatedAt":"2025-01-02T15:11:08.046Z","refreshedAt":null,"assetCount":0,"importPaths":[],"exclusionPatterns":["**/@eaDir/**","**/._*"]}
the effect I get: my user has just created a new external library. Currently existing are missing from the reponse.
WTH am I doing wrong here??30 Replies
:wave: Hey @Bretos,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
2. :ballot_box_with_check: read applicable release notes.
3. :ballot_box_with_check: reviewed the FAQs for known issues.
4. :ballot_box_with_check: reviewed Github for known issues.
5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
6. :ballot_box_with_check: uploaded the relevant information (see below).
7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.
Successfully submitted, a tag has been added to inform contributors. :white_check_mark:What is
?direction=getAllLibraries
supposed to do? 👀
Also, only admin users can trigger a library scan
Also, there's a cronjob you can customize that already re-scans the libraries every specified intervalOK, I think I've lost my head somewhere after last year and before current one. What's the correcth URL for
getAllLibraries
then? does API require any additional arguments, like direction
?
I want to trigger scan manually after a specific sync operation is completed, as inotify is funky over NFS/api/libraries
is correct, you need an admin api key though
And no, it does not require any additional arguments, otherwise the docs would say so :)admin api = api created via "setting" of an user that is an admin?
Yep
still the same issue, creates new library and doesn't list the existing one.
when I POST at
curl -X POST "https://immich.example.com/api/libraries/getAllLibraries" \
I get the response:
{"message":"Cannot POST /api/libraries/getAllLibraries","error":"Not Found","statusCode":404,"correlationId":"0c92j5ys"}#
Yes, this endpoint does not exist
Why are you sending
{ownerId: }
?because otherwise
{"message":["ownerId must be a UUID","ownerId should not be empty","ownerId must be a string"],"error":"Bad Request","statusCode":400,"correlationId":"al7r8dpl"}#
so how do I call directly to getAllLibraries
?You don't call
getAllLibraries
The endpoint is called libraries
Are you using AI for this?
This is odd and should not happen
Which version is your Immich server on?Lol, we're doomed if I am
1.123.0
Yeah, I am just confused where you get all this stuff from, e.g. the
?direction=
paramI tried some random stuff after it didn't work like I expected, mainly from https://github.com/immich-app/immich/discussions/13081
Can you try it against the demo instance?
As that works for me

Oh wait I see your issue

but then...
Exactly
You were POSTing
But this is a GET endpoint
lol
It returns all external libraries, which is to be expected no?
let me try that on my instance
yeah I just assumed they have different names without checking that first, that's why I deleted my message after checking it 😄
Ah lol
I am surprised the POST gave you anything tbh
OMG one would think that after enough years one can write a simple api request on one's own
😅
Happens to the best
and then we get here anyway
it works, thank you @Daniel !
And I didn't spot it immediately either :D
yeah post created new ext library
Ooooohh
And that requires an ownerId
That makes so much sense actually lol