.NET SDK Delete a user with DeactivateOrDeleteUserAsync

I am using the Okta.Sdk in a .net core project.
The requirement is to delete a user.
I am trying to use the DeactivateOrDeleteUserAsync endpoint to achieve this.
It seems necessary to call DeactivateOrDeleteUserAsync TWICE on the same user to actually delete them. The first time the user is set to Deactivated and the second time the user is actually deleted.

Is it possible to achieve deleting the user in one call?

What you’re seeing is by design for the Users endpoint, which the SDK is wrapping around here, as a sort of precaution for accidental full deletions: the first DELETE call will deactivate the user and a second DELETE call will actually delete them from your org.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.