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

# Microsoft Outlook Actions integration

[Back to list of integrations](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems.md)

Use the Microsoft Outlook integration to let agents send, reply to, forward, draft, label, move, and find email in Microsoft 365 mailboxes through Microsoft Graph.

| Authentication | Actions | Workflow triggers |
| - | - | - |
| OAuth 2.0 App (User Delegated), Azure AD (Service Principal), OAuth 2.0 Client Credentials | [12](#supported-actions) | [3](#workflow-triggers) |

## Supported actions

Actions are Outlook operations that an agent runs as Action Tools during a conversation. You can also run them from an [Integration node](https://koreai.mintlify.site/agent-platform/workflows.md#integration-node) in a workflow.

| Action | Use it to |
| - | - |
| [Send Email](#send-email) | Send an email. |
| [Reply to Email](#reply-to-email) | Reply to a message, or save the reply as a draft. |
| [Forward Email](#forward-email) | Forward a message with an optional comment. |
| [Create Draft Email](#create-draft-email) | Create a draft without sending it. |
| [Send Draft Email](#send-draft-email) | Send an existing draft. |
| [Request Approval in Email](#request-approval-in-email) | Send an approval request and wait for the recipient to approve or reject it. |
| [Find Email](#find-email) | Search messages with full-text search. |
| [Download Attachment](#download-attachment) | Download the attachments of a message. |
| [Add Label to Email](#add-label-to-email) | Add categories to a message. |
| [Remove Label from Email](#remove-label-from-email) | Remove categories from a message. |
| [Move Email to Folder](#move-email-to-folder) | Move a message to another folder. |
| [Custom API Call](#custom-api-call) | Call any Microsoft Graph endpoint the other actions don't cover. |

## Workflow triggers

Triggers are Outlook events that start a workflow automatically. Select them as [app triggers](https://koreai.mintlify.site/agent-platform/workflows.md#app-triggers) when you configure a workflow.

| Trigger | Fires when |
| - | - |
| New Email | A new email arrives in the inbox. |
| New Email in Folder | A new email is delivered to a folder you specify. |
| New Attachment | An email with one or more attachments arrives. |

## Set up the integration

**1. Register an Entra ID app**

Register an app in [Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app), create a client secret, and copy the **Application (client) ID**, **Directory (tenant) ID**, and secret value. Add Microsoft Graph permissions: **Delegated** (for example `Mail.ReadWrite`, `Mail.Send`, `offline_access`) for user sign-in, or **Application** (`Mail.ReadWrite`, `Mail.Send`, with admin consent) for app-only access. For delegated access, add the Artemis **Callback URL** as a **Web** redirect URI.

> [!WARNING]
>
> Application permissions cover every mailbox in the tenant. Scope them with an Exchange Online application access policy or RBAC for Applications.

**2. Create the auth profile**

In **Integrations**, select **Microsoft Outlook** > **Connect**. On **Project Auth Profiles**, select **New Profile** > **Integration Profile** > **Microsoft Outlook** > **Continue**. Select an **Auth Type**, configure the fields, and select **Create Profile**. For delegated access, select **Authorize**.

> [tab] OAuth 2.0 App (User Delegated)
>
> Artemis doesn't pre-fill the endpoints. Enter **Authorization URL** `https://login.microsoftonline.com/<tenant>/oauth2/v2.0/authorize`, **Token URL** `.../oauth2/v2.0/token`, the delegated **Scopes**, **Client ID**, and **Client Secret**.
>
> **Usage Mode**: **Preconfigured** shares one authorization across users; **JIT** and **Preflight** ask each user to authorize, during or before the session. See [Auth profiles](https://koreai.mintlify.site/agent-platform/administration/integrations-settings.md#auth-profiles).

> [tab] Azure AD (Service Principal)
>
> Enter **Mailbox / User (app-only)** (UPN or object ID of the target mailbox), **Azure Tenant ID**, **Scopes** (`https://graph.microsoft.com/.default`), **Client ID**, and **Client Secret**. Keep **Resource** as `https://graph.microsoft.com`.

> [tab] OAuth 2.0 Client Credentials
>
> Keep **Authorize Using** as **Client Secret** and the pre-filled **Token URL** and **Scopes**. Enter **Client ID** and **Client Secret**.

**3. Create the action tool**

In **Tools**, select **New Tool** > **Action** > **Microsoft Outlook** > **Continue**. Select the **Action** and **Auth Profile**, set parameter defaults (leave a value empty for the agent to supply at runtime), and select **Create Tool**. Then [assign the tool to an agent](https://koreai.mintlify.site/agent-platform/tools/actions.md#assign-an-action-to-an-agent).

## Action reference

> [accordion] Send Email
>
> | Parameter | Type | Description |
> | - | - | - |
> | `recipients` | array | To addresses. |
> | `ccRecipients` | array | Carbon copy addresses. |
> | `bccRecipients` | array | Blind carbon copy addresses. |
> | `subject` | string | Subject line. |
> | `bodyFormat` | enum | Body format. Default: `Text`. |
> | `body` | string | Message body. |
> | `attachments` | array | Attachments. |

> [accordion] Reply to Email
>
> | Parameter | Type | Description |
> | - | - | - |
> | `messageId` | enum | Message to reply to. |
> | `bodyFormat` | enum | Body format. Default: `Text`. |
> | `replyBody` | string | Reply content. |
> | `ccRecipients` | array | Carbon copy addresses. |
> | `bccRecipients` | array | Blind carbon copy addresses. |
> | `attachments` | array | Attachments. |
> | `draft` | boolean | Saves the reply as a draft without sending. Default: `False`. |

> [accordion] Forward Email
>
> | Parameter | Type | Description |
> | - | - | - |
> | `messageId` | enum | Message to forward. |
> | `recipients` | array | To addresses. |
> | `comment` | string | Optional comment above the forwarded message. |

> [accordion] Create Draft Email
>
> | Parameter | Type | Description |
> | - | - | - |
> | `recipients` | array | To addresses. |
> | `ccRecipients` | array | Carbon copy addresses. |
> | `bccRecipients` | array | Blind carbon copy addresses. |
> | `subject` | string | Subject line. |
> | `bodyFormat` | enum | Body format. Default: `Text`. |
> | `body` | string | Message body. |
> | `attachments` | array | Attachments. |

> [accordion] Send Draft Email
>
> | Parameter | Type | Description |
> | - | - | - |
> | `messageId` | enum | Draft to send. |

> [accordion] Request Approval in Email
>
> Sends the request and pauses the tool until the recipient approves or rejects it.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `recipients` | string | Approver's email address. |
> | `subject` | string | Subject of the approval request. |
> | `body` | string | Details of the approval request. |

> [accordion] Find Email
>
> | Parameter | Type | Description |
> | - | - | - |
> | `searchQuery` | string | Search terms, for example `from:john@example.com` or `subject:urgent`. |
> | `folderId` | enum | Folder to search. Leave empty to search all folders. |
> | `top` | number | Maximum results, from 1 to 1000. |

> [accordion] Download Attachment
>
> | Parameter | Type | Description |
> | - | - | - |
> | `messageId` | string | ID of the message that contains the attachments. |

> [accordion] Add Label to Email
>
> | Parameter | Type | Description |
> | - | - | - |
> | `messageId` | enum | Message to label. |
> | `categories` | array | Categories to add. |

> [accordion] Remove Label from Email
>
> | Parameter | Type | Description |
> | - | - | - |
> | `messageId` | enum | Message to update. |
> | `categories` | array | Categories to remove. |

> [accordion] Move Email to Folder
>
> | Parameter | Type | Description |
> | - | - | - |
> | `messageId` | enum | Message to move. |
> | `destinationFolderId` | enum | Destination folder. |

> [accordion] Custom API Call
>
> Sends a request to any Microsoft Graph endpoint. Artemis injects the authorization header from the auth profile.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `url` | object | Endpoint URL. |
> | `method` | enum | HTTP method. |
> | `headers` | object | Additional request headers. |
> | `queryParams` | object | Query parameters. |
> | `body_type` | enum | Body type. Default: `None`. |
> | `body` | object | Request body. |
> | `response_is_binary` | boolean | Turn on for binary responses, such as PDFs or images. Default: `False`. |
> | `failsafe` | boolean | Returns no error when the call fails. |
> | `timeout` | number | Timeout, in seconds. |
> | `followRedirects` | boolean | Follows HTTP redirects. Default: `False`. |

## Troubleshoot common issues

| Issue | Resolution |
| - | - |
| `AADSTS50011` redirect URI mismatch | Add the exact **Callback URL** as a **Web** redirect URI in the app registration. |
| `AADSTS65001` consent required | Grant admin consent for the API permissions, and then authorize again. |
| `403 Forbidden` or `ErrorAccessDenied` | Add the missing Graph permission for the action, and grant consent. |
| App-only calls fail with `/me request is only valid with delegated authentication` | Enter the target mailbox in **Mailbox / User (app-only)**. |
| Delegated profile stops refreshing | Include `offline_access` in **Scopes**, and then authorize again. |
| Message dropdowns are empty | Confirm the profile has read access (`Mail.Read` or `Mail.ReadWrite`) to the mailbox. |

**Related articles:**

* [Enterprise systems integrations](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems.md)
* [Auth profiles](https://koreai.mintlify.site/agent-platform/administration/integrations-settings.md#auth-profiles)
* [Action Tools](https://koreai.mintlify.site/agent-platform/tools/actions.md)
* [Microsoft Exchange Actions integration](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems/microsoft-exchange)
* [Microsoft Graph mail API](https://learn.microsoft.com/en-us/graph/outlook-mail-concept-overview)


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