Update a Movie

The movie metadata can be updated from the Plex API. This can be useful if you wish to perform a bulk update to movies in a library.

URL

PUT http://{ip_address}:32400/library/sections/{library_id}/all?type=1&id={movie_id}&includeExternalMedia={include_external_media}&{parameter_values}&X-Plex-Token={plex_token}

Parameters

NameDescription
ip_addressThe IP address of the Plex Media server.
plex_tokenThe Plex token.
library_idThe key associated with a movies library. This key can be found by calling the Libraries API command and looking for a movies library.
movie_idThe key associated with the movie to be updated. This key can be found by calling the Get All Movies API command and looking for the movie to be updated.
include_external_mediaFlag indicating whether external media will be included. Set this to 1 to keep the update command the same as the way it is executed from the Web app. Valid values are 0 and 1.
parameter_valuesA list of fields to be updated along with their values. The list of values is listed in the fields section below.

Return Status

HTTP CodeDescription
200Success - The request was successful.
400Bad Request - A field name is not valid.
401Unauthorized - The Plex token provided was not valid.
500Internal Server Error - Field data is not valid.

Response

There is no response returned by the server. Check the return status code to determine success.

Fields

The list of valid movie fields that can be updated using the Plex API is listed below.

Media Fields
Field NameParameter NameData TypeNotes
Titletitlestring 
Sort TitlesortTitlestring 
Original TitleoriginalTitlestring 
EditioneditionTitlestring 
Originally AvailableoriginallyAvailableAtdateFormat: yyyy-mm-dd
Content RatingcontentRatingstring 
RatinguserRatingintegerEach star equals 2 (rounded up for odds). 1 star = 1 or 2, 2 stars = 3 or 4, etc.
Studiostudiostring 
Taglinetaglinestring 
Summarysummarystring 
Directorsdirector[index]array 
Countrycountry[index]array 
Genresgenre[index]array 
Writerswriter[index]array 
Producersproducer[index]array 
Collectionscollection[index]array 
Labelslabel[index]array 

Non-array data types

For string, integer, and date data types, you would update the value of those fields using the following structure:

[field name].value=[value]

For example, to update the title of a media item to "The Title of the Item", you would use the following (%20 is an encoded space character):

title.value=The%20Title%20of%20the%20Item

If you would like to clear out the value of a field, you just set it to nothing:

title.value=

Array data types

To specify the parameters to update a field that has a data type of array, you would use the information outlined in the Arrays documentation.

Locking a field

If you have edited the details of a media item from the Plex Web app, you will have noticed that you can lock the value of a field. Locking a field prevents Plex from overwriting it with another value that it finds online

It is good practice to lock a field that you have changed using the API. To lock a field, you would use the following structure:

[field name].locked=1

The value "1" indicates the field is locked. Setting the value to "0" will unlock the field.

For example, the following will lock the "Title" field for an item:

title.locked=1

For fields that have an array data type, you don't specify the index of the array, you only use the field name:

genre.locked=1

Examples

curl -X PUT http://{ip_address}:32400/library/sections/{library_id}/all?type=1&id={movie_id}&includeExternalMedia={include_external_media}&{parameter_values}&X-Plex-Token={plex_token}
import requests
plex_url = http://{ip_address}:32400/library/sections/{library_id}/all?type=1&id={movie_id}&includeExternalMedia={include_external_media}&{parameter_values}&X-Plex-Token={plex_token}
response = requests.put(plex_url)
print(response.text)
$response = Invoke-RestMethod 'http://{ip_address}:32400/library/sections/{library_id}/all?type=1&id={movie_id}&includeExternalMedia={include_external_media}&{parameter_values}&X-Plex-Token={plex_token}' -Method 'PUT'
Write-Output $response
Subscribe
Display