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

# Microsoft Outlook

> Send and manage Outlook messages, drafts, folders, and attachments from inside an agent workflow.

Microsoft Outlook actions let an agent work with a mailbox directly in a flow. An agent can send and reply to messages, manage drafts and folders, move messages, and handle attachments, then pass the results to later steps.

## Supported actions

| Group              | Actions                                          |
| ------------------ | ------------------------------------------------ |
| **Message**        | Send, Get, Get Mime, Update, Move, Reply, Delete |
| **Draft**          | Create, Update, Get, Send, Delete                |
| **Folder**         | Get All, Get, Get Children, Delete               |
| **Folder message** | Get All                                          |
| **Attachment**     | Add, Get, Download                               |

## Prerequisites

<AccordionGroup>
  <Accordion title="Create a Microsoft OAuth credential" icon="key">
    Set up a Microsoft OAuth credential by following the [Microsoft Entra OAuth setup guide](/integrations/oauth-setup/microsoft-entra), store it in [Credential Management](/admin-hub/account_settings/credential-management), then select it on every Microsoft Outlook action. These actions also support end user authentication, so a step can act on each user's own mailbox.
  </Accordion>
</AccordionGroup>

## How to use these actions

* **Map text inputs from earlier steps.** Inputs such as **To**, **Subject**, and **Body** accept a value mapped from a previous step. The **Body Content Type** and **Importance** selections, the **Save To Sent Items**, **Is Read**, and **Reply All** toggles, and **Top** take fixed values.
* **Recipient fields accept multiple addresses.** **To**, **Cc**, and **Bcc** accept multiple comma separated addresses.
* **Folder message lookups accept a name or an ID.** The **Folder Message Get All** action accepts a well known folder name (`inbox`, `drafts`, `sentitems`, `deleteditems`) or a folder ID.
* **List actions use OData syntax.** The **Filter** input uses OData syntax such as `isRead eq false`.
* **Attachment content is base64 encoded.** Provide attachment content as a base64 encoded value.

## Actions

### Message

#### Microsoft Outlook Message Send

Sends a new message.

| Input                  | Required | Description                                                                      |
| ---------------------- | -------- | -------------------------------------------------------------------------------- |
| **To**                 | Yes      | Recipient addresses, comma separated for multiple recipients.                    |
| **Cc**                 | No       | Carbon copy addresses, comma separated.                                          |
| **Bcc**                | No       | Blind carbon copy addresses, comma separated.                                    |
| **Subject**            | Yes      | The subject line of the message.                                                 |
| **Body**               | Yes      | The body content of the message.                                                 |
| **Body Content Type**  | No       | The body format, either `Text` or `Html`. Defaults to `Text`.                    |
| **Importance**         | No       | The message importance, one of `Low`, `Normal`, or `High`. Defaults to `Normal`. |
| **Save To Sent Items** | No       | Toggle. Set on to save a copy in Sent Items. Defaults to on.                     |

#### Microsoft Outlook Message Get

Retrieves a message by ID.

| Input          | Required | Description              |
| -------------- | -------- | ------------------------ |
| **Message ID** | Yes      | The message to retrieve. |

#### Microsoft Outlook Message Get Mime

Retrieves the raw MIME content of a message.

| Input          | Required | Description                                            |
| -------------- | -------- | ------------------------------------------------------ |
| **Message ID** | Yes      | The message to retrieve. Returns the raw MIME content. |

#### Microsoft Outlook Message Update

Updates a message.

| Input          | Required | Description                                                           |
| -------------- | -------- | --------------------------------------------------------------------- |
| **Message ID** | Yes      | The message to update.                                                |
| **Is Read**    | No       | Toggle. Set on to mark the message as read, off to mark it as unread. |
| **Categories** | No       | Comma separated list of categories to apply.                          |

#### Microsoft Outlook Message Move

Moves a message to another folder.

| Input                     | Required | Description                          |
| ------------------------- | -------- | ------------------------------------ |
| **Message ID**            | Yes      | The message to move.                 |
| **Destination Folder ID** | Yes      | The folder to move the message into. |

#### Microsoft Outlook Message Reply

Replies to a message.

| Input          | Required | Description                                                 |
| -------------- | -------- | ----------------------------------------------------------- |
| **Message ID** | Yes      | The message to reply to.                                    |
| **Comment**    | Yes      | The reply body.                                             |
| **Reply All**  | No       | Toggle. Set on to reply to all recipients. Defaults to off. |

#### Microsoft Outlook Message Delete

Deletes a message.

| Input          | Required | Description            |
| -------------- | -------- | ---------------------- |
| **Message ID** | Yes      | The message to delete. |

### Draft

#### Microsoft Outlook Draft Create

Creates a draft message.

| Input                 | Required | Description                                                                    |
| --------------------- | -------- | ------------------------------------------------------------------------------ |
| **To**                | No       | Recipient addresses, comma separated.                                          |
| **Cc**                | No       | Carbon copy addresses, comma separated.                                        |
| **Bcc**               | No       | Blind carbon copy addresses, comma separated.                                  |
| **Subject**           | No       | The subject line of the draft.                                                 |
| **Body**              | No       | The body content of the draft.                                                 |
| **Body Content Type** | No       | The body format, either `Text` or `Html`. Defaults to `Text`.                  |
| **Importance**        | No       | The draft importance, one of `Low`, `Normal`, or `High`. Defaults to `Normal`. |

#### Microsoft Outlook Draft Update

Updates a draft message.

| Input                 | Required | Description                                              |
| --------------------- | -------- | -------------------------------------------------------- |
| **Message ID**        | Yes      | The draft to update.                                     |
| **To**                | No       | Recipient addresses, comma separated.                    |
| **Cc**                | No       | Carbon copy addresses, comma separated.                  |
| **Bcc**               | No       | Blind carbon copy addresses, comma separated.            |
| **Subject**           | No       | The subject line of the draft.                           |
| **Body**              | No       | The body content of the draft.                           |
| **Body Content Type** | No       | The body format, either `Text` or `Html`.                |
| **Importance**        | No       | The draft importance, one of `Low`, `Normal`, or `High`. |

#### Microsoft Outlook Draft Get

Retrieves a draft by ID.

| Input          | Required | Description            |
| -------------- | -------- | ---------------------- |
| **Message ID** | Yes      | The draft to retrieve. |

#### Microsoft Outlook Draft Send

Sends an existing draft.

| Input          | Required | Description        |
| -------------- | -------- | ------------------ |
| **Message ID** | Yes      | The draft to send. |

#### Microsoft Outlook Draft Delete

Deletes a draft.

| Input          | Required | Description          |
| -------------- | -------- | -------------------- |
| **Message ID** | Yes      | The draft to delete. |

### Folder

#### Microsoft Outlook Folder Get All

Lists mail folders.

| Input   | Required | Description                                                           |
| ------- | -------- | --------------------------------------------------------------------- |
| **Top** | No       | Maximum number of folders to return, from 1 to 1000. Defaults to 100. |

#### Microsoft Outlook Folder Get

Retrieves a folder by ID.

| Input         | Required | Description             |
| ------------- | -------- | ----------------------- |
| **Folder ID** | Yes      | The folder to retrieve. |

#### Microsoft Outlook Folder Get Children

Lists the child folders of a folder.

| Input         | Required | Description                                                           |
| ------------- | -------- | --------------------------------------------------------------------- |
| **Folder ID** | Yes      | The parent folder to read child folders from.                         |
| **Top**       | No       | Maximum number of folders to return, from 1 to 1000. Defaults to 100. |

#### Microsoft Outlook Folder Delete

Deletes a folder.

| Input         | Required | Description           |
| ------------- | -------- | --------------------- |
| **Folder ID** | Yes      | The folder to delete. |

### Folder message

#### Microsoft Outlook Folder Message Get All

Lists messages in a folder.

| Input         | Required | Description                                                                                                                                       |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Folder ID** | Yes      | The folder to read messages from. Accepts a well known name (`inbox`, `drafts`, `sentitems`, `deleteditems`) or a folder ID. Defaults to `inbox`. |
| **Top**       | No       | Maximum number of messages to return, from 1 to 1000. Defaults to 50.                                                                             |
| **Filter**    | No       | An OData filter, such as `isRead eq false`.                                                                                                       |

### Attachment

#### Microsoft Outlook Attachment Add

Adds an attachment to a message.

| Input              | Required | Description                             |
| ------------------ | -------- | --------------------------------------- |
| **Message ID**     | Yes      | The message to attach the file to.      |
| **File Name**      | Yes      | The name of the attachment file.        |
| **Content Base64** | Yes      | The attachment content, base64 encoded. |
| **Content Type**   | No       | The MIME type of the attachment.        |

#### Microsoft Outlook Attachment Get

Retrieves attachment metadata for a message.

| Input             | Required | Description                                                             |
| ----------------- | -------- | ----------------------------------------------------------------------- |
| **Message ID**    | Yes      | The message to read attachments from.                                   |
| **Attachment ID** | No       | A specific attachment to retrieve. Leave empty to list all attachments. |

#### Microsoft Outlook Attachment Download

Downloads an attachment.

| Input             | Required | Description                            |
| ----------------- | -------- | -------------------------------------- |
| **Message ID**    | Yes      | The message that holds the attachment. |
| **Attachment ID** | Yes      | The attachment to download.            |

## Example

An agent that processes incoming invoices and files them away:

<Steps>
  <Step title="Find unread mail">
    A **Microsoft Outlook Folder Message Get All** action sets **Folder ID** to `inbox` and **Filter** to `isRead eq false` so the flow reads only new messages.
  </Step>

  <Step title="Pull the attachment">
    A **Microsoft Outlook Attachment Download** action maps **Message ID** to a message from the previous step and downloads the invoice file for a later step to process.
  </Step>

  <Step title="Mark and move">
    A **Microsoft Outlook Message Update** action sets **Is Read** on, then a **Microsoft Outlook Message Move** action sets **Destination Folder ID** to an archive folder.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Message or folder not found" icon="circle-question">
    The **Message ID** or **Folder ID** does not exist in the connected mailbox. Confirm the ID with a Get All action and that the credential is for the correct account.
  </Accordion>

  <Accordion title="Folder name not recognized" icon="folder">
    The **Folder Message Get All** action accepts the well known names `inbox`, `drafts`, `sentitems`, and `deleteditems`, or a folder ID. Other folders must be referenced by their ID, which you can look up with **Microsoft Outlook Folder Get All**.
  </Accordion>

  <Accordion title="Invalid OData filter" icon="filter">
    The **Filter** input must be valid OData syntax, such as `isRead eq false`. Check field names and operators if the action returns a query error.
  </Accordion>

  <Accordion title="Authentication failed" icon="lock">
    The Microsoft OAuth credential expired or was revoked. Reconnect the credential and confirm the required mail permissions were granted during consent.
  </Accordion>
</AccordionGroup>

For issues common to every vendor, see the [Actions overview](/building-and-deploying-agents/agent-basics/actions/overview#troubleshooting).
