When you add or remove media from your Plex server you will need to scan the libraries to update Plex with the changed media. You can run the scan from the Plex Web app, or you can use this API command to scan from outside of Plex.
You should run a scan when one of the following has occurred:
- Added or removed media files.
- Added or removed directories from a library.
- Renamed a media file or directory.
- Moved any files from one location to another.
This command will run a scan for all libraries in your Plex server.
GET http://[IP address]:32400/library/sections/all/refresh?X-Plex-Token=[PlexToken]
|IP address||The IP address of the Plex Media server.|
|PlexToken||The temporary authentication Plex token.|
|200||Success - The request was successful.|
|401||Unauthorized - The Plex token provided was not valid.|
No response is returned. You will be able to see the scan API command run from the Plex console.
The time it takes for the scan to complete is dependent on how many media times are within each library, and the number of libraries on the Plex server.
This command will return immediately, but the scan will still be running on the Plex server.
Scan all libraries for the Plex server located at IP address of 192.168.1.4: