Same problem whether I try the API Explorer https://developers.google.com/admin-sdk/directory/v1/reference/orgunits/delete#try-it or when using the .NET API.
I have a simple integration test that creates a new Orgunit + User under that orgunit.
Then I do this:
- List all users that match that orgunit path
- Delete them successfully
- Try to delete the orgunit itself => 404
I know the orgunit is still there. I can go into API Explorer and list it here https://developers.google.com/admin-sdk/directory/v1/reference/orgunits/list
If I try to delete it now in API Explorer, no such luck. I also tried using my root OU's real customer id (instead of my_customer). Still no luck.
The only way I can delete this orgunit is through the admin console.
This succeeds -- there were no sub-orgs or users underneath this org, or it would have failed.
Why can I not delete the Orgunit through the API or API Explorer?