# Error code: 1107, Message: You can not disassociate a user with managed domain

**URL:** <https://devforum.zoom.us/t/error-code-1107-message-you-can-not-disassociate-a-user-with-managed-domain/90051>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [June 13, 2023, 5:47am UTC](https://devforum.zoom.us/t/error-code-1107-message-you-can-not-disassociate-a-user-with-managed-domain/90051 "2023-06-13T05:47:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil.l](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/phil.l/32/49299_2.png) [@phil.l](https://devforum.zoom.us/u/phil.l)\
**Post date:** [June 13, 2023, 5:47am UTC](https://devforum.zoom.us/t/error-code-1107-message-you-can-not-disassociate-a-user-with-managed-domain/90051/1 "2023-06-13T05:47:42Z")

</div>

**API Endpoint(s) and/or Zoom API Event(s)**  
Attempting User Delete as per documentation:

> **[Zoom Meeting API](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/userDelete)**
>
> API Reference for /docs/api/rest/reference/zoom-api/methods

**Description**  
My app is a **server-to-server OAuth** and is as **account-level app**.

I’m trying to delete users with the API call as described on the above documentation page (see my code below) but I get the below error:  
{  
“code”: 1107,  
“message”: “You can not disassociate a user with managed domain.”  
}

I do have SSO enabled with Zoom for my domain which I assume is what is meant by a ‘managed domain’.

1. Is there a way to delete users through the API with managed domain (e.g. by turning off managed domain for that user first, or by passing in some authentication token from my domain to allow this)?  
I know I can go into Zoom admin portal and just click ‘delete’ on a user so I’m not certain what the trip-up is here.

2. I note the error message says ‘disassociate’ even though I’m passing in the action of ‘delete’.  
So also very happy if I’m just passing in this action wrong.  
I’ve tested the below code for GET user info and it works well, the only new bit is the **apiPayload** where I’m adding the ‘delete’ action to the call.

Any help would be greatly appreciated.

**How To Reproduce**  
//My code (Javasceript):

function fn\_zoomDeleteUser() {

//testing only - remove for actual  
var USER\_EMAIL = ‘test@mydomain.com’

// get API token for making the below call  
var token = service\_ZoomAPIToken()

var url = '[https://api.zoom.us/v2/users/'+USER\_EMAIL](https://api.zoom.us/v2/users/'+USER_EMAIL)

var apiPayload = {  
action: ‘delete’  
};

var options = {  
method: ‘DELETE’,  
muteHttpExceptions: true,  
headers: {  
Authorization: 'Bearer '+ token // Do not publish or share this token publicly  
},  
payload: JSON.stringify(apiPayload)

};

var response = UrlFetchApp.fetch(url, options);  
var result = JSON.parse(response.getContentText());

Logger.log(result);  
return result;

}

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [June 14, 2023, 7:24pm UTC](https://devforum.zoom.us/t/error-code-1107-message-you-can-not-disassociate-a-user-with-managed-domain/90051/2 "2023-06-14T19:24:29Z")

</div>

Hi @phil.l  
Thanks for reaching out to the Zoom Developer Forum, I am happy to help here!  
So, it looks like you are passing the action delete in your request body  
Could you please set this value in your query params and try again?

 ![Screenshot 2023-06-14 at 3.24.12 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/b/b/bbea4031afd87bd95b034a85858e1c51d661d6c0.png)

---

<div class="post-metadata">

**Author:** ![phil.l](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/phil.l/32/49299_2.png) [@phil.l](https://devforum.zoom.us/u/phil.l)\
**Post date:** [June 14, 2023, 9:50pm UTC](https://devforum.zoom.us/t/error-code-1107-message-you-can-not-disassociate-a-user-with-managed-domain/90051/3 "2023-06-14T21:50:13Z")

</div>

Amazing, thanks Elisa. That’s solved 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 17, 2024, 1:26pm UTC](https://devforum.zoom.us/t/error-code-1107-message-you-can-not-disassociate-a-user-with-managed-domain/90051/4 "2024-06-17T13:26:15Z")

</div>

Closed on June 17, 2024, 1:26pm UTC

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