chats: getAllMessages

Namespace: microsoft.graph


APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Get all messages from all chats that a user is a participant in, including one-on-one chats, group chats, and meeting chats.

Note: This is a metered API that supports the model=A and model=B payment models. For details, see Payment models. If you don't specify a payment model in your query, the default evaluation mode will be used.

Depending on which payment model you choose, a license might also be required.


The following permissions are required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Not supported
Delegated (personal Microsoft account) Not supported
Application Chat.Read.All, Chat.ReadWrite.All

HTTP request

GET /users/{id | user-principal-name}/chats/getAllMessages

Optional query parameters

This method supports date range parameters to customize the response, as shown in the following example.

GET /users/{id}/chats/getAllMessages?$top=50&$filter=lastModifiedDateTime gt 2020-06-04T18:03:11.591Z and lastModifiedDateTime lt 2020-06-05T21:00:09.413Z

Use the model query parameter to specify the payment model that applies to your scenario, as shown in the following examples.

GET /users/{id | user-principal-name}/chats/getAllMessages?model=A
GET /users/{id | user-principal-name}/chats/getAllMessages?model=B

Note: If you don't specify a payment model in your query, the default evaluation mode will be used.

Request headers

Header Value
Authorization Bearer {token}. Required.


If successful, this method returns a 200 OK response code and a list of chatMessages in the response body.





Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json

         "eventDetail": null,
               "displayName":"Richard Wilson",
            "content":"<div>\n<blockquote itemscope=\"\" itemtype=\"\" itemid=\"1600457867820\">\n<strong itemprop=\"mri\" itemid=\"8:orgid:0de69e5e-2da8-4cf2-821f-5e6585b2c65b\">Richard Wilson</strong><span itemprop=\"time\" itemid=\"1600457867820\"></span>\n<p itemprop=\"preview\">1237</p>\n</blockquote>\n<p>this is a reply</p>\n</div>"




See also

Microsoft Graph service-specific throttling limits