DUO API : 401, ReasonPhrase: 'Unauthorized' using HTTPClient in POST


DUO Community-

When trying to access the DUO API to get the DUO User Info using HTTPClient in POST.
https://****.com/admin/v1/users , getting Error : 401, ReasonPhrase: ‘Unauthorized’

But its working fine when using GET by passing userid in query string

Please advise



Hey there Samy,

You POST to make a change, or GET to retrieve information. You wouldn’t POST to retrieve information (implied by the statement “to get the DUO User Info using HTTPClient in POST”).

Compare these GET operations: Retrieve Users, Retrieve Groups to these POST operations: Create User. Create Group.

So, a GET on /admin/v1/users would return the full list of Duo users, but a POST on /admin/v1/users won’t do anything.

Just wanted to clarify what action you are trying to perform in the POST.


Thanks so much for the reply.

Yes, I used POST to retrieve the Info. I will check these methods and get back to you.





GET is working fine, able to Retrieve the User.

But POST / DELETE ,not working, getting ‘UnAuthorized’ Error. This issue is there in HTTPClient. But the same data working fine in WebClient.

please let me know if you need any other details




I’m not sure why you are receiving an error and frankly I don’t understand what you are trying to do via POST. Can you provide an example?



Never mind. I found the issue and fixed it.

Auth Key data was not correct.

Thanks again for your support.



Not sure if this would be applicable to your scenario, but you can use workato to connect to Duo via API to search for events and change Duo-user state.
Workato has SDK connector for Duo API: