Microsoft Outlook integration
Search, move, and draft messages, and manage mail folders and rules.
How it works
Each Microsoft Outlook action is a YAML template or Python function in Tracecat's open-source registry, under tools.microsoft_outlook. Add an action as a step in a workflow, or give it to an agent as a tool.
Credentials
Add these in Tracecat before running the actions. How credentials work
- OAuth connection
microsoft_graph_oauth(optional) - OAuth connection
microsoft_outlook_oauth(optional)
Actions
Missing an integration? Write your own actions in YAML or Python in a custom registry and sync them from your Git repository.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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/{id}` 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Reply all to message
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/{id}` 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.
Reply to 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/{id}` 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.
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/{id}` 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.
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/{id}` 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.
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.
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.
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.
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.