# Cannot connect anymore with api

**URL:** <https://forums.plex.tv/t/cannot-connect-anymore-with-api/836778>\
**Category:** Apps & Creations\
**Tags:** server-windows\
**Created:** [April 5, 2023, 5:21am UTC](https://forums.plex.tv/t/cannot-connect-anymore-with-api/836778 "2023-04-05T05:21:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinnyboyqc](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@vinnyboyqc](https://forums.plex.tv/u/vinnyboyqc)\
**Post date:** [April 5, 2023, 5:21am UTC](https://forums.plex.tv/t/cannot-connect-anymore-with-api/836778/1 "2023-04-05T05:21:30Z")

</div>

I hope someone can help me. I designed a Python script to be able to add metadata to videos are not movies or series. it’s a script that works with plex metadata Stash json metadata, ember media manager nfo metadata. i want to clasified my videos and create libraries to my liking i have been working with this for a few days it works great with plexbut today i started to get this message \>\>\> %Run tagmp41.py  
Erreur de connexion Plex : (401) unauthorized; [http://127.0.0.1:32400/](http://127.0.0.1:32400/) Unauthorized

# 401 Unauthorized
.I tried lots of ways i changed my token itried everything and i am going crazy. If anyone could help to find the cause of all this, it would be appreciate.

(tagmp4comb) C:\Users\vincy\>cd /d D:\Python\tagmp4 && python tagmp41.py  
Erreur de connexion Plex : (401) unauthorized; [http://127.0.0.1:32400/](http://127.0.0.1:32400/) Unauthorized

# 401 Unauthorized

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [April 5, 2023, 10:32am UTC](https://forums.plex.tv/t/cannot-connect-anymore-with-api/836778/2 "2023-04-05T10:32:22Z")

</div>

I assume that your script has an X-Plex-Token in either the header or the url

Have you verified the token is still valid?

---

<div class="post-metadata">

**Author:** ![vinnyboyqc](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@vinnyboyqc](https://forums.plex.tv/u/vinnyboyqc)\
**Post date:** [April 5, 2023, 10:38am UTC](https://forums.plex.tv/t/cannot-connect-anymore-with-api/836778/3 "2023-04-05T10:38:34Z")

</div>

i fif, i even change pw to get a new one, and got the same result…

---

<div class="post-metadata">

**Author:** ![dane22](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dane22/32/4389_2.png) [@dane22](https://forums.plex.tv/u/dane22)\
**Post date:** [April 5, 2023, 12:00pm UTC](https://forums.plex.tv/t/cannot-connect-anymore-with-api/836778/4 "2023-04-05T12:00:36Z")

</div>

Then show me the url it’s calling, but scramble the token

---

<div class="post-metadata">

**Author:** ![nutw07](https://avatars.discourse-cdn.com/v4/letter/n/4af34b/32.png) [@nutw07](https://forums.plex.tv/u/nutw07)\
**Post date:** [April 7, 2023, 2:59pm UTC](https://forums.plex.tv/t/cannot-connect-anymore-with-api/836778/5 "2023-04-07T14:59:47Z")

</div>

I have started to encounter a similar error. While I can retrieve information using the web API with URLs such as:  
`http://10.0.1.3:32400/status/sessions`  
As of a week or so ago, whenever I attempt to send a command to a player like the one below through the API, I only receive a 404 response.  
`http://10.0.1.3:32400/player/playback/pause?type=music&commandID=1&Plex-Token={{Plex-Token}}`

(`X-Plex-Target-Client-Identifier` is defined in the request header.)

---

<div class="post-metadata">

**Author:** ![nutw07](https://avatars.discourse-cdn.com/v4/letter/n/4af34b/32.png) [@nutw07](https://forums.plex.tv/u/nutw07)\
**Post date:** [November 3, 2023, 2:29pm UTC](https://forums.plex.tv/t/cannot-connect-anymore-with-api/836778/6 "2023-11-03T14:29:07Z")

</div>

This functionality has been restored for me in version 1.32.8.7639 as discussed [over here](https://forums.plex.tv/t/plex-web-flinging-casting-broken/837738/52).
