> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dema.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft 365

> Connect Teams, Outlook, SharePoint and OneDrive to the Dema Agent with one sign-in.

Connect Microsoft 365 and the Dema Agent can work with your Teams chats, Outlook email and calendar, and SharePoint and OneDrive files. It sees only what you can see in Microsoft 365, and it asks you before it sends, saves or shares anything.

Setting it up takes three steps. Steps 1 and 2 happen once for your whole company.

> [card] [1. Allow it in Dema](#1-allow-microsoft-365-in-dema)
>
> A Dema admin turns it on for your organisation

> [card] [2. Approve it in Microsoft](#2-approve-dema-in-microsoft)
>
> A Microsoft admin approves Dema once

> [card] [3. Connect](#3-connect-microsoft-365)
>
> Everyone signs in with their work account

***

## What you can ask for

> [accordion] Teams
>
> | Ask the agent to | For example |
> | - | - |
> | Catch up on a channel or chat | *"Summarize this week's messages in the Trading channel."* |
> | Search conversations | *"Find where we discussed the supplier price increase."* |
> | Post an analysis | *"Post this margin breakdown in the Trading channel."* |
> | Reply in a thread | *"Reply to the delivery delay thread with the corrected forecast."* |
> | Message a colleague | *"Send Alex a chat with the top five underperforming SKUs."* |
> | Send yourself a report | *"Send me the daily ROAS summary in Teams."* |

> [accordion] Outlook email
>
> | Ask the agent to | For example |
> | - | - |
> | Find and read email | *"Find the latest stock report from our warehouse and summarize it."* |
> | Read an attachment | *"Open the CSV attached to Monday's supplier email and check the totals."* |
> | Send email | *"Email this week's margin summary to the buying team."* |
> | Draft for you to review | *"Draft a reply to Anna's email with the new delivery dates."* |
> | Forward | *"Forward the campaign brief to [marketing@yourcompany.com](mailto:marketing@yourcompany.com)."* |

> [accordion] Outlook calendar
>
> | Ask the agent to | For example |
> | - | - |
> | Check your calendar | *"What meetings do I have on Thursday?"* |
> | Find a time | *"When are Anna and Erik both free for 30 minutes next week?"* |
> | Book a meeting | *"Book a Teams meeting with Anna on Friday at 10 to review the forecast."* |
> | Answer an invitation | *"Accept the budget review invitation."* |

> [accordion] SharePoint and OneDrive
>
> | Ask the agent to | For example |
> | - | - |
> | Find and read files | *"Read the Q4 budget from SharePoint and compare it with actual spend."* |
> | Open a link | *"Read the file in this link and list the open actions."* |
> | Read SharePoint lists | *"Show the open items in the Campaign tracker list on the Marketing site."* |
> | Save results | *"Save this report as a CSV in the Reports folder of my OneDrive."* |
> | Share a file | *"Create a view link to that file for the team."* |

***

## 1. Allow Microsoft 365 in Dema

An organisation admin in Dema goes to **Settings → Organisation → Connector permissions** and turns on **Microsoft 365**.

Skip this step if Microsoft 365 already shows up when you click **New connector** under **Agents → Settings → Connectors**.

***

## 2. Approve Dema in Microsoft

Microsoft requires an admin to approve apps that read Teams channels or SharePoint files. A Microsoft admin approves Dema once, for everyone in your company. After that, nobody else sees an approval request.

The admin needs one of these Microsoft Entra roles: Global Administrator, Privileged Role Administrator, Cloud Application Administrator or Application Administrator. Pick the way that suits them:

> [tab] Approve while connecting (recommended)
>
> For a Microsoft admin who can sign in to Dema:
>
> 1. In Dema, go to **Agents → Settings → Connectors**, click **New connector**, find **Microsoft 365** and click **Connect**.
> 2. Sign in with your Microsoft work account.
> 3. On Microsoft's **Permissions requested** screen, tick **Consent on behalf of your organization**, then click **Accept**.
>
> You're back in Dema, and your colleagues can now connect without asking you.
>
> > [!WARNING]
> >
> > **Tick Consent on behalf of your organization.** Without it, Microsoft approves Dema for you alone, and your colleagues still see **Need admin approval**.

> [tab] Approve with a link
>
> For a Microsoft admin who doesn't use Dema. Send them this section.
>
> 1. In the [Microsoft Entra admin center](https://entra.microsoft.com), open **Overview** and copy the **Tenant ID**.
>
> 2. Replace `{your-tenant-id}` in this link with your tenant ID, then open it in your browser:
>
>    ```text theme={null}
>    https://login.microsoftonline.com/{your-tenant-id}/v2.0/adminconsent?client_id=a268336e-61fb-483f-a9f9-df76dff26c93&scope=openid%20email%20profile%20https://graph.microsoft.com/User.Read%20https://graph.microsoft.com/People.Read%20https://graph.microsoft.com/Team.ReadBasic.All%20https://graph.microsoft.com/Channel.ReadBasic.All%20https://graph.microsoft.com/Chat.Read%20https://graph.microsoft.com/Chat.Create%20https://graph.microsoft.com/ChatMessage.Send%20https://graph.microsoft.com/ChannelMessage.Read.All%20https://graph.microsoft.com/ChannelMessage.Send%20https://graph.microsoft.com/Sites.Read.All%20https://graph.microsoft.com/Files.ReadWrite.All%20https://graph.microsoft.com/Mail.ReadWrite%20https://graph.microsoft.com/Mail.Send%20https://graph.microsoft.com/Calendars.ReadWrite%20offline_access&redirect_uri=https://app.dema.ai/agents/oauth/callback
>    ```
>
> 3. Sign in with your admin account, review the permissions and click **Accept**.
>
> Microsoft then opens Dema. You don't need to sign in there: the approval is saved, and you can close the tab.
>
> > [!NOTE]
> >
> > **Dema's Microsoft app ID:** `a268336e-61fb-483f-a9f9-df76dff26c93`. Use it to find Dema under **Enterprise applications** in Microsoft Entra.

***

## 3. Connect Microsoft 365

Once a Microsoft admin has approved Dema, everyone connects their own account:

1. In Dema, go to **Agents → Settings → Connectors**, click **New connector**, find **Microsoft 365** and click **Connect**.
2. Sign in with your Microsoft work account. Personal accounts, such as outlook.com or hotmail.com, can't connect.

Microsoft 365 then shows as connected. To check it works, ask the agent something only Microsoft 365 knows, such as *"What meetings do I have tomorrow?"*

***

## Good to know

> [accordion] What the agent can see and do
>
> The agent signs in as you. It sees only the chats, email, calendar and files that you can open in Microsoft 365. It acts only when you ask, and it asks you to confirm before it sends, saves or shares anything.
>
> It doesn't read meeting transcripts, change Outlook folders, rules or automatic replies, or delete email, events or files.

> [accordion] Limits
>
> | What | Limit |
> | - | - |
> | Long Teams messages | Sent as several messages |
> | Long emails | The agent reads the first 20,000 characters |
> | Attachments the agent sends | About 2 MB in total per email |
> | Files and attachments the agent reads | Up to 100 MB each |
> | Files the agent saves | Up to 250 MB each |
> | Sharing links | Work only for people in your company |

> [accordion] Permissions Dema asks for
>
> Dema acts on behalf of the person who connected. It can never do more than that person can do in Microsoft 365.
>
> | Microsoft permission | What it allows |
> | - | - |
> | `User.Read`, `openid`, `email`, `profile` | Sign you in and show which account is connected |
> | `People.Read` | Find colleagues by name |
> | `Team.ReadBasic.All`, `Channel.ReadBasic.All` | List your teams and channels |
> | `Chat.Read`, `ChannelMessage.Read.All` | Read and search your chats and channel messages |
> | `Chat.Create`, `ChatMessage.Send`, `ChannelMessage.Send` | Start chats and send messages |
> | `Mail.ReadWrite` | Read and search your email, and save drafts |
> | `Mail.Send` | Send and forward email as you |
> | `Calendars.ReadWrite` | Read your calendar, find free times, book meetings and answer invitations |
> | `Sites.Read.All` | Find and read SharePoint sites, libraries and lists |
> | `Files.ReadWrite.All` | Read, save and share files in OneDrive and SharePoint |
> | `offline_access` | Stay connected, so you don't have to sign in again often |

> [accordion] Choose who can use it
>
> A Microsoft admin can limit Dema to some people:
>
> 1. In the [Microsoft Entra admin center](https://entra.microsoft.com), open **Enterprise applications** and search for Dema's app ID `a268336e-61fb-483f-a9f9-df76dff26c93`.
> 2. Under **Properties**, set **Assignment required?** to **Yes** and save.
> 3. Under **Users and groups**, add the people or groups who may connect.

> [accordion] Remove access
>
> To disconnect your own account, go to **Agents → Settings → Connectors**, open **Microsoft 365** and click **Disconnect**.
>
> To remove Dema for the whole company, a Microsoft admin deletes it under **Enterprise applications** in Microsoft Entra.

***

## Troubleshooting

> [accordion] Microsoft says "Need admin approval"
>
> No Microsoft admin has approved Dema for your company yet. Send your admin [step 2](#2-approve-dema-in-microsoft), then connect again. If your company uses Microsoft's admin consent workflow, you can also send a request from that screen.

> [accordion] Colleagues still see "Need admin approval" after the admin connected
>
> The admin connected without ticking **Consent on behalf of your organization**, so Microsoft approved Dema for them alone. Ask the admin to use **Approve with a link** in [step 2](#2-approve-dema-in-microsoft).

> [accordion] Microsoft says the account doesn't exist, or personal accounts aren't supported
>
> You signed in with a personal Microsoft account. Sign in with your work account.

> [accordion] The agent can't find a SharePoint site or file
>
> Give the agent the site's address, such as `https://yourcompany.sharepoint.com/sites/Marketing`, or a link to the file. The agent sees only the sites and files that you can open yourself.

***

## Need help?

> [card] Contact support
>
> Email us at [info@dema.ai](mailto:info@dema.ai) with the error message

> [card] [Agent integrations](https://docs.dema.ai/guides/agent/integrations/overview.md)
>
> Everything else the Dema Agent can connect to


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.