Delete Action Not Removing User Account

Using this template helps us debug your issues more effectively :slight_smile:

Description
I am using the API to test creating/deleting Users. The accounts are created successfully but they are not being removed correctly. I corresponded with Max about this a few months ago, and he spoke to engineering and they said to make sure that I use the “delete” for the action and not “disassociate.” I have using “delete” but I am still having the same issue.

Error
The full error message or issue you are running into.
Please see the screenshots below.

Which App Type (OAuth / Chatbot / JWT / Webhook)?
Knowing the endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.

Authentication: This is an enterprise account so I am use JWT authentication.

Which Endpoint/s?
Knowing the API endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.

https://api.zoom.us/v2/users

To create:
$response = Invoke-RestMethod -Headers $headers -Uri https://api.zoom.us/v2/users -Body $body -ContentType ‘application/json’ -Method Post

To delete:
$response = Invoke-RestMethod -Uri https://api.zoom.us/v2/users/$User -Headers $headers -ContentType ‘application/json’ -Method DELETE

How To Reproduce (If applicable)
Steps to reproduce the behavior:
Please see screenshots below for detailed information.

  1. I create the account. This is an enterprise account so I am using “ssoCreate” and “2” for type. The account is created successfully and I can search for it in our user list.

  2. I test deleting the account. No errors returned and it no longer displays in our user list.

  3. Recreate the account using the same email. The message returned is: “The user xxx belong to another account.”

  4. Try to delete the account again but the message returned is “User does not exist.”

The following accounts are now stuck in Zoom limbo somewhere as I cannot recreate nor delete them:

Screenshots (If applicable)
If applicable, add screenshots to help explain your problem.
This is the message I get when trying to create one of the accounts I deleted:

This is the message I get when trying to delete the same account:

Additional context
Add any other context about the problem here.

Hi @lpeterson,

Thank you for reaching out about this—We’re looking into this for you for these users (ZOOM-265438).

Thanks,
Will

Thank you very much William. Please let me know if there’s any additional information that you need.

Leslie

Hi @lpeterson,

Can you please ensure you’re passing the parameter action=delete in the request URL? This endpoint doesn’t support passing this in the headers or body, which could be causing an issue with deleting the user.

Thanks,
Will

Hi Will,

Below is what I am using for the URL. Should I be using -Action DELETE instead of -Method or do I also include -Action DELETE?

https://api.zoom.us/v2/users/$User -Headers $headers -ContentType ‘application/json’ -Method DELETE

This is what I have in the body, but it sounds like I should just have the email?

$body = @{

action = “delete”

user_info = @{

email = “$email”}

} | ConvertTo-Json

Also, have you been able to remove those accounts so that I can use them again for testing?

Thank you!

Leslie

Hi @lpeterson,

You should not pass the delete action in the body. This should be in the request URL as follows:
https://api.zoom.us/v2/users/userId?action=delete

In regards to removing user accounts, please submit this request to our Technical Support team here and they’ll be able to assist with this.

Thank you,
Will

Hi Will,

This is still not working. Please keep in mind that this is an enterprise account, and so I am using the ssoCreate method in the body when the account is created. The account is created okay, but I cannot delete it properly. I’m using Powershell. I’ve tried doing this using the Invoke-RestMethod as well as the Invoke-WebRequest.

Is my URI code correct below?

URI:

Invoke-WebRequest -Uri https://api.zoom.us/v2/users/Tzzuser5@gibsondunn.com?action=delete -Headers $headers

Message returned is 200 versus 204:

image001.png

Thank you!

Leslie

Hi Will,

Ignore my previous email, I finally got it to work. I needed to add “-Method Delete” to the end of the request.

Thank you!

Leslie

Ah, I see! Glad you got it working :slight_smile:

Hi Will,

Can I trouble you with a question? For the setting highlighted below, is it possible to include this in the Create User POST? I am passing in “2” as the type but is it possible to include these additional settings? I didn’t see it in the API but will continue looking.

image001.jpg

Thank you!
Leslie

Hi @lpeterson,

Good question :slight_smile:

You can actually specify the capacity using this endpoint:

You’ll find a feature object which contains these fields.

Thanks!
Will

Great, thank you so much!

1 Like

Glad I could help! :slight_smile:

Thanks Will, that worked! :blush:

Awesome, happy to hear it!

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