Skip to content

Latest commit

 

History

History
168 lines (134 loc) · 5.23 KB

File metadata and controls

168 lines (134 loc) · 5.23 KB
title List messageTraces
description Get a list of exchangeMessageTrace objects.
author Huajian-MSIT
ms.date 12/04/2025
ms.localizationpriority medium
ms.subservice outlook
doc_type apiPageType

List messageTraces

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Get a list of exchangeMessageTrace objects.

[!INCLUDE national-cloud-support]

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. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

[!INCLUDE permissions-table]

HTTP request

GET /admin/exchange/tracing/messageTraces

Optional query parameters

This method supports the $filter, $top and $skipToken OData query parameters of the OData query parameters to help customize the response.

The default page size for this API is 1000 exchangeMessageTrace objects. Use $top to customize the page size, within the range of 1 and 5000. To get the next page of message traces, simply apply the entire URL returned in @odata.nextLink to the next get-messagetraces request. This URL includes any query parameters you may have specified in the initial request. For more information, see Paging Microsoft Graph data in your app.

The following table summarizes support for $filter operators by properties of exchangeMessageTrace objects.

Property Supported operator
id eq
messageId eq
status eq
receivedDateTime range must be specified using the ge and le operators
recipientAddress eq
senderAddress eq
subject contains, startsWith
fromIP eq
toIP eq

When filtering by the receivedDateTime property, the start date cannot be older than 90 days from today.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a collection of exchangeMessageTrace objects in the response body.

Examples

Example 1: Get all message traces

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/admin/exchange/tracing/messageTraces

Response

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

{
  "value": [
    {
      "@odata.type": "#microsoft.graph.exchangeMessageTrace",
      "id": "4451a062-48cb-e80d-e8c0-196330437ae6",
      "senderAddress": "sender@contoso.com",
      "recipientAddress": "recipient@contoso.com",
      "messageId": "<d9683b4c-127b-413a-ae2e-fa7dfb32c69d@contoso.com>",
      "receivedDateTime": "2025-06-13T10:30:00Z",
      "subject": "Quarterly Report",
      "size": 45678,
      "fromIP": "192.168.1.100",
      "toIP": "",
      "status": "Delivered"
    }
  ]
}

Example 2: Get message traces by filtering on the receivedDateTime property

This example gets message traces by filtering on their receivedDateTime in specific range. Always specify the start and end date time by using the ge and le query operators.

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/admin/exchange/tracing/messageTraces?$filter=receivedDateTime ge 2025-06-13T00:00:00.000Z and receivedDateTime le 2025-06-14T00:00:00.000Z

Response

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

{
  "value": [
    {
      "@odata.type": "#microsoft.graph.exchangeMessageTrace",
      "id": "4451a062-48cb-e80d-e8c0-196330437ae6",
      "senderAddress": "sender@contoso.com",
      "recipientAddress": "recipient@contoso.com",
      "messageId": "<d9683b4c-127b-413a-ae2e-fa7dfb32c69d@contoso.com>",
      "receivedDateTime": "2025-06-13T10:30:00Z",
      "subject": "Quarterly Report",
      "size": 45678,
      "fromIP": "192.168.1.100",
      "toIP": "",
      "status": "Delivered"
    }
  ]
}