|
| 1 | +--- |
| 2 | +title: "Delete targetedChatMessage" |
| 3 | +description: "Delete a specific targeted message from a chat 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 | +# Delete targetedChatMessage |
| 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 chat context. Teams administrators can use this API to remove targeted messages from group chats. |
| 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 | +<!-- { "blockType": "permissions", "name": "chat_delete_targetedmessages" } --> |
| 24 | +[!INCLUDE [permissions-table](../includes/permissions/chat-delete-targetedmessages-permissions.md)] |
| 25 | + |
| 26 | +## HTTP request |
| 27 | + |
| 28 | +<!-- { |
| 29 | + "blockType": "ignored" |
| 30 | +} |
| 31 | +--> |
| 32 | +``` http |
| 33 | +DELETE /users/{user-id | userPrincipalName}/chats/{chat-id}/targetedMessages/{message-id} |
| 34 | +``` |
| 35 | + |
| 36 | +## Path parameters |
| 37 | + |
| 38 | +|Parameter|Type|Description| |
| 39 | +|:---|:---|:---| |
| 40 | +|chat-id|String|Placeholder for the unique identifier of the chat where the targeted message was sent. Required.| |
| 41 | +|message-id|String|Placeholder for the unique identifier of the targeted message to delete. This ID is unique within the context of the specified chat and user. Required.| |
| 42 | +|user-id|String|Placeholder for the unique identifier or user principal name of the user to whom the targeted message was sent. Required.| |
| 43 | + |
| 44 | +## Request headers |
| 45 | + |
| 46 | +|Name|Description| |
| 47 | +|:---|:---| |
| 48 | +|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).| |
| 49 | + |
| 50 | +## Request body |
| 51 | + |
| 52 | +Don't supply a request body for this method. |
| 53 | + |
| 54 | +## Response |
| 55 | + |
| 56 | +If successful, this method returns a `204 No Content` response code. |
| 57 | + |
| 58 | +## Examples |
| 59 | + |
| 60 | +### Request |
| 61 | + |
| 62 | +The following example shows a request. |
| 63 | + |
| 64 | +# [HTTP](#tab/http) |
| 65 | +<!-- { |
| 66 | + "blockType": "request", |
| 67 | + "name": "delete_targetedchatmessage", |
| 68 | + "sampleKeys": ["f47b5f54-6968-4706-a522-31e842b12345", "19:eeaa4e946d674c4f8d4dded613780f45@thread.v2", "1580849738240"] |
| 69 | +} |
| 70 | +--> |
| 71 | +``` http |
| 72 | +DELETE https://graph.microsoft.com/beta/users/f47b5f54-6968-4706-a522-31e842b12345/chats/19:eeaa4e946d674c4f8d4dded613780f45@thread.v2/targetedMessages/1580849738240 |
| 73 | +``` |
| 74 | + |
| 75 | +# [JavaScript](#tab/javascript) |
| 76 | +[!INCLUDE [sample-code](../includes/snippets/javascript/delete-targetedchatmessage-javascript-snippets.md)] |
| 77 | +[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)] |
| 78 | + |
| 79 | +--- |
| 80 | + |
| 81 | +### Response |
| 82 | + |
| 83 | +The following example shows the response. |
| 84 | + |
| 85 | +<!-- { |
| 86 | + "blockType": "response", |
| 87 | + "truncated": true |
| 88 | +} |
| 89 | +--> |
| 90 | +``` http |
| 91 | +HTTP/1.1 204 No Content |
| 92 | +``` |
0 commit comments