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

# Connecting Outlook to your app

> Send and read email and manage calendar events from your app, using a shared account or each person's own account.

Connect your app to Outlook to send and read email, manage calendar events and run workflows when an email or event changes. Use one shared account for your whole app or let each person connect their own Microsoft account.

> [!NOTE]
>
> You need a [Builder plan](https://base44.com/pricing) or above to use connectors in your app.

***

## What you can do

Bring your Outlook mail and calendar into your app's workflows.

> [card] Send email
>
> Send email from your Outlook account when something happens in your app, such as a new booking.

> [card] Read and organize email
>
> Read recent messages, summarize them, and move or update them from your app.

> [card] Manage your calendar
>
> Show your Outlook events in your app and create or update events when something is scheduled.

> [card] [Run workflows](https://docs.base44.com/Building-your-app/Creating-workflows.md#connector)
>
> Start a workflow when an email arrives in your inbox or a calendar event is created, or when either one is updated or deleted.

**Example prompts**

Describe the mailbox or calendar, what triggers the action, and any dynamic fields in the AI chat. For example:

```text wrap theme={null}
Send emails from my app using Outlook.
```

```text wrap theme={null}
Show my Outlook calendar events in the dashboard.
```

```text wrap theme={null}
Create calendar events in Outlook when something is scheduled in my app.
```

```text wrap theme={null}
Read recent emails from Outlook and summarize them.
```

> [!TIP]
>
> Want your Superagent to join your Outlook meetings and take notes? See [Connecting your calendar](https://docs.base44.com/superagents/meeting-notes.md#connecting-your-calendar).

***

## Connecting Outlook

Choose how people connect: one shared account for your whole app, or each person's own account.

> [tab] Shared connector
>
> Connect one account, and everyone who uses your app shares it and its data.
>
> **To add a shared Outlook connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
>
> 2. Click **Add connector**.
>
> 3. Search for **Outlook** and click it.
>
> 4. Select **Shared connector**, then click **Next**.
>
> 5. Enter a **Connection name**.
>
> 6. In **Who can access**, choose where the connection can be used: **Apps and Super agent** (the default), **Apps only** or **Super agent only**.
>
> 7. Choose **Read-only** (the default), **Read & write** or **Custom** under **Permissions**. To send email, choose **Read & write**. Learn more about [scopes and permissions](#scopes-and-permissions).
>
>    ![Shared Outlook connector setup with Connection name, Who can access and Read-only permissions selected](https://mintcdn.com/base44/dnY2McSyQ8BRavEs/images/apps-connectors-outlook-shared-setup.png?fit=max\&auto=format\&n=dnY2McSyQ8BRavEs\&q=85\&s=5638130e25a42638151162b63b297ef3)
>
>    Setting up a shared Outlook connector
>
> 8. Click **Add connector**.
>
> 9. Sign in with the Microsoft account you want to share.

> [tab] App user connector
>
> Each person connects their own Microsoft account, so your app can work with their mail and calendar.
>
> > [!TIP]
> >
> > **Before you begin:** Only workspace owners and admins can set this up. You need a Microsoft app registration and its Client ID and Client Secret. Unless you'll enter a [Microsoft Tenant ID](#using-a-microsoft-tenant), set its **Supported account types** to accounts in any organizational directory and personal Microsoft accounts. See [Using your own OAuth client](https://docs.base44.com/Integrations/Connectors.md#using-your-own-oauth-client).
>
> **To add an app user Outlook connector:**
>
> 1. Click **Connectors** in your workspace sidebar.
>
> 2. Click **Add connector**.
>
> 3. Search for **Outlook** and click it.
>
> 4. Select **App user connector**, then click **Next**.
>
> 5. Copy the **Callback URL**.
>
> 6. In your Microsoft app registration, add the Callback URL to the allowed redirect URIs.
>
> 7. Back in the **Add Outlook Connection** form, enter a **Connector name**, **Client ID** and **Client Secret**.
>
>    ![Add Outlook Connection form with Callback URL, Connector name, Client ID and Client Secret](https://mintcdn.com/base44/dnY2McSyQ8BRavEs/images/apps-connectors-outlook-app-user-credentials.png?fit=max\&auto=format\&n=dnY2McSyQ8BRavEs\&q=85\&s=5fb6f375d00995fabb114eb4e9dd463c)
>
>    Entering your Microsoft app's credentials
>
> 8. (Optional) Review the preselected scopes under **Scopes** and remove any your app doesn't need.
>
>    ![Outlook Scopes field with locked and default scopes, and Additional scopes below](https://mintcdn.com/base44/dnY2McSyQ8BRavEs/images/apps-connectors-outlook-app-user-scopes.png?fit=max\&auto=format\&n=dnY2McSyQ8BRavEs\&q=85\&s=2d9c8f72c63f63496b4f8f45aae8daf4)
>
>    Choosing scopes for an app user connector
>
> 9. Click **Add Connector**.
>
> Then ask the AI chat in your app to add a way for people to connect their own Outlook account.

***

## Scopes and permissions

Scopes control what your app can do in Outlook. You choose them when you set up a connector.

> [card]
>
> **1. Base44 adds**
>
> These are always included, so they show as locked scopes under **Custom** for a shared connector or under **Scopes** for an app user connector.
>
> * `User.Read`: Sign in and read the profile of the account that connects
> * `offline_access`: Keep the connection working without signing in again
>
> **2. You configure**
>
> Select the scopes your app needs under **Custom** for a shared connector or under **Scopes** for an app user connector.
>
> For a shared connector, **Read-only** gives your app `Mail.Read` and `Calendars.Read`. **Read & write** gives it `Mail.ReadWrite`, `Calendars.ReadWrite` and `Mail.Send`.
>
> * `Mail.Read`: Read email
> * `Mail.ReadWrite`: Read, create, update, and delete email, without sending it
> * `Mail.Send`: Send email as the account
> * `Calendars.Read`: Read calendar events
> * `Calendars.ReadWrite`: Read, create, update, and delete calendar events
>
> **Access:** Your app works with the mailbox and calendar of the Microsoft account that authorizes the connection.

### Using a Microsoft tenant

For an app user connector, you can enter a **Microsoft Tenant ID** in the setup form, under Connection Configuration. Leave it empty to use `common`. If you enter one, the supported account types setting on your Microsoft app registration doesn't apply.

***

## Using backend functions

Once Outlook is connected, your backend functions can retrieve an access token and call the Microsoft Graph API directly. Base44 handles sign-in and keeps the token up to date for you.

* For a shared connection, use `getConnection()` to retrieve the token.
* For an app user connection, use `getCurrentAppUserConnection()` so each request uses the signed-in person's token.

Call the Microsoft Graph API at `graph.microsoft.com` and pass the token in the `Authorization` header:

```javascript theme={null}
// Shared connection: one account the whole app uses
const { accessToken } = await base44.asServiceRole.connectors.getConnection("outlook");

const response = await fetch(
  "https://graph.microsoft.com/v1.0/me/messages?$top=10",
  { headers: { Authorization: `Bearer ${accessToken}` } },
);
const { value: messages } = await response.json();
```

> [card] [Shared connectors](https://docs.base44.com/developers/backend/resources/connectors/shared-connectors.md)
>
> Configure, deploy, and call a shared connection from a backend function.

> [card] [App user connectors](https://docs.base44.com/developers/backend/resources/connectors/app-user-connectors.md)
>
> Retrieve a per-user token and call the API as the signed-in person.

***

## Troubleshooting

Check the connection and its scopes if Outlook stops working in your app.

> [accordion] The connection needs to be reconnected
>
> If Outlook access is lost or expires, the connection shows **This connection needs to be reconnected**. For a shared connector, [reconnect it](https://docs.base44.com/Integrations/Connectors.md#managing-your-connectors) and sign in with the same Microsoft account. Every app that uses it works again. For an app user connector, each person reconnects their own account from inside your app.

> [accordion] Your app can't send email
>
> Your app needs the `Mail.Send` scope to send email. The `Mail.ReadWrite` scope lets your app read and change messages but not send them.
>
> * For a shared connector, permissions are set when you add the connection. Click **Add another connector** on the Outlook connector page and choose **Read & write** for the new connection.
> * For an app user connector, open it on the Outlook connector page, add `Mail.Send` to its scopes and click **Save Changes**. People who already connected keep their earlier access until they connect again.


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