---
title: "Connect Microsoft 365 mail with Graph API"
site: admin
version: 2027.1
versions: "all"
url: https://docs-new.servicely.ai/admin/2027.1/messaging/connect-microsoft-365-graph-api/
type: task
application: system_email
last_updated: 2026-12-03
commit: 97a56b9c7df7
---


Connect a Microsoft 365 mailbox through Microsoft Graph when you want one messaging account to both collect and send email. The account signs in as an application, so nobody signs in to Microsoft for it.

## Before you begin

- You need the `administrator` role in Servicely.
- Switch to the Administration workspace with the **Workspace** selector at the foot of the menu.
- You need permission to create app registrations and grant admin consent in Microsoft Entra ID.
- The messaging account type Microsoft Graph API (Inbound/Outbound Email) is inactive by default. The **Type** list shows it only once the value is active.

## Steps

<Steps>
  <Step>
    In the Microsoft Entra admin centre, register an application for Servicely. Copy its application (client) ID and its directory (tenant) ID. Microsoft describes the screen in [How to register an app in Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app).
  </Step>
  <Step>
    In the Microsoft Entra admin centre, open the application's **API permissions**. Add the Microsoft Graph application permissions `Mail.Read`, `Mail.ReadWrite` and `Mail.Send`, then grant admin consent. See [Web API app registration and API permissions](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-configure-app-access-web-apis).
  </Step>
  <Step>
    In the Microsoft Entra admin centre, open **Certificates & secrets** and create a client secret. Copy its value. See [Add and manage app credentials in Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity-platform/how-to-add-credentials).
  </Step>
  <Step>
    In Exchange Online, limit the application to the mailbox Servicely uses. Without a limit, the application permissions apply to every mailbox in the tenant. See [Role Based Access Control for Applications in Exchange Online](https://learn.microsoft.com/en-us/exchange/permissions-exo/application-rbac).
  </Step>
  <Step>
    In Servicely, go to **Messaging & notifications → Accounts & channels → Messaging accounts**.

    <Image src="asset:screenshots/admin/messaging-connect-microsoft-365-graph-api/messaging-accounts-menu.png">The Messaging accounts item in the Messaging & notifications menu.</Image>
  </Step>
  <Step>
    Select **New** and fill in the form.

    | Field | What to enter | Example |
    | --- | --- | --- |
    | **Name** | A name that identifies the mailbox and the environment. | Service desk mailbox (production) |
    | **Type** | Microsoft Graph API (Inbound/Outbound Email). | |
    | **Active** | Yes. | |
    | **Username** | The mailbox address or user principal name Servicely reads and sends as. | `servicedesk@example.com` |
    | **Tenant Id** | The directory (tenant) ID you copied. | |
    | **Client Id** | The application (client) ID you copied. | |
    | **App secret** | The client secret value you copied. | |
  </Step>
  <Step>
    Select **Create**.
  </Step>
  <Step>
    Select **Test Connection**. It saves the record, then shows "Connection test successful" when Servicely can read the mailbox.
  </Step>
  <Step>
    Go to **Scripting & automation → Jobs & generators → Jobs** and set **Active** to Yes on the **Inbound email processing** and **Outbound email processing** jobs. Both are inactive by default. [Create a messaging account](page:messaging/create-a-messaging-account) shows the job steps.
  </Step>
</Steps>

## Result

The messaging account is active and its connection test passes. Every minute, Servicely reads the unread mail in the mailbox's Inbox, marks it read, and sends waiting email through Graph.

## Options

| To | Do this |
| --- | --- |
| Move collected mail out of the Inbox | Enter **Move to folder**. Use a well-known folder name such as Archive, a folder's display name, or one nested level such as Inbox/Processed. If the folder is missing, Servicely logs a warning and leaves the mail in the Inbox. |
| Send notifications that name no account through this account | Set **Default** to Yes. |

## Related

- [Create a messaging account](page:messaging/create-a-messaging-account)
- [Connect Microsoft 365 mail with OAuth2](page:messaging/connect-microsoft-365-oauth2)
- [Troubleshoot messaging accounts](page:messaging/troubleshoot-messaging-accounts)
- [Inbound message fields](page:messaging/inbound-message-fields)
