Skip to content

Commit

Permalink
Merging changes synced from https://github.com/microsoftgraph/microso…
Browse files Browse the repository at this point in the history
…ft-graph-docs (branch live)
  • Loading branch information
Learn Build Service GitHub App authored and Learn Build Service GitHub App committed Oct 19, 2024
2 parents 262973a + 780a4aa commit ccd50d2
Show file tree
Hide file tree
Showing 36 changed files with 485 additions and 70 deletions.
230 changes: 230 additions & 0 deletions api-reference/beta/api/conversationmember-remove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
---
title: "conversationMember: remove"
description: "Remove members in bulk from a team."
author: "prachigoyal-ms"
doc_type: "apiPageType"
ms.localizationpriority: high
ms.subservice: "teams"
---

# conversationMember: remove

Namespace: microsoft.graph

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

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.

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

## Permissions

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).

<!-- { "blockType": "permissions", "name": "conversationmember_remove" } -->
[!INCLUDE [permissions-table](../includes/permissions/conversationmember-remove-permissions.md)]


## HTTP request

This is a bound action to remove multiple elements from a [conversationMember](../resources/conversationmember.md) collection in a single request.
<!-- { "blockType": "ignored" } -->

```http
POST /teams/{team-id}/members/remove
```

## Request headers

| Header | Value |
| :------------ | :------------------------ |
|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).|
| Content-Type | application/json. Required. |

## Request body

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.

The following table shows the parameter that you can use with this method.

|Parameter|Type|Description|
|:---|:---|:---|
|values|[conversationMember](../resources/conversationmember.md) collection|A list of conversation members that should be removed.|

## Response

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).

## Examples

### Example 1: Remove members in bulk from a team

The following example shows how to remove multiple members from a **team** in a single request.

#### Request

The following example shows a request.

<!-- {
"blockType": "request",
"name": "bulkremovemembers_team"
}-->

```http
POST https://graph.microsoft.com/beta/teams/e4183b04-c9a2-417c-bde4-70e3ee46a6dc/members/remove
Content-Type: application/json
{
"values": [
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"[email protected]": "https://graph.microsoft.com/beta/users('18a80140-b0fb-4489-b360-2f6efaf225a0')"
},
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"[email protected]": "https://graph.microsoft.com/beta/users('86503198-b81b-43fe-81ee-ad45b8848ac9')"
}
]
}
```

#### Response

The following example shows the response.

<!-- {
"blockType": "response",
"truncated": false
} -->

```http
HTTP/1.1 204 No Content
```

### Example 2: Remove members in bulk from a team using user principal name

The following example shows how to remove multiple members from a **team** in a single request using their user principal names.

#### Request

The following example shows a request.

<!-- {
"blockType": "request",
"name": "bulkdeletemembers_team_upn"
}-->

```http
POST https://graph.microsoft.com/beta/teams/e4183b04-c9a2-417c-bde4-70e3ee46a6dc/members/remove
Content-Type: application/json
{
"values": [
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"[email protected]": "https://graph.microsoft.com/beta/users('[email protected]')"
},
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"[email protected]": "https://graph.microsoft.com/beta/users('[email protected]')"
}
]
}
```

#### Response

The following example shows the response.

<!-- {
"blockType": "response",
"truncated": false
} -->

```http
HTTP/1.1 204 No Content
```

### Example 3: Remove members in bulk from a team with failed removals

The following example shows how to remove multiple members from a **team** when the removal of a member fails.

#### Request

The following example shows a request.

<!-- {
"blockType": "request",
"name": "bulkdeletemembers_team_partial"
}-->

```http
POST https://graph.microsoft.com/beta/teams/e4183b04-c9a2-417c-bde4-70e3ee46a6dc/members/remove
Content-Type: application/json
{
"values": [
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"[email protected]": "https://graph.microsoft.com/beta/users('c04f28bf-ab68-40a2-974b-e6af31fa78fb')"
},
{
"@odata.type": "microsoft.graph.aadUserConversationMember",
"[email protected]": "https://graph.microsoft.com/beta/users('86503198-b81b-43fe-81ee-ad45b8848ac9')"
}
]
}
```

#### Response

The following example shows the response.

> **Note:** The response object shown here might be shortened for readability.
<!-- {
"blockType": "response",
"truncated": true,
"@odata.type": "Collection(microsoft.graph.actionResultPart)"
} -->

```http
HTTP/1.1 207 Multi-Status
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.aadUserConversationMemberResult)",
"value": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMemberResult",
"userId": "c04f28bf-ab68-40a2-974b-e6af31fa78fb",
"error": {
"code": "NotFound",
"message": "Could not find resource"
}
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMemberResult",
"userId": "86503198-b81b-43fe-81ee-ad45b8848ac9",
"error": null
}
]
}
```

## Related content

[Remove member from team](team-delete-members.md)

<!-- uuid: 8fcb5dbc-d5aa-4681-8e31-b001d5168d79
2024-09-12 06:02:30 UTC -->
<!--
{
"type": "#page.annotation",
"description": "Remove members from a team in bulk.",
"keywords": "",
"section": "documentation",
"tocPath": "",
"suppressions": []
}
-->

3 changes: 3 additions & 0 deletions api-reference/beta/api/directoryrole-delete-member.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Namespace: microsoft.graph

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

> [!NOTE]
> 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).
Remove a member from a directoryRole.

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).
Expand Down
3 changes: 3 additions & 0 deletions api-reference/beta/api/directoryrole-get.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Namespace: microsoft.graph

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

> [!NOTE]
> 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).
Retrieve the properties of a directoryRole object.

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).
Expand Down
3 changes: 3 additions & 0 deletions api-reference/beta/api/directoryrole-list-members.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Namespace: microsoft.graph

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

> [!NOTE]
> 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).
Retrieve a list of the users that are assigned to the directory role. Only users can be assigned to a directory role.

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).
Expand Down
3 changes: 3 additions & 0 deletions api-reference/beta/api/directoryrole-list-scopedmembers.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Namespace: microsoft.graph

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

> [!NOTE]
> 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).
Retrieve a list of [scopedRoleMembership](../resources/scopedrolemembership.md) objects for a directory role.

[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)]
Expand Down
3 changes: 3 additions & 0 deletions api-reference/beta/api/directoryrole-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Namespace: microsoft.graph

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

> [!NOTE]
> 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).
List the directory roles that are activated in the tenant.

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.
Expand Down
3 changes: 3 additions & 0 deletions api-reference/beta/api/directoryrole-post-members.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Namespace: microsoft.graph

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

> [!NOTE]
> 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).
Create a new directory role member.

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).
Expand Down
3 changes: 3 additions & 0 deletions api-reference/beta/api/directoryroletemplate-get.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Namespace: microsoft.graph

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

> [!NOTE]
> 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).
Retrieve the properties and relationships of a directoryroletemplate object.

[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)]
Expand Down
3 changes: 3 additions & 0 deletions api-reference/beta/api/directoryroletemplate-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Namespace: microsoft.graph

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

> [!NOTE]
> 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).
Retrieve a list of directoryroletemplate objects.

[!INCLUDE [national-cloud-support](../../includes/all-clouds.md)]
Expand Down
3 changes: 2 additions & 1 deletion api-reference/beta/resources/aaduserconversationmember.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Inherits from [conversationMember](conversationmember.md).
|[Get team member](../api/team-get-members.md) | [conversationMember](conversationmember.md) collection | Get a member in the team.|
|[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.|
|[Remove team member](../api/team-delete-members.md)|None|Remove an existing member from the team.|
|[Remove team members in bulk](../api/conversationmember-remove.md)|[actionResultPart](../resources/actionresultpart.md) collection|Remove multiple members from a team in a single request.|
|[List channel members](../api/channel-list-members.md) | [conversationMember](conversationmember.md) collection | Get the list of all members in a channel.|
|[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`.|
|[Get channel member](../api/channel-get-members.md) | [conversationMember](conversationmember.md) collection | Get a member in a channel.|
Expand All @@ -47,7 +48,7 @@ Inherits from [conversationMember](conversationmember.md).
|roles| String collection | The roles of the user such as owner, member, or guest. |
|tenantId| string | TenantId which the Microsoft Entra user belongs to. |
|userId| String | The GUID of the user. |
|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.|
|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.|

## JSON representation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Inherits from [actionResultPart](actionresultpart.md).

| Property | Type | Description |
|:---------------|:--------|:----------|
|userId|String|The user object ID of the Microsoft Entra user that was being added as part of the bulk operation.|
|error|[publicError](publicerror.md) |The error that occurred, if any, during the course of the bulk operation.|
|userId|String|The user object ID of the Microsoft Entra user that was being added as part of the bulk operation.|

## JSON representation

Expand All @@ -35,14 +35,15 @@ The following JSON representation shows the resource type.

```json
{
"userId": "String",
"error": "microsoft.graph.publicError"
"error": "microsoft.graph.publicError",
"userId": "String"
}
```

## Related content

- [Add members in bulk to a team](../api/conversationmembers-add.md)
- [Remove members in bulk from a team](../api/conversationmember-remove.md)

<!-- uuid: 20fd7863-9545-40d4-ae8f-fee2d115a690
2015-10-25 14:57:30 UTC -->
Expand Down
3 changes: 2 additions & 1 deletion api-reference/beta/resources/actionresultpart.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "actionResultPart resource type"
description: "Abstract type to model responses of bulk operations."
description: "An abstract type that serves as a base to model responses of bulk operations."
author: "AkJo"
ms.localizationpriority: medium
ms.subservice: "teams"
Expand Down Expand Up @@ -43,6 +43,7 @@ The following JSON representation shows the resource type.

- [aadUserConversationMemberResult](aaduserconversationmemberresult.md)
- [Add members in bulk to a team](../api/conversationmembers-add.md)
- [Remove members in bulk from a team](../api/conversationmember-remove.md)

<!-- uuid: 20fd7863-9545-40d4-ae8f-fee2d115a690
2015-10-25 14:57:30 UTC -->
Expand Down
Loading

0 comments on commit ccd50d2

Please sign in to comment.