> For the complete documentation index, see [llms.txt](https://docs.expel.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.expel.io/more-features/expel-managed-phishing/setup-guides/microsoft-365-message-trace-setup.md).

# Microsoft 365 Message Trace Setup

This procedure enables the Message Trace API for an Microsoft 365 installation, which helps Expel investigate phishing submissions. This procedure varies depending on which option you selected while connecting your Microsoft 365 installation to Workbench:

* If you chose to [enable the Expel O365 integration](/connect-your-technology/l-p-integrations/microsoft/microsoft-365-setup-for-workbench.md#option-1-enable-the-expel-o365-integration-recommended) during your onboarding, follow the steps in [Option 1.](#option-1-expel-o365-integrations)
* If you chose to [create a custom Entra ID app](/connect-your-technology/l-p-integrations/microsoft/microsoft-365-setup-for-workbench.md#option-2-create-a-custom-entra-id-app) during your onboarding, follow the steps in [Option 2](#option-2-custom-entra-id-apps).

{% hint style="info" %}
If you need additional help, [contact Support](/support/how-to-reach-us.md).
{% endhint %}

## Option 1 (Expel O365 Integrations)

<details>

<summary>New Installation</summary>

1. In the Microsoft Entra admin center, search for and select **Microsoft Entra roles and administrators**.
2. On the All roles page, search for and select the `Security reader` role.
3. Select **Add assignments**.

<div align="left"><figure><img src="https://2371323735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F82234aPbNfd179j5U4ti%2Fuploads%2Fsbrt7mm2kxDs3gIdLKOl%2Fmceclip0.png?alt=media&amp;token=28b9dfc7-d89f-4a02-89f9-288dd31e84cb" alt="Image of the Assignments page." width="368"><figcaption></figcaption></figure></div>

4. Search for the **Expel O365 Integration** enterprise app and select it.
5. Select **Add**.
6. Perform steps 3-6 again, but selecting the  `Global reader` role.

</details>

<details>

<summary>Existing Installation</summary>

1. In the Microsoft Entra admin center, search for and select **Expel O365 Integration > API Permissions**, and then select **Grant admin consent**.
2. Consent to the new API permissions.
3. Navigate to **Microsoft Entra roles and administrators**.
4. On the All roles page, search for and select the `Security reader` role.
5. Select **Add assignments**.

   <div align="left"><figure><img src="https://2371323735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F82234aPbNfd179j5U4ti%2Fuploads%2Fsbrt7mm2kxDs3gIdLKOl%2Fmceclip0.png?alt=media&amp;token=28b9dfc7-d89f-4a02-89f9-288dd31e84cb" alt="Image of the Assignments page." width="368"><figcaption></figcaption></figure></div>
6. Search for the **Expel O365 Integration** enterprise app and select it.
7. Select **Add**.
8. Perform steps 3-6 again, but selecting the `Global reader` role.

</details>

## Option 2 (Custom Entra ID Apps)&#x20;

{% hint style="info" %}
These steps apply to both new and existing installations.
{% endhint %}

1. Follow all previous API permission steps for the custom app in [Microsoft 365 Setup for Workbench](/connect-your-technology/l-p-integrations/microsoft/microsoft-365-setup-for-workbench.md#option-2-create-a-custom-entra-id-app).
2. Navigate to the custom app and select **API Permissions**.
3. On the APIs my organization uses tab, select **Add a permission**.
4. Search for and select **Microsoft 365 Exchange Online**.

<div align="left"><figure><img src="https://2371323735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F82234aPbNfd179j5U4ti%2Fuploads%2Fm9YDaFgvsgJ8lJP4rcbO%2FOffice365_Message_Trace_API_Permissions.png?alt=media&amp;token=62af65f9-b395-4ba7-9c08-3784638feba1" alt="Image showing the search field and results." width="375"><figcaption></figcaption></figure></div>

5. Select **Application permissions**, and then, in the **Select permissions** search field, search for `ReportingWebService`.

<div align="left"><figure><img src="https://2371323735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F82234aPbNfd179j5U4ti%2Fuploads%2FbNstPnJ9O8YWBxoOaVsT%2FRequest_API_permissions_Add.jpg?alt=media&amp;token=9bc689c7-914b-4d1a-8df5-7c13b5a53c21" alt="Image of the Request API Permissions screen." width="563"><figcaption></figcaption></figure></div>

6. Select the `ReportingWebService.Read.All` permission, and then select **Add permissions**.
7. In the confirmation, select **Grant admin consent for Expel** and then select Yes.
8. Confirm that consent is granted for the added permission in the **Status** column.
9. Navigate to **Microsoft Entra roles and administrators**.
10. Search for and select the following roles:
    * Global reader
    * Security reader
11. Select **Add assignments**.

<div align="left"><figure><img src="https://2371323735-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F82234aPbNfd179j5U4ti%2Fuploads%2Fsbrt7mm2kxDs3gIdLKOl%2Fmceclip0.png?alt=media&amp;token=28b9dfc7-d89f-4a02-89f9-288dd31e84cb" alt="Image of the Assignments page." width="368"><figcaption></figcaption></figure></div>

12. Search for the **custom app** and select it.
13. Select **Add**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.expel.io/more-features/expel-managed-phishing/setup-guides/microsoft-365-message-trace-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
