Skip to content

Commit 5aee456

Browse files
committed
Merge branch 'main' into doc-improvement-approval-api
2 parents 0048a20 + bdeccbf commit 5aee456

36 files changed

+485
-70
lines changed
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
---
2+
title: "conversationMember: remove"
3+
description: "Remove members in bulk from a team."
4+
author: "prachigoyal-ms"
5+
doc_type: "apiPageType"
6+
ms.localizationpriority: high
7+
ms.subservice: "teams"
8+
---
9+
10+
# conversationMember: remove
11+
12+
Namespace: microsoft.graph
13+
14+
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
15+
16+
Remove multiple members from a [team](../resources/team.md) in a single request. The response provides details about which memberships could and couldn't be removed.
17+
18+
[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)]
19+
20+
## Permissions
21+
22+
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions [only if your app requires it](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference).
23+
24+
<!-- { "blockType": "permissions", "name": "conversationmember_remove" } -->
25+
[!INCLUDE [permissions-table](../includes/permissions/conversationmember-remove-permissions.md)]
26+
27+
28+
## HTTP request
29+
30+
This is a bound action to remove multiple elements from a [conversationMember](../resources/conversationmember.md) collection in a single request.
31+
<!-- { "blockType": "ignored" } -->
32+
33+
```http
34+
POST /teams/{team-id}/members/remove
35+
```
36+
37+
## Request headers
38+
39+
| Header | Value |
40+
| :------------ | :------------------------ |
41+
|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).|
42+
| Content-Type | application/json. Required. |
43+
44+
## Request body
45+
46+
In the request body, supply the JSON representation of the list of **conversationMember** derivatives to be removed from a team. A maximum of 20 **conversationMember** derivatives can be removed in a single request.
47+
48+
The following table shows the parameter that you can use with this method.
49+
50+
|Parameter|Type|Description|
51+
|:---|:---|:---|
52+
|values|[conversationMember](../resources/conversationmember.md) collection|A list of conversation members that should be removed.|
53+
54+
## Response
55+
56+
If successful, this method returns either a `204 No Content` response if all specified members were successfully removed from the team or a `207 Multi-Status` response if only some members were removed. The caller should inspect the response payload to identify which member removals failed. The response body contains a collection of derivatives of the [actionResultPart](../resources/actionresultpart.md) resource. If the request fails, the API returns an error. For more information about Microsoft Graph errors, see [Microsoft Graph error responses and resource types](/graph/errors).
57+
58+
## Examples
59+
60+
### Example 1: Remove members in bulk from a team
61+
62+
The following example shows how to remove multiple members from a **team** in a single request.
63+
64+
#### Request
65+
66+
The following example shows a request.
67+
68+
<!-- {
69+
"blockType": "request",
70+
"name": "bulkremovemembers_team"
71+
}-->
72+
73+
```http
74+
POST https://graph.microsoft.com/beta/teams/e4183b04-c9a2-417c-bde4-70e3ee46a6dc/members/remove
75+
Content-Type: application/json
76+
77+
{
78+
"values": [
79+
{
80+
"@odata.type": "microsoft.graph.aadUserConversationMember",
81+
"user@odata.bind": "https://graph.microsoft.com/beta/users('18a80140-b0fb-4489-b360-2f6efaf225a0')"
82+
},
83+
{
84+
"@odata.type": "microsoft.graph.aadUserConversationMember",
85+
"user@odata.bind": "https://graph.microsoft.com/beta/users('86503198-b81b-43fe-81ee-ad45b8848ac9')"
86+
}
87+
]
88+
}
89+
```
90+
91+
#### Response
92+
93+
The following example shows the response.
94+
95+
<!-- {
96+
"blockType": "response",
97+
"truncated": false
98+
} -->
99+
100+
```http
101+
HTTP/1.1 204 No Content
102+
```
103+
104+
### Example 2: Remove members in bulk from a team using user principal name
105+
106+
The following example shows how to remove multiple members from a **team** in a single request using their user principal names.
107+
108+
#### Request
109+
110+
The following example shows a request.
111+
112+
<!-- {
113+
"blockType": "request",
114+
"name": "bulkdeletemembers_team_upn"
115+
}-->
116+
117+
```http
118+
POST https://graph.microsoft.com/beta/teams/e4183b04-c9a2-417c-bde4-70e3ee46a6dc/members/remove
119+
Content-Type: application/json
120+
121+
{
122+
"values": [
123+
{
124+
"@odata.type": "microsoft.graph.aadUserConversationMember",
125+
"user@odata.bind": "https://graph.microsoft.com/beta/users('jacob@contoso.com')"
126+
},
127+
{
128+
"@odata.type": "microsoft.graph.aadUserConversationMember",
129+
"user@odata.bind": "https://graph.microsoft.com/beta/users('alex@contoso.com')"
130+
}
131+
]
132+
}
133+
```
134+
135+
#### Response
136+
137+
The following example shows the response.
138+
139+
<!-- {
140+
"blockType": "response",
141+
"truncated": false
142+
} -->
143+
144+
```http
145+
HTTP/1.1 204 No Content
146+
```
147+
148+
### Example 3: Remove members in bulk from a team with failed removals
149+
150+
The following example shows how to remove multiple members from a **team** when the removal of a member fails.
151+
152+
#### Request
153+
154+
The following example shows a request.
155+
156+
<!-- {
157+
"blockType": "request",
158+
"name": "bulkdeletemembers_team_partial"
159+
}-->
160+
161+
```http
162+
POST https://graph.microsoft.com/beta/teams/e4183b04-c9a2-417c-bde4-70e3ee46a6dc/members/remove
163+
Content-Type: application/json
164+
165+
{
166+
"values": [
167+
{
168+
"@odata.type": "microsoft.graph.aadUserConversationMember",
169+
"user@odata.bind": "https://graph.microsoft.com/beta/users('c04f28bf-ab68-40a2-974b-e6af31fa78fb')"
170+
},
171+
{
172+
"@odata.type": "microsoft.graph.aadUserConversationMember",
173+
"user@odata.bind": "https://graph.microsoft.com/beta/users('86503198-b81b-43fe-81ee-ad45b8848ac9')"
174+
}
175+
]
176+
}
177+
```
178+
179+
#### Response
180+
181+
The following example shows the response.
182+
183+
> **Note:** The response object shown here might be shortened for readability.
184+
<!-- {
185+
"blockType": "response",
186+
"truncated": true,
187+
"@odata.type": "Collection(microsoft.graph.actionResultPart)"
188+
} -->
189+
190+
```http
191+
HTTP/1.1 207 Multi-Status
192+
Content-Type: application/json
193+
194+
{
195+
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.aadUserConversationMemberResult)",
196+
"value": [
197+
{
198+
"@odata.type": "#microsoft.graph.aadUserConversationMemberResult",
199+
"userId": "c04f28bf-ab68-40a2-974b-e6af31fa78fb",
200+
"error": {
201+
"code": "NotFound",
202+
"message": "Could not find resource"
203+
}
204+
},
205+
{
206+
"@odata.type": "#microsoft.graph.aadUserConversationMemberResult",
207+
"userId": "86503198-b81b-43fe-81ee-ad45b8848ac9",
208+
"error": null
209+
}
210+
]
211+
}
212+
```
213+
214+
## Related content
215+
216+
[Remove member from team](team-delete-members.md)
217+
218+
<!-- uuid: 8fcb5dbc-d5aa-4681-8e31-b001d5168d79
219+
2024-09-12 06:02:30 UTC -->
220+
<!--
221+
{
222+
"type": "#page.annotation",
223+
"description": "Remove members from a team in bulk.",
224+
"keywords": "",
225+
"section": "documentation",
226+
"tocPath": "",
227+
"suppressions": []
228+
}
229+
-->
230+

api-reference/beta/api/directoryrole-delete-member.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17+
> [!NOTE]
18+
> Microsoft recommends that you use the unified RBAC API instead of this API. The unified RBAC API provides more functionality and flexibility. For more information, see [Delete unifiedRoleAssignment](./unifiedroleassignment-delete.md).
19+
1720
Remove a member from a directoryRole.
1821

1922
You can use both the object ID and template ID of the **directoryRole** with this API. The template ID of a built-in role is immutable and can be seen in the role description on the Microsoft Entra admin center. For details, see [Role template IDs](/azure/active-directory/users-groups-roles/directory-assign-admin-roles#role-template-ids).

api-reference/beta/api/directoryrole-get.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17+
> [!NOTE]
18+
> Microsoft recommends that you use the unified RBAC API instead of this API. The unified RBAC API provides more functionality and flexibility. For more information, see [Get unifiedRoleDefinition](./unifiedroledefinition-get.md).
19+
1720
Retrieve the properties of a directoryRole object.
1821

1922
You can use both the object ID and template ID of the **directoryRole** with this API. The template ID of a built-in role is immutable and can be seen in the role description on the Microsoft Entra admin center. For details, see [Role template IDs](/azure/active-directory/users-groups-roles/directory-assign-admin-roles#role-template-ids).

api-reference/beta/api/directoryrole-list-members.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17+
> [!NOTE]
18+
> Microsoft recommends that you use the unified RBAC API instead of this API. The unified RBAC API provides more functionality and flexibility. For more information, see [List unifiedRoleAssignments](./rbacapplication-list-roleassignments.md).
19+
1720
Retrieve a list of the users that are assigned to the directory role. Only users can be assigned to a directory role.
1821

1922
You can use both the object ID and template ID of the **directoryRole** with this API. The template ID of a built-in role is immutable and can be seen in the role description on the Microsoft Entra admin center. For details, see [Role template IDs](/azure/active-directory/users-groups-roles/directory-assign-admin-roles#role-template-ids).

api-reference/beta/api/directoryrole-list-scopedmembers.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17+
> [!NOTE]
18+
> Microsoft recommends that you use the unified RBAC API instead of this API. The unified RBAC API provides more functionality and flexibility. For more information, see [List unifiedRoleAssignments](./rbacapplication-list-roleassignments.md).
19+
1720
Retrieve a list of [scopedRoleMembership](../resources/scopedrolemembership.md) objects for a directory role.
1821

1922
[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)]

api-reference/beta/api/directoryrole-list.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17+
> [!NOTE]
18+
> Microsoft recommends that you use the unified RBAC API instead of this API. The unified RBAC API provides more functionality and flexibility. For more information, see [List roleDefinitions](./rbacapplication-list-roledefinitions.md).
19+
1720
List the directory roles that are activated in the tenant.
1821

1922
This operation only returns roles that have been activated. A role becomes activated when an admin activates the role using the [Activate directoryRole](directoryrole-post-directoryroles.md) API. Not all built-in roles are initially activated.

api-reference/beta/api/directoryrole-post-members.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17+
> [!NOTE]
18+
> Microsoft recommends that you use the unified RBAC API instead of this API. The unified RBAC API provides more functionality and flexibility. For more information, see [Create unifiedRoleAssignment](./rbacapplication-post-roleassignments.md).
19+
1720
Create a new directory role member.
1821

1922
You can use both the object ID and template ID of the **directoryRole** with this API. The template ID of a built-in role is immutable and can be seen in the role description on the Microsoft Entra admin center. For details, see [Role template IDs](/azure/active-directory/users-groups-roles/directory-assign-admin-roles#role-template-ids).

api-reference/beta/api/directoryroletemplate-get.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17+
> [!NOTE]
18+
> Microsoft recommends that you use the unified RBAC API instead of this API. The unified RBAC API provides more functionality and flexibility. For more information, see [Get unifiedRoleDefinition](./unifiedroledefinition-get.md).
19+
1720
Retrieve the properties and relationships of a directoryroletemplate object.
1821

1922
[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)]

api-reference/beta/api/directoryroletemplate-list.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Namespace: microsoft.graph
1414

1515
[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)]
1616

17+
> [!NOTE]
18+
> Microsoft recommends that you use the unified RBAC API instead of this API. The unified RBAC API provides more functionality and flexibility. For more information, see [List roleDefinitions](./rbacapplication-list-roledefinitions.md).
19+
1720
Retrieve a list of directoryroletemplate objects.
1821

1922
[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)]

api-reference/beta/resources/aaduserconversationmember.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Inherits from [conversationMember](conversationmember.md).
2727
|[Get team member](../api/team-get-members.md) | [conversationMember](conversationmember.md) collection | Get a member in the team.|
2828
|[Update team member's role](../api/team-update-members.md)|[conversationMember](../resources/conversationmember.md)|Change a member to an owner or back to a regular member.|
2929
|[Remove team member](../api/team-delete-members.md)|None|Remove an existing member from the team.|
30+
|[Remove team members in bulk](../api/conversationmember-remove.md)|[actionResultPart](../resources/actionresultpart.md) collection|Remove multiple members from a team in a single request.|
3031
|[List channel members](../api/channel-list-members.md) | [conversationMember](conversationmember.md) collection | Get the list of all members in a channel.|
3132
|[Add channel member](../api/channel-post-members.md) | [conversationMember](conversationmember.md) | Add a member to a channel. Only supported for `channel` with membershipType of `private`.|
3233
|[Get channel member](../api/channel-get-members.md) | [conversationMember](conversationmember.md) collection | Get a member in a channel.|
@@ -47,7 +48,7 @@ Inherits from [conversationMember](conversationmember.md).
4748
|roles| String collection | The roles of the user such as owner, member, or guest. |
4849
|tenantId| string | TenantId which the Microsoft Entra user belongs to. |
4950
|userId| String | The GUID of the user. |
50-
|visibleHistoryStartDateTime| DateTimeOffset | The timestamp denoting how far back a conversation's history is shared with the conversation member. This property is settable only for members of a chat.|
51+
|visibleHistoryStartDateTime| DateTimeOffset | The timestamp that denotes how far back the history of a conversation is shared with the conversation member. This property is settable only for members of a chat.|
5152

5253
## JSON representation
5354

0 commit comments

Comments
 (0)