How to enable/disable user via REST API
Symptom
The disable and enable user REST API were newly introduced in PVWA REST 12.6 and not available in PVWA REST 12.2.
Please refer to the following documentation on API specifications:
REST 12.2 :
https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/12.2/en/Content/SDK/API%20Commands%20-%20User%20Web%20Services.htm?tocpath=Developer%7CREST%20APIs%7CUser%20management%7CUsers%7C_____0
Rest 12.6 :
https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/12.6/en/Content/SDK/API%20Commands%20-%20User%20Web%20Services.htm?tocpath=Developer%7CREST%20APIs%7CUser%20management%7CUsers%7C_____0
EnableUser : {{pasBaseURL}}/passwordvault/api/users/{{pasUserID}}/enable
DisableUser : {{pasBaseURL}}/passwordvault/api/users/{{pasUserID}}/disable
In both API above, the pasUserID parameter should be the user "id" instead of "username".
As an example, the JSON result of GetUsers returned the following record:
---------------------------------
"id": 138,
"username": "domainuser03",
--------------------------------
Based on the API specifications, invoke the EnableUser and DisableUser API with the following values (eg. 138 instead of domainuser03):
EnableUser : {{pasBaseURL}}/passwordvault/api/users/138/enable
DisableUser : {{pasBaseURL}}/passwordvault/api/users/138/disable
Environment
12.6 Privileged Access Manager (PAM, self-hosted) Password Vault Web Access Password Vault Web Access Other