| title | userTeamwork: getAllRetainedTargetedMessages |
|---|---|
| description | Get all retained targeted messages sent to a specific user in group chats and channels. |
| author | devjha-ms |
| ms.date | 02/16/2026 |
| ms.localizationpriority | medium |
| ms.subservice | teams |
| doc_type | apiPageType |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Get all retained targeted messages sent to a specific user in group chats and channels.
[!INCLUDE national-cloud-support]
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. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
GET /users/{user-id | userPrincipalName}/teamwork/getAllRetainedTargetedMessagesThis method supports the following OData query parameters to help customize the response. For general information, see OData query parameters.
| Name | Description |
|---|---|
| $filter | The $filter query parameter supports date and time range queries on the lastModifiedDateTime property using date range parameters. |
| $top | Use the $top query parameter to control the number of items per response. |
The following filter expressions are supported:
lastModifiedDateTime gt {datetime}- Returns messages modified after the specified date and time.lastModifiedDateTime lt {datetime}- Returns messages modified before the specified date and time.from/application/id eq '{id}'- Returns messages sent by a specific application ID.
You can combine multiple filter expressions using the and operator. For example:
GET /users/{user-id | userPrincipalName}/teamwork/getAllRetainedTargetedMessages?$filter=lastModifiedDateTime gt 2024-01-01T00:00:00Z and lastModifiedDateTime lt 2024-12-31T23:59:59Z| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this function returns a 200 OK response code and a collection of targetedChatMessage objects in the response body.
The response includes the @odata.nextLink property for pagination, when applicable.
The following example shows a request.
GET https://graph.microsoft.com/beta/users/f47b5f54-6968-4706-a522-31e842b12345/teamwork/getAllRetainedTargetedMessages[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(targetedChatMessage)",
"@odata.count": 1,
"@odata.nextLink": "https://graph.microsoft.com/beta/users/f47b5f54-6968-4706-a522-31e842b12345/teamwork/getAllRetainedTargetedMessages?$top=1&$skiptoken=Token",
"value": [
{
"@odata.type": "#microsoft.graph.targetedChatMessage",
"id": "1684961612345",
"replyToId": null,
"etag": "1684962512345",
"messageType": "message",
"createdDateTime": "2023-05-24T20:54:49.858Z",
"lastModifiedDateTime": "2023-05-24T21:13:15Z",
"lastEditedDateTime": "2023-05-24T21:09:00.224Z",
"deletedDateTime": null,
"subject": "",
"summary": null,
"chatId": "19:1a546d42d8b54a16903716f49b512345@thread.v2",
"importance": "normal",
"locale": "en-us",
"webUrl": null,
"channelIdentity": null,
"onBehalfOf": null,
"policyViolation": null,
"eventDetail": null,
"from": {
"device": null,
"user": null,
"application": {
"@odata.type": "#microsoft.graph.teamworkApplicationIdentity",
"id": "6d23e712-527b-406f-8d59-d02927885918",
"displayName": "Breakthru",
"applicationIdentityType": "bot"
}
},
"body": {
"contentType": "html",
"content": "<p>5/24 group chat</p>"
},
"attachments": [],
"mentions": [],
"reactions": [],
"messageHistory": [],
"recipient": {
"@odata.type": "#microsoft.graph.identity",
"id": "1273a016-201d-4f95-8083-1b7f99b3edeb",
"displayName": "Adele Vance"
}
}
]
}