# What causes a plex token to change?

**URL:** <https://forums.plex.tv/t/what-causes-a-plex-token-to-change/691993>\
**Category:** Plex Media Server\
**Tags:** server-linux, account\
**Created:** [February 18, 2021, 1:35pm UTC](https://forums.plex.tv/t/what-causes-a-plex-token-to-change/691993 "2021-02-18T13:35:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![PAUL\_THOMAS1964](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@PAUL\_THOMAS1964](https://forums.plex.tv/u/PAUL_THOMAS1964)\
**Post date:** [February 18, 2021, 1:35pm UTC](https://forums.plex.tv/t/what-causes-a-plex-token-to-change/691993/1 "2021-02-18T13:35:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [February 18, 2021, 1:46pm UTC](https://forums.plex.tv/t/what-causes-a-plex-token-to-change/691993/2 "2021-02-18T13:46:57Z")

</div>

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](https://app.plex.tv/desktop#!/settings/devices/all)

---

<div class="post-metadata">

**Author:** ![PAUL\_THOMAS1964](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@PAUL\_THOMAS1964](https://forums.plex.tv/u/PAUL_THOMAS1964)\
**Post date:** [February 18, 2021, 1:54pm UTC](https://forums.plex.tv/t/what-causes-a-plex-token-to-change/691993/3 "2021-02-18T13:54:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [February 18, 2021, 1:56pm UTC](https://forums.plex.tv/t/what-causes-a-plex-token-to-change/691993/4 "2021-02-18T13:56:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PAUL\_THOMAS1964](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@PAUL\_THOMAS1964](https://forums.plex.tv/u/PAUL_THOMAS1964)\
**Post date:** [February 18, 2021, 2:03pm UTC](https://forums.plex.tv/t/what-causes-a-plex-token-to-change/691993/5 "2021-02-18T14:03:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [February 18, 2021, 2:37pm UTC](https://forums.plex.tv/t/what-causes-a-plex-token-to-change/691993/6 "2021-02-18T14:37:08Z")

</div>

> [@PAUL\_THOMAS1964](#):
>
> but think it maybe beyond my coding abilities.

Sorry, the same here. 😅

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [May 19, 2021, 2:37pm UTC](https://forums.plex.tv/t/what-causes-a-plex-token-to-change/691993/7 "2021-05-19T14:37:41Z")

</div>

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