|
| 1 | +--- |
| 2 | +title: "userTeamwork: deleteTargetedMessage" |
| 3 | +description: "Delete a specific targeted message from a channel context." |
| 4 | +author: "devjha-ms" |
| 5 | +ms.date: 02/16/2026 |
| 6 | +ms.localizationpriority: medium |
| 7 | +ms.subservice: "teams" |
| 8 | +doc_type: apiPageType |
| 9 | +--- |
| 10 | + |
| 11 | +# userTeamwork: deleteTargetedMessage |
| 12 | + |
| 13 | +Namespace: microsoft.graph |
| 14 | + |
| 15 | +[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)] |
| 16 | + |
| 17 | +Delete a specific [targeted message](../resources/targetedchatmessage.md) from a channel context. Teams administrators can use this API to remove targeted messages by providing the message ID, team ID, and channel ID. |
| 18 | + |
| 19 | +## Permissions |
| 20 | + |
| 21 | +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). |
| 22 | + |
| 23 | +<!-- { |
| 24 | + "blockType": "permissions", |
| 25 | + "name": "userteamwork-deletetargetedmessage-permissions" |
| 26 | +} |
| 27 | +--> |
| 28 | +[!INCLUDE [permissions-table](../includes/permissions/userteamwork-deletetargetedmessage-permissions.md)] |
| 29 | + |
| 30 | +## HTTP request |
| 31 | + |
| 32 | +<!-- { |
| 33 | + "blockType": "ignored" |
| 34 | +} |
| 35 | +--> |
| 36 | +``` http |
| 37 | +POST /users/{user-id | userPrincipalName}/teamwork/deleteTargetedMessage |
| 38 | +``` |
| 39 | + |
| 40 | +## Request headers |
| 41 | + |
| 42 | +|Name|Description| |
| 43 | +|:---|:---| |
| 44 | +|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).| |
| 45 | +|Content-Type|application/json. Required.| |
| 46 | + |
| 47 | +## Request body |
| 48 | + |
| 49 | +In the request body, supply a JSON representation of the parameters. |
| 50 | + |
| 51 | +The following table lists the parameters that are required when you call this action. |
| 52 | + |
| 53 | +|Parameter|Type|Description| |
| 54 | +|:---|:---|:---| |
| 55 | +|channelId|String|The unique identifier of the channel where the targeted message was sent. Required.| |
| 56 | +|messageId|String|The unique identifier of the targeted message to delete. This ID is unique within the context of the specified channel and user. Required.| |
| 57 | +|teamId|String|The unique identifier of the team that contains the channel where the targeted message was sent. Required.| |
| 58 | + |
| 59 | +## Response |
| 60 | + |
| 61 | +If successful, this action returns a `204 No Content` response code. |
| 62 | + |
| 63 | +## Examples |
| 64 | + |
| 65 | +### Request |
| 66 | + |
| 67 | +The following example shows a request. |
| 68 | + |
| 69 | +<!-- { |
| 70 | + "blockType": "request", |
| 71 | + "name": "userteamwork_deletetargetedmessage", |
| 72 | + "sampleKeys": ["f47b5f54-6968-4706-a522-31e842b12345"] |
| 73 | +} |
| 74 | +--> |
| 75 | +``` http |
| 76 | +POST https://graph.microsoft.com/beta/users/f47b5f54-6968-4706-a522-31e842b12345/teamwork/deleteTargetedMessage |
| 77 | +Content-Type: application/json |
| 78 | +
|
| 79 | +{ |
| 80 | + "teamId": "3Aeeaa4e946d674c4f8d4dded613780f45@thread.v2", |
| 81 | + "channelId": "19:eeaa4e946d674c4f8d4dded613780f45@thread.v2", |
| 82 | + "messageId": "1580849738240" |
| 83 | +} |
| 84 | +``` |
| 85 | + |
| 86 | +### Response |
| 87 | + |
| 88 | +The following example shows the response. |
| 89 | + |
| 90 | +<!-- { |
| 91 | + "blockType": "response", |
| 92 | + "truncated": true |
| 93 | +} |
| 94 | +--> |
| 95 | +``` http |
| 96 | +HTTP/1.1 204 No Content |
| 97 | +``` |
0 commit comments