Scan a Single Library

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 run the 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 a single in your Plex server.

URL

GET http://[IP address]:32400/library/sections/[Library ID]/refresh?X-Plex-Token=[PlexToken]

Parameters

NameDescription
IP addressThe IP address of the Plex Media server.
PlexTokenThe temporary authentication Plex token.
Library IDThe key associated with the library. This key can be found by calling the Libraries API command.

Return Status

HTTP CodeDescription
200Success - The request was successful.
401Unauthorized - The Plex token provided was not valid.

Response

No response is returned. You will be able to see the scan API command run from the Plex console.

Remarks

The time it takes for the scan to complete is dependent on how many media times are within the library

This command will return immediately, but the scan will still be running on the Plex server.

Examples

Example 1

Scan the library associated with ID 2 for the Plex server located at IP address of 192.168.1.4:

GET http://192.168.1.4:32400/library/sections/2/refresh?X-Plex-Token=L6vkd7JtLHjsH5987vYY