How to activate delete user api for an app

When we submit a DELETE request to this api https://developer.okta.com/docs/api/resources/users.html#delete-user

the response is:

{“errorCode”:“E0000022”,“errorSummary”:“The endpoint does not support the provided HTTP method”,“errorLink”:“E0000022”,“errorId”:“oae0SNaWVhdQhGqBymk5bhsCA”,“errorCauses”:}>

How do we config our okta service to allow delete user?

I do not believe any configuration is needed.

Can you show me the full request being made?

The following works for me:

curl -X DELETE \
  https://dev-XXXX.oktapreview.com/api/v1/users/00u9ygf3j5dRybO8o0h7 \
  -H 'accept: application/json' \
  -H 'authorization: SSWS XXXXX' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json'

Hi, I tried this and the delete “worked” (got 204 response) but it just deactivated the user but didn’t delete. I had to manually go into the admin interface to truly delete it. How do I fully delete the user using API and without manual intervention?

Try sending the same delete request again. The first call deactivates, the second deletes.

Thanks for the quick reply. I’ll try that and report back!

That worked, thanks so much! As a bonus, any idea how to avoid the auto-generated Okta emails that I get sent every time a user is deactivated?

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