# Manage Admins through API

**URL:** <https://forum.pritunl.com/t/manage-admins-through-api/1417>\
**Category:** Pritunl VPN\
**Created:** [September 29, 2023, 10:16pm UTC](https://forum.pritunl.com/t/manage-admins-through-api/1417 "2023-09-29T22:16:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@Bob](https://forum.pritunl.com/u/Bob)\
**Post date:** [September 29, 2023, 10:16pm UTC](https://forum.pritunl.com/t/manage-admins-through-api/1417/1 "2023-09-29T22:16:48Z")

</div>

I am working to automate admin access for pritunl.

Starting with revoking admins, I can get the list and individuals but can’t update them to disabled=true.

Any thoughts on what I can do?

GET  
/admin  
returns list of admins

GET  
/admin/961517c61z5up849me995e71  
returns only a specific admin

PUT  
/admin/961517c61z5up849me995e71  
returns 404.

Body  
{  
“id”: “961517c61z5up849me995e71”,  
“username”: "test-rando-user,  
“yubikey\_id”: null,  
“otp\_auth”: true,  
“otp\_secret”: “”,  
“auth\_api”: false,  
“token”: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,  
“secret”: "“xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”,  
“default”: false,  
“disabled”: true,  
“super\_user”: true,  
“audit”: true  
}

---

<div class="post-metadata">

**Author:** ![Bob](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@Bob](https://forum.pritunl.com/u/Bob)\
**Post date:** [October 2, 2023, 10:46pm UTC](https://forum.pritunl.com/t/manage-admins-through-api/1417/2 "2023-10-02T22:46:38Z")

</div>

So I solved it by passing fewer attributes, and I also observed that the other attributes I didn’t pass were not wiped out. So this works. Also if you do this and have a blank username, the filed will be blank in pritunl, so be careful with that one.

PUT  
/admin/961517c61z5up849me995e71

Body  
{  
“id”: “961517c61z5up849me995e71”,  
“username”: "test-rando-user,  
“disabled”: true,  
}

---

<div class="post-metadata">

**Author:** ![ihor.latyntsev](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/i/858c86/32.png) [@ihor.latyntsev](https://forum.pritunl.com/u/ihor.latyntsev)\
**Post date:** [October 24, 2023, 9:05am UTC](https://forum.pritunl.com/t/manage-admins-through-api/1417/3 "2023-10-24T09:05:32Z")

</div>

Hi @Bob , how you authenticate your requests with admin credentials ?  
Have you automated getting the admin API secret and token?
