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

# Microsoft Outlook Mail

> Reference for the Tracecat Microsoft Outlook Mail integration: registered actions, required secrets, expected inputs, and example workflow usage.

## Add file attachment

Action ID: `tools.microsoft_outlook.add_file_attachment`

Add a `fileAttachment` to a message, normally a draft that has not been sent. Returns `201 Created` and the attachment object. This operation limits the size of the attachment you can add to under 3 MB; larger files need an upload session, which is not covered by this action. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Attaching in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-post-attachments?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-post-attachments?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="contentBytes" type="string" required>
  The base64-encoded contents of the file.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message to attach the file to.
</ParamField>

<ParamField path="name" type="string" required>
  The name representing the text that is displayed below the icon representing the embedded attachment.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="contentId" type="string | null">
  The ID of the attachment in the Exchange store.

  Default: `null`.
</ParamField>

<ParamField path="contentType" type="string | null">
  The content type of the attachment.

  Default: `null`.
</ParamField>

<ParamField path="isInline" type="boolean | null">
  Set to `true` if the attachment is an inline attachment.

  Default: `null`.
</ParamField>

## Copy message

Action ID: `tools.microsoft_outlook.copy_message`

Copy a message to a folder. Returns `201 Created` with the new message resource. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Copying in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-copy?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-copy?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="destinationId" type="string" required>
  The destination folder ID, or a well-known folder name. Well-known names include archive, clutter, conflicts, conversationhistory, deleteditems, drafts, inbox, junkemail, localfailures, msgfolderroot, outbox, recoverableitemsdeletions, scheduled, searchfolders, sentitems, serverfailures and syncissues.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

## Create child folder

Action ID: `tools.microsoft_outlook.create_child_folder`

Create a new child mail folder under the specified mail folder. Returns `201 Created` and the mail folder resource. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Creating in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/mailfolder-post-childfolders?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/mailfolder-post-childfolders?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="displayName" type="string" required>
  The display name of the new folder.
</ParamField>

<ParamField path="folderId" type="string" required>
  The parent mail folder, as a folder ID or a well-known folder name such as inbox, msgfolderroot or archive.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="isHidden" type="boolean | null">
  Indicates whether the new folder is hidden. The default value is `false`. Setting the property is optional. Once set, you cannot update this property.

  Default: `null`.
</ParamField>

## Create draft

Action ID: `tools.microsoft_outlook.create_draft`

Create a draft of a new message in the specified user's mailbox. The draft can later be sent with `send_draft`. Returns `201 Created` and the message object. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application. Drafting in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. This action exposes common API-native message properties. For other Graph JSON message properties or extension properties, call `tools.microsoft_graph_sdk.call_method` with `oauth_provider` set to `microsoft_outlook`; the dispatcher does not support MIME requests. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox still needs Exchange Online or Outlook.com.

Reference: [https://learn.microsoft.com/en-us/graph/api/user-post-messages?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/user-post-messages?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="bccRecipients" type="array[object] | null">
  The Bcc recipients for the message, as Graph recipient objects.

  Default: `null`.
</ParamField>

<ParamField path="body" type="object | null">
  The body of the message, as an API-native itemBody object with `contentType` (`Text` or `HTML`) and `content` properties.

  Default: `null`.
</ParamField>

<ParamField path="ccRecipients" type="array[object] | null">
  The Cc recipients for the message, as Graph recipient objects.

  Default: `null`.
</ParamField>

<ParamField path="from" type="object | null">
  The mailbox owner and sender of the message, as a Graph recipient object. It must correspond to the actual mailbox used.

  Default: `null`.
</ParamField>

<ParamField path="importance" type="string | null">
  The importance of the message. The possible values are `Low`, `Normal` and `High`.

  Default: `null`.
</ParamField>

<ParamField path="isDeliveryReceiptRequested" type="boolean | null">
  Indicates whether a delivery receipt is requested for the message.

  Default: `null`.
</ParamField>

<ParamField path="isReadReceiptRequested" type="boolean | null">
  Indicates whether a read receipt is requested for the message.

  Default: `null`.
</ParamField>

<ParamField path="replyTo" type="array[object] | null">
  The email addresses to use when replying, as Graph recipient objects.

  Default: `null`.
</ParamField>

<ParamField path="sender" type="object | null">
  The account actually used to generate the message, as a Graph recipient object. Set it when drafting from a shared mailbox or as a delegate; the value must correspond to the actual mailbox used.

  Default: `null`.
</ParamField>

<ParamField path="subject" type="string | null">
  The subject of the message.

  Default: `null`.
</ParamField>

<ParamField path="toRecipients" type="array[object] | null">
  The To recipients for the message, as Graph recipient objects.

  Default: `null`.
</ParamField>

## Create mail folder

Action ID: `tools.microsoft_outlook.create_mail_folder`

Create a new mail folder in the root folder of the specified user's mailbox. Returns `201 Created` and the mail folder resource. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application. Creating in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/user-post-mailfolders?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/user-post-mailfolders?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="displayName" type="string" required>
  The display name of the new folder.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="isHidden" type="boolean | null">
  Indicates whether the new folder is hidden. The default value is `false`. Setting the property is optional. Once set, you cannot update this property.

  Default: `null`.
</ParamField>

## Create message rule

Action ID: `tools.microsoft_outlook.create_message_rule`

Create a message rule by specifying a set of conditions and actions. Outlook carries out those actions if an incoming message in the user's Inbox meets the specified conditions. Returns `201 Created` and the message rule. Message rules are exposed only through the `messageRules` navigation property of the Inbox folder. Least privileged permission: MailboxSettings.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Available in the global service, US Government L4 and US Government L5 (DOD); not available in China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/mailfolder-post-messagerules?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/mailfolder-post-messagerules?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="payload" type="object" required>
  API-native request body. Commonly used body parameters when creating rules: actions (messageRuleActions; required), conditions (messageRulePredicates; optional), displayName (String; required), exceptions (messageRulePredicates; optional), isEnabled (Boolean; optional) and sequence (Int32; required, the order in which the rule is executed among other rules).
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4) and [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD).

  Default: `null`.
</ParamField>

## Delete mail folder

Action ID: `tools.microsoft_outlook.delete_mail_folder`

Delete the specified mail folder, or delete a search folder. Returns `204 No Content` with no response body. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Deleting in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/mailfolder-delete?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/mailfolder-delete?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="folderId" type="string" required>
  The unique identifier of the mail folder to delete.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

## Delete message

Action ID: `tools.microsoft_outlook.delete_message`

Delete a message in the specified user's mailbox, or delete a relationship of the message. Returns `204 No Content` with no response body. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Deleting in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-delete?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-delete?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

## Delete message rule

Action ID: `tools.microsoft_outlook.delete_message_rule`

Delete the specified message rule from the Inbox of the specified user. Returns `204 No Content` with no response body. Message rules are exposed only through the `messageRules` navigation property of the Inbox folder. Least privileged permission: MailboxSettings.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Available in the global service, US Government L4 and US Government L5 (DOD); not available in China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/messagerule-delete?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/messagerule-delete?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="ruleId" type="string" required>
  The unique identifier of the message rule.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4) and [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD).

  Default: `null`.
</ParamField>

## Forward message

Action ID: `tools.microsoft_outlook.forward_message`

Forward a message to the given recipients. The forwarded message is saved in Sent Items. Returns `202 Accepted` with no response body. Microsoft returns HTTP 400 if neither `toRecipients` nor the message `toRecipients` property is specified. Least privileged permission: Mail.Send for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Forwarding from another user's mailbox with a user token additionally requires Mail.Send.Shared plus the Exchange Send As or Send on Behalf permission on that mailbox, and addressing the mailbox through `/users/&#123;id&#125;` also requires Full Access. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-forward?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-forward?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Sending mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to forward from, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message to forward.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="comment" type="string | null">
  A comment to include. Can be an empty string.

  Default: `null`.
</ParamField>

<ParamField path="message" type="object | null">
  Any writable properties to update in the forwarded message. Specify either `comment` or the message `body` property, not both. Specify either `toRecipients` or the message `toRecipients` property; specifying both or neither returns HTTP 400.

  Default: `null`.
</ParamField>

<ParamField path="toRecipients" type="array[object] | null">
  The list of recipients, as Graph recipient objects.

  Default: `null`.
</ParamField>

## Get mail folder

Action ID: `tools.microsoft_outlook.get_mail_folder`

Get the properties and relationships of a mail folder object. Least privileged permission: Mail.ReadBasic for delegated (work or school account) and delegated (personal Microsoft account), and Mail.ReadBasic.All for application; higher privileged: Mail.ReadWrite or Mail.Read. Reading another user's folder needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/mailfolder-get?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/mailfolder-get?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="folderId" type="string" required>
  The mail folder, as a folder ID or a well-known folder name such as inbox, sentitems, drafts, deleteditems, junkemail, archive or msgfolderroot.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="expand" type="string | null">
  OData `$expand`. Related resources to include in the response.

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return.

  Default: `null`.
</ParamField>

## Get mailbox settings

Action ID: `tools.microsoft_outlook.get_mailbox_settings`

Get the specified user's mailbox settings, including automatic replies, date format, time format, time zone, language, working hours, delegateMeetingMessageDeliveryOptions, archiveFolder and the read-only userPurpose. Least privileged permission: MailboxSettings.Read for delegated (work or school account), delegated (personal Microsoft account) and application; higher privileged: MailboxSettings.ReadWrite. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/user-get-mailboxsettings?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/user-get-mailboxsettings?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return. This method supports some of the OData query parameters.

  Default: `null`.
</ParamField>

## Get message

Action ID: `tools.microsoft_outlook.get_message`

Retrieve the properties and relationships of a message object. Least privileged permission: Mail.ReadBasic, then Mail.Read, for delegated (work or school account) and delegated (personal Microsoft account); Mail.ReadBasic.All, then Mail.Read, for application. An app can get a message in another user's mail folder if it has application permissions, or if it has delegated permissions and that user has shared the mail folder with, or granted delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-get?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-get?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="expand" type="string | null">
  OData `$expand`. Related resources to include in the response.

  Default: `null`.
</ParamField>

<ParamField path="prefer" type="string | null">
  `Prefer` request header. `outlook.body-content-type="text"` or `outlook.body-content-type="html"` sets the format of the returned `body` and `uniqueBody` properties. If omitted, they are returned in HTML format.

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return.

  Default: `null`.
</ParamField>

## Get message attachment

Action ID: `tools.microsoft_outlook.get_message_attachment`

Read the properties, relationships or raw contents of an attachment attached to a message. Required permission for the message resource: Mail.Read for delegated (work or school account), delegated (personal Microsoft account) and application. A `fileAttachment` returns its base64-encoded file contents in `contentBytes`. Reading attachments in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="attachmentId" type="string" required>
  The unique identifier of the attachment.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="expand" type="string | null">
  OData `$expand`. Use it to get the properties of an item attachment (contact, event or message).

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return.

  Default: `null`.
</ParamField>

## Get message rule

Action ID: `tools.microsoft_outlook.get_message_rule`

Get the properties and relationships of a message rule in the Inbox of the specified user. Message rules are exposed only through the `messageRules` navigation property of the Inbox folder. Least privileged permission: MailboxSettings.Read for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Available in the global service, US Government L4 and US Government L5 (DOD); not available in China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/messagerule-get?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/messagerule-get?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="ruleId" type="string" required>
  The unique identifier of the message rule.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4) and [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD).

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return.

  Default: `null`.
</ParamField>

## List child folders

Action ID: `tools.microsoft_outlook.list_child_folders`

Get the folder collection under the specified mail folder. Returns the single Microsoft Graph page, including `@odata.nextLink`. Least privileged permission: Mail.ReadBasic for delegated (work or school account) and delegated (personal Microsoft account), and Mail.ReadBasic.All for application; higher privileged: Mail.ReadWrite or Mail.Read. Reading another user's folders needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/mailfolder-list-childfolders?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/mailfolder-list-childfolders?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="folderId" type="string" required>
  The parent mail folder, as a folder ID or a well-known folder name such as inbox, msgfolderroot or archive.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="filter" type="string | null">
  OData `$filter`. Filter the returned child folders.

  Default: `null`.
</ParamField>

<ParamField path="includeHiddenFolders" type="string | null">
  Endpoint-native query parameter. Specify `true` to return all child folders including those whose `isHidden` property is true.

  Default: `null`.
</ParamField>

<ParamField path="orderby" type="string | null">
  OData `$orderby`. Sort order of the returned child folders.

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return.

  Default: `null`.
</ParamField>

<ParamField path="skip" type="integer | null">
  OData `$skip`. Number of child folders to skip.

  Default: `null`.
</ParamField>

<ParamField path="top" type="integer | null">
  OData `$top`. Number of child folders to return.

  Default: `null`.
</ParamField>

## List folder messages

Action ID: `tools.microsoft_outlook.list_folder_messages`

Get the messages in the specified mail folder of the specified user's mailbox. Returns the single Microsoft Graph page, including `@odata.nextLink`. Least privileged permission: Mail.ReadBasic for delegated (work or school account) and delegated (personal Microsoft account), and Mail.ReadBasic.All for application; higher privileged: Mail.ReadWrite or Mail.Read. Reading another user's mail folder needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/mailfolder-list-messages?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/mailfolder-list-messages?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="folderId" type="string" required>
  The mail folder, as a folder ID or a well-known folder name such as inbox, sentitems, drafts, deleteditems, junkemail or archive.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="expand" type="string | null">
  OData `$expand`. Related resources to include in the response.

  Default: `null`.
</ParamField>

<ParamField path="filter" type="string | null">
  OData `$filter`. Properties in `$orderby` must also appear in `$filter`, in the same order, and before any properties that are not in `$orderby`; otherwise Microsoft Graph returns the `InefficientFilter` error.

  Default: `null`.
</ParamField>

<ParamField path="orderby" type="string | null">
  OData `$orderby`. Sort order of the returned messages.

  Default: `null`.
</ParamField>

<ParamField path="prefer" type="string | null">
  `Prefer` request header. `outlook.body-content-type="text"` or `outlook.body-content-type="html"` sets the format of the returned `body` and `uniqueBody` properties. If omitted, they are returned in HTML format.

  Default: `null`.
</ParamField>

<ParamField path="search" type="string | null">
  OData `$search`. Search the messages in the mail folder.

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return.

  Default: `null`.
</ParamField>

<ParamField path="skip" type="integer | null">
  OData `$skip`. Number of messages to skip.

  Default: `null`.
</ParamField>

<ParamField path="top" type="integer | null">
  OData `$top`. Page size, within the range of 1 and 1000.

  Default: `null`.
</ParamField>

## List mail folders

Action ID: `tools.microsoft_outlook.list_mail_folders`

Get the mail folder collection directly under the root folder of the specified user's mailbox. Returns the single Microsoft Graph page, including `@odata.nextLink`. Least privileged permission: Mail.ReadBasic for delegated (work or school account) and delegated (personal Microsoft account), and Mail.ReadBasic.All for application; higher privileged: Mail.ReadWrite or Mail.Read. Reading another user's folders needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/user-list-mailfolders?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/user-list-mailfolders?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="filter" type="string | null">
  OData `$filter`. Filter the returned mail folders.

  Default: `null`.
</ParamField>

<ParamField path="includeHiddenFolders" type="string | null">
  Endpoint-native query parameter. Specify `true` to return all mail folders including those whose `isHidden` property is true.

  Default: `null`.
</ParamField>

<ParamField path="orderby" type="string | null">
  OData `$orderby`. Sort order of the returned mail folders.

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return.

  Default: `null`.
</ParamField>

<ParamField path="skip" type="integer | null">
  OData `$skip`. Number of mail folders to skip.

  Default: `null`.
</ParamField>

<ParamField path="top" type="integer | null">
  OData `$top`. Number of mail folders to return.

  Default: `null`.
</ParamField>

## List message attachments

Action ID: `tools.microsoft_outlook.list_message_attachments`

Retrieve a list of attachment objects attached to a message. Returns the single Microsoft Graph page, including `@odata.nextLink`. Required permission: Mail.Read for delegated (work or school account), delegated (personal Microsoft account) and application. Listing attachments in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-list-attachments?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-list-attachments?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="expand" type="string | null">
  OData `$expand`. Related resources to include in the response.

  Default: `null`.
</ParamField>

<ParamField path="filter" type="string | null">
  OData `$filter`. Filter the returned attachments.

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return.

  Default: `null`.
</ParamField>

<ParamField path="top" type="integer | null">
  OData `$top`. Number of attachments to return.

  Default: `null`.
</ParamField>

## List message delta

Action ID: `tools.microsoft_outlook.list_message_delta`

List messages added, deleted or updated in a mail folder. Returns one Graph page with `@odata.nextLink` or the terminal `@odata.deltaLink`; pass either opaque URL unchanged to `tools.microsoft_graph_sdk.call_continuation_method` with `oauth_provider` set to `microsoft_outlook`. Do not use `call_paginated_method`, which discards the terminal delta link. Least privileged permission: Mail.ReadBasic for delegated work or school and personal Microsoft accounts, and Mail.ReadBasic.All for application; higher privileged: Mail.Read or Mail.ReadWrite. Tracking another user's folder needs application permissions, or delegated access to a shared or delegated folder. Available in the global service, US Government L4 and US Government L5 (DOD); unavailable in China operated by 21Vianet. No separate licensing requirement is documented; the mailbox needs Exchange Online or Outlook.com.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-delta?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-delta?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4) and [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD).

  Default: `null`.
</ParamField>

<ParamField path="changeType" type="string | null">
  Endpoint-native `changeType` filter. The possible values are `created`, `updated` and `deleted`.

  Default: `null`.
</ParamField>

<ParamField path="expand" type="string | null">
  OData `$expand`. Related resources to include in the response.

  Default: `null`.
</ParamField>

<ParamField path="filter" type="string | null">
  OData `$filter`. Limited support: only `receivedDateTime` comparisons are supported, and it must be specified in the initial request.

  Default: `null`.
</ParamField>

<ParamField path="folderId" type="string">
  The mail folder to track, as a folder ID or a well-known folder name such as inbox, sentitems, drafts, deleteditems, junkemail or archive. Delta change tracking for messages is scoped to one folder.

  Default: `"inbox"`.
</ParamField>

<ParamField path="orderby" type="string | null">
  OData `$orderby`. Limited support: only `receivedDateTime desc` is supported, and it must be specified in the initial request.

  Default: `null`.
</ParamField>

<ParamField path="prefer" type="string | null">
  `Prefer` request header. `odata.maxpagesize=&#123;x&#125;` sets the maximum number of messages Microsoft Graph returns per page.

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return. It must be specified in the initial request.

  Default: `null`.
</ParamField>

<ParamField path="top" type="integer | null">
  OData `$top`. It must be specified in the initial request.

  Default: `null`.
</ParamField>

## List message rules

Action ID: `tools.microsoft_outlook.list_message_rules`

Get all the message rules in the Inbox of the specified user. Returns the single Microsoft Graph page, including `@odata.nextLink`. Message rules are exposed only through the `messageRules` navigation property of the Inbox folder. Least privileged permission: MailboxSettings.Read for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Available in the global service, US Government L4 and US Government L5 (DOD); not available in China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/mailfolder-list-messagerules?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/mailfolder-list-messagerules?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4) and [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD).

  Default: `null`.
</ParamField>

<ParamField path="filter" type="string | null">
  OData `$filter`. Filter the returned message rules.

  Default: `null`.
</ParamField>

<ParamField path="orderby" type="string | null">
  OData `$orderby`. Sort order of the returned message rules.

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return.

  Default: `null`.
</ParamField>

<ParamField path="top" type="integer | null">
  OData `$top`. Number of message rules to return.

  Default: `null`.
</ParamField>

## List messages

Action ID: `tools.microsoft_outlook.list_messages`

Get the messages in the specified user's mailbox, including the Deleted Items and Clutter folders. Returns the single Microsoft Graph page, including `@odata.nextLink`. Least privileged permission: Mail.ReadBasic for delegated (work or school account) and delegated (personal Microsoft account), and Mail.ReadBasic.All for application; higher privileged: Mail.ReadWrite or Mail.Read. An app can read another user's mail folder if it has application permissions, or if it has delegated permissions and that user has shared the mail folder with, or granted delegate access to, the signed-in user. The default page size is 10 messages. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="expand" type="string | null">
  OData `$expand`. Related resources to include in the response.

  Default: `null`.
</ParamField>

<ParamField path="filter" type="string | null">
  OData `$filter`. Properties in `$orderby` must also appear in `$filter`, in the same order, and before any properties that are not in `$orderby`; otherwise Microsoft Graph returns the `InefficientFilter` error.

  Default: `null`.
</ParamField>

<ParamField path="orderby" type="string | null">
  OData `$orderby`. Sort order of the returned messages.

  Default: `null`.
</ParamField>

<ParamField path="prefer" type="string | null">
  `Prefer` request header. `outlook.body-content-type="text"` or `outlook.body-content-type="html"` sets the format of the returned `body` and `uniqueBody` properties. If omitted, they are returned in HTML format.

  Default: `null`.
</ParamField>

<ParamField path="search" type="string | null">
  OData `$search`. Search the messages in the mailbox.

  Default: `null`.
</ParamField>

<ParamField path="select" type="string | null">
  OData `$select`. Comma-separated properties to return. Selecting only the properties you need improves the operation response time.

  Default: `null`.
</ParamField>

<ParamField path="skip" type="integer | null">
  OData `$skip`. Number of messages to skip.

  Default: `null`.
</ParamField>

<ParamField path="top" type="integer | null">
  OData `$top`. Page size, within the range of 1 and 1000. The default is 10. Large pages of full message payloads can trigger the gateway timeout (HTTP 504).

  Default: `null`.
</ParamField>

## Move message

Action ID: `tools.microsoft_outlook.move_message`

Move a message to a folder. This creates a new copy of the message in the destination folder and removes the original, and returns `201 Created` with the new message resource. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Moving in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-move?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-move?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="destinationId" type="string" required>
  The destination folder ID, or a well-known folder name. Well-known names include archive, clutter, conflicts, conversationhistory, deleteditems, drafts, inbox, junkemail, localfailures, msgfolderroot, outbox, recoverableitemsdeletions, scheduled, searchfolders, sentitems, serverfailures and syncissues.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

## Reply all to message

Action ID: `tools.microsoft_outlook.reply_all`

Reply to all recipients of a message. The reply is saved in Sent Items. Returns `202 Accepted` with no response body. Least privileged permission: Mail.Send for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Replying from another user's mailbox with a user token additionally requires Mail.Send.Shared plus the Exchange Send As or Send on Behalf permission on that mailbox, and addressing the mailbox through `/users/&#123;id&#125;` also requires Full Access. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-replyall?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-replyall?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="comment" type="string" required>
  A comment to include. Can be an empty string.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Sending mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to reply from, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message to reply to.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="prefer" type="string | null">
  `Prefer` request header. `outlook.timezone="&lt;time zone>"` sets the time zone for the `Sent` field of the reply message that this API creates in HTML.

  Default: `null`.
</ParamField>

## Reply to message

Action ID: `tools.microsoft_outlook.reply_message`

Reply to the sender of a message. The reply is saved in Sent Items. Returns `202 Accepted` with no response body. Least privileged permission: Mail.Send for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Replying from another user's mailbox with a user token additionally requires Mail.Send.Shared plus the Exchange Send As or Send on Behalf permission on that mailbox, and addressing the mailbox through `/users/&#123;id&#125;` also requires Full Access. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-reply?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-reply?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="comment" type="string" required>
  A comment to include. Can be an empty string.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Sending mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to reply from, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message to reply to.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="prefer" type="string | null">
  `Prefer` request header. `outlook.timezone="&lt;time zone>"` sets the time zone for the `Sent` field of the reply message that this API creates in HTML.

  Default: `null`.
</ParamField>

## Send draft

Action ID: `tools.microsoft_outlook.send_draft`

Send an existing draft message. The draft is saved in Sent Items. Returns `202 Accepted` with no response body. Least privileged permission: Mail.Send for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Sending from another user's mailbox with a user token additionally requires Mail.Send.Shared plus the Exchange Send As or Send on Behalf permission on that mailbox, and addressing the mailbox through `/users/&#123;id&#125;` also requires Full Access. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-send?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-send?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Sending mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to send from, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the draft message to send.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

## Send mail

Action ID: `tools.microsoft_outlook.send_mail`

Send a JSON message from the specified mailbox and save it in Sent Items. Returns `202 Accepted`; acceptance does not mean delivery finished. Least privileged permission: Mail.Send for delegated work or school, delegated personal Microsoft accounts and application; no higher permission is available. Delegated send-from-another-user also requires Mail.Send.Shared and Exchange Send As or Send on Behalf permission; using `/users/&#123;id&#125;` requires Full Access. Application Mail.Send can send as any organization user, so restrict it with RBAC for Applications in Exchange Online. Supply an API-native JSON `message`, which can include attachments. This action and the generic dispatcher do not support Graph's MIME request form. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. No separate licensing requirement is documented; the mailbox needs Exchange Online or Outlook.com.

Reference: [https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Sending mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to send from, because an application token has no signed-in user.
</ParamField>

<ParamField path="message" type="object" required>
  The API-native Microsoft Graph message object to send. Required. Common writable properties include subject (String), body (itemBody), toRecipients, ccRecipients and bccRecipients (recipient collections), replyTo (recipient collection), from and sender (recipient), importance (String), isReadReceiptRequested and isDeliveryReceiptRequested (Boolean), and attachments (attachment collection). For send-from-another-user, set the message `from` property to that mailbox and use the required Exchange delegation described above.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

<ParamField path="saveToSentItems" type="boolean | null">
  Indicates whether to save the message in Sent Items. Specify it only if the parameter is false; the default is true.

  Default: `null`.
</ParamField>

## Update mail folder

Action ID: `tools.microsoft_outlook.update_mail_folder`

Update the writable properties of a mail folder object. `displayName` is the only writable property. Returns `200 OK` and the updated mail folder. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application. Updating in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/mailfolder-update?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/mailfolder-update?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="displayName" type="string" required>
  The mail folder's display name.
</ParamField>

<ParamField path="folderId" type="string" required>
  The mail folder, as a folder ID or a well-known folder name such as inbox, sentitems, drafts, deleteditems, junkemail or archive.
</ParamField>

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

## Update mailbox settings

Action ID: `tools.microsoft_outlook.update_mailbox_settings`

Enable, configure or disable one or more of the specified user's mailbox settings. Returns `200 OK` and the updated properties of the mailboxSettings object. Least privileged permission: MailboxSettings.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/user-update-mailboxsettings?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/user-update-mailboxsettings?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="payload" type="object" required>
  API-native request body. Supply only the values for settings to update. Writable properties for PATCH /users/\{id}/mailboxSettings: automaticRepliesSetting (automaticRepliesSetting; can be set for a future date range only), dateFormat (string), delegateMeetingMessageDeliveryOptions (sendToDelegateAndInformationToPrincipal, sendToDelegateAndPrincipal, sendToDelegateOnly), language (localeInfo), timeFormat (string), timeZone (string) and workingHours (workingHours). `userPurpose` is read-only.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

## Update message

Action ID: `tools.microsoft_outlook.update_message`

Update the properties of a message object. Least privileged permission: Mail.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Updating a message in another user's mailbox needs application permissions, or delegated permissions plus that user sharing the mail folder with, or granting delegate access to, the signed-in user. Available in the global service, US Government L4, US Government L5 (DOD) and China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/message-update?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/message-update?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="messageId" type="string" required>
  The unique identifier of the message.
</ParamField>

<ParamField path="payload" type="object" required>
  API-native request body. Supply only the values for properties to update. Updatable properties for PATCH /users/\{id}/messages/\{messageId}: bccRecipients, body, categories, ccRecipients, flag, from, importance (Low, Normal, High), inferenceClassification (focused, other), internetMessageId, isDeliveryReceiptRequested, isRead, isReadReceiptRequested, multiValueExtendedProperties, replyTo, sender, singleValueExtendedProperties, subject and toRecipients. bccRecipients, body, ccRecipients, internetMessageId, multiValueExtendedProperties, replyTo, singleValueExtendedProperties, subject and toRecipients are updatable only if `isDraft` is true. `sender` is updatable when sending a message from a shared mailbox or as a delegate, and must correspond to the actual mailbox used.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4), [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD) and [https://microsoftgraph.chinacloudapi.cn/v1.0](https://microsoftgraph.chinacloudapi.cn/v1.0) (China operated by 21Vianet).

  Default: `null`.
</ParamField>

## Update message rule

Action ID: `tools.microsoft_outlook.update_message_rule`

Change writable properties on a message rule and save the changes. Returns `200 OK` and the updated message rule. Message rules are exposed only through the `messageRules` navigation property of the Inbox folder. Least privileged permission: MailboxSettings.ReadWrite for delegated (work or school account), delegated (personal Microsoft account) and application; no higher privileged permission is available. Available in the global service, US Government L4 and US Government L5 (DOD); not available in China operated by 21Vianet. Microsoft's endpoint reference does not state a separate licensing requirement; the mailbox itself still needs an Exchange Online or Outlook.com account.

Reference: [https://learn.microsoft.com/en-us/graph/api/messagerule-update?view=graph-rest-1.0](https://learn.microsoft.com/en-us/graph/api/messagerule-update?view=graph-rest-1.0)

### Secrets

Optional secrets:

* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_SERVICE_TOKEN`.
* `microsoft_outlook_oauth`: OAuth token `MICROSOFT_OUTLOOK_USER_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_SERVICE_TOKEN`.
* `microsoft_graph_oauth`: OAuth token `MICROSOFT_GRAPH_USER_TOKEN`.

### Input fields

<ParamField path="mailbox_user_id" type="string" required>
  Target mailbox, given as a user ID or userPrincipalName and used in the `/users/&#123;id | userPrincipalName&#125;` path. Delegated callers may pass their own userPrincipalName; application callers must always name the mailbox to act on, because an application token has no signed-in user.
</ParamField>

<ParamField path="payload" type="object" required>
  API-native request body. Supply only the values for properties to update. Writable properties for PATCH /users/\{id}/mailFolders/inbox/messageRules/\{ruleId}: actions (messageRuleActions), conditions (messageRulePredicates), displayName (String), exceptions (messageRulePredicates), isEnabled (Boolean), isReadOnly (Boolean, indicates if the rule cannot be modified or deleted by the rules REST API) and sequence (Int32).
</ParamField>

<ParamField path="ruleId" type="string" required>
  The unique identifier of the message rule.
</ParamField>

<ParamField path="auth_mode" type="string">
  Credential to use. `application` requires MICROSOFT\_OUTLOOK\_SERVICE\_TOKEN, then MICROSOFT\_GRAPH\_SERVICE\_TOKEN; `delegated` requires MICROSOFT\_OUTLOOK\_USER\_TOKEN, then MICROSOFT\_GRAPH\_USER\_TOKEN; `auto` tries all four in that order.

  Default: `"application"`.

  Allowed values: `application`, `delegated`, `auto`.
</ParamField>

<ParamField path="base_url" type="string | null">
  Microsoft Graph v1.0 API root. If omitted, uses the workspace variable `microsoft_outlook.base_url`, then `microsoft_graph.base_url`, then [https://graph.microsoft.com/v1.0](https://graph.microsoft.com/v1.0). National clouds: [https://graph.microsoft.us/v1.0](https://graph.microsoft.us/v1.0) (US Government L4) and [https://dod-graph.microsoft.us/v1.0](https://dod-graph.microsoft.us/v1.0) (US Government L5 DOD).

  Default: `null`.
</ParamField>
