As you add media items to a library, you will need to scan the library to have the items appear in Plex. If you have a many media items in a library, the scan can take a long time if you scan the whole library.
The solution is to only scan the items that have been added to the folder associated with the library.
This API command will allow you to scan a specific folder that contains the media item for a library, which will reduce the amount of time needed for scanning.
GET http://[IP address]:32400/library/sections/[Library ID]/refresh?path=[Folder]&X-Plex-Token=[PlexToken]
|IP address||The IP address of the Plex Media server.|
|PlexToken||The temporary authentication Plex token.|
|Library ID||The key associated with the library. This key can be found by calling the Libraries API command.|
|Folder||The path of the folder to be scanned for new media items. This value needs to be URL encoded.|
|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.
This command will return immediately, but the scan will still be running on the Plex server.
Scan the folder 'F:\Plex\Movies\Aladin (1992)' associated with library ID 2 for the Plex server located at IP address of 192.168.1.4: