What causes a plex token to change?

My home automation system reads out the synopsis of films/shows I start to play on plex. Part of this involves using the api to pause playback, while the synopsis is read, and then resuming it.

This recently stopped working. After some investigation I discovered the plex-token used in the web request for pause/play had changed. Updating this got everything working again.

I was wondering, what can cause the plex-token to be changed? I’m not aware of anything I’ve done, other than the standard updates to PLMS.

The lifetime of a token is limited. It will only last about a few months.

Additionally

  • If you change your Plex password and tick the checkbox “Sign out connected devices after password change”, all tokens are immediately invalidated.
  • A token is also invalidated if you delete it from here: https://app.plex.tv/desktop#!/settings/devices/all

Thanks for the info.

That’s a bit of a pain! I’ll have to keep editing my code, unless I can code a method to get the token.

I’m not sure how long my token remained unchanged, but think it was quite some time, I’m sure more than a few months. I’ve not changed the password, or removed/added any devices

You might want to take a look at how Tautulli does it.

Thanks, I might take a look, but think it maybe beyond my coding abilities. I don’t suppose you know which module contains the relevant code?

I might just see how long the token lasts.

Sorry, the same here. :sweat_smile:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.