Where to Get the Plex Token?

If you ever need to access a plugin, application or script from outside of Plex you will required to provide you Plex token. You may also be asking where to get the Plex token?

While most users won’t need to worry about, or use the Plex token, if you wish to create an application or script that calls the Plex API commands, you will need to provide the X-Plex-Token value.

Where to Get the Plex Token?

What is the Plex Token?

The Plex token is used to authenticate a device with your Plex server. When you are signed into your Plex Media Server, you are assigned a generated token. This token is used to authenticate your device with your Plex server. This replaces having to provide your user ID and password with each request you make to Plex.

The token we will be looking at in this article will be different for each device and Web browser you use to sign into Plex. For example, if you sign into Plex on two different browsers on the same system, each browser would have a different Plex token.

The good news, is that you only need one token to use with the Plex API – as long as the token is valid. So once you sign into Plex, you can just grab the token and use it to access Plex.

So how do you get the Plex token, I’ll explain it in the next section.

Where to get the Plex token?

Once you are signed into your Plex Media Server as an admin, it is easy to get the Plex token. To get the token, use the following steps:

  1. Open a Web browser and navigate to your Plex server and access the server using an ID that has full access to the server.
  2. Navigate to any item on your Plex server. Make sure it is an individual item, and not a collection or series, as the option we will use is only accessible for an item.
  3. With the item available, click the three dots to display a context menu, and then click the Get Info option.
    Plex Get Info option
    Get info for an item in Plex Media Server.
  4. The information window about the item will appear. In the lower-left corner, click the View XML link.
    Plex View XML option
    View XML in Plex Media Server.
  5. The XML data for the item will appear in the browser window. The Plex Token will be shown at the end (far right) of the URL.
    Plex Token in URL
    Plex token displayed in URL.

Now that you have the token, you can copy it and use it within the Plex API commands to return information about the Plex server.

The steps outline above can only be done by a Plex user with full access on the server, not from other accounts. This is because the Get Info, and the View XML link are only visible to a user with full permissions.

What happens if you need a new token – perhaps the token has been misused, or others know of it? The next section will explain how you can invalidate tokens for your Plex server.

Regenerating a new token

You may need to make the tokens associated with your Plex server invalid. Since they are used to authenticate to your server, you may have found one that is being misused. Making your tokens invalid isn’t something most users will need to do – I haven’t had a need myself, but the option is available.

To invalidate all the tokens associated with your Plex instance, do the following:

  1. Open a Web browser and navigate to your Plex account profile.
  2. Click the Edit link next to the Password option.
  3. After filling in the new password fields and the current password, check the Sign out connected devices after password change checkbox.

After performing the above steps, all tokens previously associated with your account will now be invalid. This means that all servers and clients will no longer be connected to your Plex account. You will need to claim your Plex server to have it associated to your account.

The above sections talked about what is the Plex token, where to get the Plex token and how to make the tokens associated with your account invalid. While most users of Plex won’t have a need for the Plex token, it is available if you would like to do more with your server.

The server Plex Token

The above sections discussed the Plex tokens that can be created to authenticate devices to Plex. There is also another token that authenticates your Plex server to your Plex account.

This server token is stored with the Plex settings, and isn't readily available to be read. If you have access to your server, you can find the Plex token easily.

Location of the Plex server token

The Plex token for your server is stored in a location that is dependent on what operating system you use for your Plex server:

Location of the Server Plex Token
Operating SystemLocation
WindowsHKEY_CURRENT_USER\Software\Plex, Inc.\Plex Media Server
Value: PlexOnlineToken
Key: PlexOnlineToken
Linux$PLEX_HOME/Library/Application Support/Plex Media Server/Preferences.xml
Value: PlexOnlineToken
Debian, Fedora, Ubuntu, and CentOS/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Preferences.xml
Value: PlexOnlineToken

How to reset the server Plex token

While I don't recommend you do this, or would have any reason to reset your server's authentication token, you can reset your Plex authentication token if you choose.

If you do reset your server's Plex authentication token, you will need to reclaim your Plex server for your Plex account.

To reset your server's Plex authentication token, you would need to do the following:

  1. Log into your Plex server.
  2. Open the settings location as described in the previous section.
  3. Delete the following values from the settings:
    • PlexOnlineHome (this setting will only be available if you are using the Plex Home managed users feature.)
    • PlexOnlineMail
    • PlexOnlineToken
    • PlexOnlineUsername
  4. Restart Plex, and then claim your server for your Plex.tv account.

Reclaiming your Plex server should have regenerated a new authentication token for your Plex server. The old authentication token is now invalid.

What can you do with the Plex token?

The Plex token assigned to a device that can access Plex can be used for a few functions. The first was mentioned earlier: to access the Plex Media Server API commands.

Each Plex API command requires the Plex token to be provided for authentication. When a valid token is provided, the user can get information about the Plex server. An invalid token will return an unauthorized error.

A second function that can be used is to download the latest Plex version from the online Plex server. The Plex Server Auto Updater tool used to update Plex when it is run as a Windows service, reads the token from the registry and uses it to download the latest version of Plex Media Server.