Maybe this is a tip worth sharing as the dox don't make it clear at all. The api specs for /api/v0/user/add/ ("Create user") and /api/v0/user/delete/ ("User delete") appear pleasingly symmetrical, and given that the usage of the former is
r = requests.post(f'https://my.opalstack.com/api/v0/user/add/',
auth=TokenAuth(TOKEN),
json={ "name": NAME, "server": SERVER })
one might think the usage of the latter would be
r = requests.post(f'https://my.opalstack.com/api/v0/user/delete/',
auth=TokenAuth(TOKEN),
json={ "id": UUID })
but that doesn't work. It works if you give it a list of dictionaries instead of just a dictionary:
r = requests.post(f'https://my.opalstack.com/api/v0/user/delete/',
auth=TokenAuth(TOKEN),
json=[{ "id": UUID }])
Evidently they like you to delete a whole bunch of users in one go. How they report the errors if some of the deletions succeed and some fail is left as an investigation for the reader.
Incidentally, the same consideration applies to /api/v0/app/delete/ and /api/v0/mail/delete/