# Delete Action Not Removing User Account

**URL:** <https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731>\
**Category:** API and Webhooks\
**Created:** [April 11, 2021, 5:24pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731 "2021-04-11T17:24:05Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpeterson](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lpeterson](https://devforum.zoom.us/u/lpeterson)\
**Post date:** [April 11, 2021, 5:24pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/1 "2021-04-11T17:24:06Z")

</div>

## Using this template helps us debug your issues more effectively 🙂

**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](https://api.zoom.us/v2/users)

To create:  
$response = Invoke-RestMethod -Headers $headers -Uri [https://api.zoom.us/v2/users](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](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.

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [April 12, 2021, 4:51pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/2 "2021-04-12T16:51:09Z")

</div>

Hi @lpeterson,

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

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![lpeterson](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lpeterson](https://devforum.zoom.us/u/lpeterson)\
**Post date:** [April 12, 2021, 5:20pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/3 "2021-04-12T17:20:53Z")

</div>

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

Leslie

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [April 13, 2021, 2:31pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/4 "2021-04-13T14:31:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lpeterson](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lpeterson](https://devforum.zoom.us/u/lpeterson)\
**Post date:** [April 13, 2021, 4:23pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/5 "2021-04-13T16:23:23Z")

</div>

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](https://api.zoom.us/v2/users/%24User) -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

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [April 14, 2021, 2:22pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/6 "2021-04-14T14:22:14Z")

</div>

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](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](https://support.zoom.us/hc/en-us/requests/new) and they’ll be able to assist with this.

Thank you,  
Will

---

<div class="post-metadata">

**Author:** ![lpeterson](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lpeterson](https://devforum.zoom.us/u/lpeterson)\
**Post date:** [April 21, 2021, 12:06am UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/7 "2021-04-21T00:06:23Z")

</div>

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](https://api.zoom.us/v2/users/Tzzuser5@gibsondunn.com?action=delete) -Headers $headers

Message returned is 200 versus 204:

![image001.png](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/4/14d19b270557dc0bfadffef7dc5bf4b2ca3b34a5.png)

Thank you!

Leslie

---

<div class="post-metadata">

**Author:** ![lpeterson](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lpeterson](https://devforum.zoom.us/u/lpeterson)\
**Post date:** [April 21, 2021, 12:16am UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/8 "2021-04-21T00:16:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [April 21, 2021, 6:33pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/9 "2021-04-21T18:33:59Z")

</div>

Ah, I see! Glad you got it working 🙂

---

<div class="post-metadata">

**Author:** ![lpeterson](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lpeterson](https://devforum.zoom.us/u/lpeterson)\
**Post date:** [April 29, 2021, 8:54pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/10 "2021-04-29T20:54:48Z")

</div>

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](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/a/1a9aef863bf2c4e0d81419b35b5975dbc03621d1.jpeg)

Thank you!  
Leslie

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [April 30, 2021, 4:41pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/11 "2021-04-30T16:41:53Z")

</div>

Hi @lpeterson,

Good question 🙂

You can actually specify the capacity using this endpoint:

> **[Update user settings - Users - Zoom API - API Reference](https://marketplace.zoom.us/docs/api-reference/zoom-api/users/usersettingsupdate)**
>
> Update a user's settings.
> Scopes: user:write:admin user:write
> 
> Rate Limit Label: Medium
> 
> Authorization
> 
> Flow: authorizationCode
> 
> Authorization URL: htt...

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

Thanks!  
Will

---

<div class="post-metadata">

**Author:** ![lpeterson](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lpeterson](https://devforum.zoom.us/u/lpeterson)\
**Post date:** [April 30, 2021, 4:54pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/12 "2021-04-30T16:54:09Z")

</div>

Great, thank you so much!

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [April 30, 2021, 4:55pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/13 "2021-04-30T16:55:13Z")

</div>

Glad I could help! 🙂

---

<div class="post-metadata">

**Author:** ![lpeterson](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lpeterson](https://devforum.zoom.us/u/lpeterson)\
**Post date:** [May 3, 2021, 11:54pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/14 "2021-05-03T23:54:06Z")

</div>

Thanks Will, that worked! 😊

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [May 4, 2021, 2:48pm UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/15 "2021-05-04T14:48:21Z")

</div>

Awesome, happy to hear it!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [June 4, 2021, 12:48am UTC](https://devforum.zoom.us/t/delete-action-not-removing-user-account/47731/16 "2021-06-04T00:48:49Z")

</div>

Closed on June 4, 2021, 12:48am UTC

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