ImmichI
Immich12mo ago
Bretos

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:

curl -X POST "https://immich.example.com/api/libraries?direction=getAllLibraries" \
-H "x-api-key: API_Key_created_in_user_settings_webui" \
-H "Content-Type: application/json" \
-d '{"ownerId": "id_of_my_user_with_ext_library"}'

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??
Was this page helpful?
API request via cURL - Immich