Scripting Plex Home User PIN's?

Does anyone know if you can script the modification of user PINs in a Plex Home environment? If so, do you have an example(s)?

My goal is to log the amount of data used with my ISP and when it gets close to the cap it would reset PINs to something the users wouldn’t know. Once the data cap is reset for the month by the ISP, I could then change them back to the previous PIN and this would allow users to view as they normally would. It would require a separate web app to manage all this (knowing previous PINs, data usage, etc) which is in the works.

The other option would be to run a script that would turn off remote access (like using the “Disable Remote Access” button) in the server settings, but I haven’t been able to find any API info for accomplishing this either…

I’ve looked numerous times and couldn’t find anything…hopefully it just wasn’t overlooked…

Any information would be greatly appreciated!

I would enable debug mode in a browser like chrome, and then check what is send, when you enable/disable access to a library!

Not tested, but could be a way forward, to simply disable access to libraries

Thanks man…that told me what I needed to know! Sent the below as a PUT and it worked just fine.

https://plex.tv/api/home/users/USER_ID?pin=DESIRED_PIN
&X-Plex-Product=Plex%20Web
&X-Plex-Version=2.12.3
&X-Plex-Client-Identifier=ocp7zu3k9vi2uik9
&X-Plex-Platform=Chrome
&X-Plex-Platform-Version=55.0
&X-Plex-Device=Windows
&X-Plex-Device-Name=Plex%20Web%20%28Chrome%29
&X-Plex-Device-Screen-Resolution=1528x774%2C2560x1440
&X-Plex-Token=AUTH_TOKEN

Since @dane22 mentioned it above. I have a script that will unshare/share libraries.