Plex.tv - Remove an Admin User PIN

This API request will remove a PIN to an administrator account on a Plex server.

URL

PUT https://plex.tv/api/home/users/{user_id}?currentPin={current_pin}&pin=&X-Plex-Token={plex_token}

Parameters

NameDescription
plex_tokenThe Plex token.
user_idThe ID of the administrative user. You can get the user ID by making a request to the Get Users API and using the id attribute value for a user that has the admin attribute set to 1.
current_pinThe current PIN for the administrator account.

Return Status

HTTP CodeDescription
200Success - The request was successful.
401Unauthorized - The token used to make the request is not authorized to change the PIN.
404Not found - The user associated with the ID was not found. Verify the ID of the API request.

Response

Not much information is returned in the response. Only a status code of 200, a response code of 0, and a status indicating the user's PIN was removed is returned. The response of a successful PIN being removed from the administrative account is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<Response code="0" status="Updated user"/>

Remarks

The value of the pin parameter will need to be empty to have the PIN removed. Setting that parameter to a number will cause the administrator PIN to be changed to that PIN instead of removing the PIN.

This API request will return different responses for each error status code.

If the administrative user doesn't have a PIN, then this request will still return a 200 with the same response as indicated above.

You will get a 401 if the Plex token cannot be parsed on the command line. The response would be:

<?xml version="1.0" encoding="UTF-8"?>
<errors>
    <error>Please sign in.</error>
</errors>

If the provided Plex token is not a valid administrator token, then the request will return a 404 (Not Found) with the following response:

<?xml version="1.0" encoding="UTF-8"?>
<errors>
    <error>Invalid authentication token.</error>
</errors>

A 404 can also be returned if the user ID was not found. This error will have the following response:

<?xml version="1.0" encoding="UTF-8"?>
<Response code="404" status="User {user_id} could not be found in your home"/>

The user_id value will be replaced with the ID provided in the request.

Examples

curl -X PUT https://plex.tv/api/home/users/{user_id}?currentPin={current_pin}&pin=&X-Plex-Token={plex_token}
import requests
plex_url = https://plex.tv/api/home/users/{user_id}?currentPin={current_pin}&pin=&X-Plex-Token={plex_token}

response = requests.put(plex_url)

print(response.text)
$response = Invoke-RestMethod 'https://plex.tv/api/home/users/{user_id}?currentPin={current_pin}&pin=&X-Plex-Token={plex_token}' -Method 'PUT'

Write-Output $response
Subscribe
Display