---
title: Microsoft Exchange
slug: connectors/microsoft-exchange
docTags: 
createdAt: 2026-06-09T16:30:17.237Z
---

The Microsoft Exchange connector enables streamlined email management and automation directly within the Swimlane Turbine platform, facilitating enhanced security and operational efficiency.

Microsoft Exchange is a widely-used email and calendaring service that enables efficient communication and collaboration within organizations. The Microsoft Exchange Connector for Swimlane Turbine provides a suite of actions to manage email operations, automate incident response, and streamline workflow processes directly within the Swimlane platform. By integrating with Microsoft Exchange, users can perform actions such as deleting emails, exporting email content, retrieving email metadata, and sending emails programmatically, enhancing the capabilities of security automation and improving response times to potential threats.

## Prerequisites

To utilize the Microsoft Exchange connector for Swimlane Turbine, ensure you have the following prerequisites:

- OAuth 2.0 client credentials authentication with these parameters:
  - URL: Endpoint for the Microsoft Exchange server
  - Client ID: Unique identifier for the application registration
  - Client Secret: Secret key generated during application registration
  - Tenant ID: Directory ID of the Azure AD tenant
  - SMTP Mailbox Address: Email address associated with the mailbox
- HTTP Basic (NTLM) Authentication with these parameters:
  - Server URL: Endpoint for the Microsoft Exchange server
  - Username Identifier: User account name for server access
  - Password: Corresponding password for the user account
  - SMTP Mailbox Address: Email address associated with the mailbox

## NTLM Authentication

NTLM authentication is only available for Exchange on-premises servers.

### Graph Confidential Client

This authentication method allows you to authenticate using an Azure application.

Recommended Application Permissions:

- **EWS\_AccessAsUser.All** (Delegated)
- **full\_access\_as\_app** (Application, Grand admin consent for organization)

In order to set up the asset, you need the following:

- Azure Application Client ID
- Azure Application Client Secret
- Azure Tenant ID

Steps to create the Azure app:

1. Go to the [App Registration page](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade)
   in the Azure portal.
2. Click `New Registration`.
3. Enter a name for your new application and choose `Accounts in this organizational directory only`,
   then click `Register` at the bottom.
4. Navigate to the `API permissions` tab on the left navigation menu.
5. Select `Add a permission`.
6. Select the `APIs my organization uses` tab and search for "Office 365 Exchange Online".
7. Select `Application permissions` and check the box next to `full_access_as_app`.
8. Select `Delegated permissions` and check the `EWS.AccessAsUser.All` box.
9. Click the `Add permissions` button at the bottom of the page.
10. Select `Grant admin consent` for your organization, then your permissions should look as below.
11. Navigate to the `Certificates & secrets` tab and select `New client secret`.
12. Fill out the description and expiration, then click the `Add` button at the bottom.
13. The `Value` of the secret you just created is the `Client Secret` needed for the Swimlane asset.
14. Navigate to the `Overview` tab on the left menu.
15. The `Client ID` and `Tenant ID` needed in the asset are shown on this page.

The `Client ID`, `Tenant ID`, and `Client Secret` described in the steps above are the credentials you
need for the asset.

## Email Account Permission Setup

Microsoft Exchange uses [RBAC Permissions](https://docs.microsoft.com/en-us/exchange/understanding-role-based-access-control-exchange-2013-help) (Role-Based Access Control).
Your account must be configured with the correct permissions for tasks to run correctly.
Required permissions:

- [DiscoveryManagement](https://docs.microsoft.com/en-us/Exchange/policy-and-compliance/ediscovery/assign-permissions?view=exchserver-2019)
- [Impersonation](https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-configure-impersonation)

For Exchange Online users, you can either use [Exchange Online Admin Center](https://docs.microsoft.com/en-us/exchange/exchange-admin-center)
for editing permissions or [Windows Powershell connection](https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps).

All other users must use the [Windows Powershell connection](https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps).

**Note:** These permissions are only required for the `Delete from All Mailboxes` task. You can still use the connector even if they are not configured.

**Note:** After setting permissions, it may take a couple of hours for the permissions to propagate within Exchange.

### Setting Up Permissions Using Exchange Online Admin Center

1. Follow the instructions [here](https://docs.microsoft.com/en-us/exchange/exchange-admin-center) to get to the Exchange Admin Center.
2. Click *permissions*.
3. Under *Admin Roles*, select *Discovery Management* and click the *pencil icon* to edit.
4. A dialogue box will appear. In the dialogue box, under Members, click the *plus icon* to add a member.
5. Search for and add the user, then click *Ok*.
6. Click *Save*.
7. Under *Admin Roles*, search for a role called ApplicationImpersonation. If this role does not exist, you must use Powershell to configure the Impersonation permission, which is detailed in the section below.
8. Click the *pencil icon* for ApplicationImpersonation and follow steps 4-6.

### Setting Up Permissions Using Powershell

1. On a Microsoft Windows computer, open an Administrator Command Prompt.
   **Note:** To open a program as an administrator, right-click and select `Run as Administrator` and then run `winrm get winrm/config/client/auth`.
2. If you do not see the line `Basic=True` in the output of the command, run the following command to enable Basic Authentication for WinRM:
   `winrm set winrm/config/client/auth @{Basic="true"}`
3. Open Powershell as an administrator, either by searching for it in the Windows menu or running `powershell.exe` in an administrator command prompt.
   A list of supported Windows versions can be found [here.](https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps)
4. In Powershell, enable Exchange's Powershell scripts to configure your local Powershell and run the command `Set-ExecutionPolicy RemoteSigned`. If prompted, enter 'Y'.
5. Now run `$UserCredential = Get-Credential`. Windows will ask you for a username and password. Enter your Exchange username and password. Your username will be your full email address.
6. Run `$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection` to connect to Exchange Online's Powershell session. If your Exchange server is in a country other than the US,
   see the list of URLs under [Connect to Exchange](https://docs.microsoft.com/en-us/powershell/exchange/exchange-online/connect-to-exchange-online-powershell/connect-to-exchange-online-powershell?view=exchange-ps#connect-to-exchange-online) and replace the URL in your command. This link also contains information on proxy settings.
7. If you run into a permission error, check your username and password and go back to step 5.
8. Import the remote session into your local shell using `Import-PSSession $Session -DisableNameChecking`.
9. Now that Powershell is connected and authenticated, you can modify user and group permissions. You will be modifying only one user in these steps. To see how to modify multiple users or groups, see this [link.](https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-configure-impersonation)

### Impersonation Permissions

1. Run the following command to create a new management scope, replacing `MYCUSTOMSCOPENAME` with a scope name such as `SwimlaneImpersonationScope`. Also, replace `FILTERCHANGEME` with a filter to select the user you'd like to grant the permissions.
   `New-ManagementScope -Name:MYCUSTOMSCOPENAME -RecipientRestrictionFilter:FILTERCHANGEME`
   For example, to create a new management scope called `SwimlaneScope` for the user `john` your command would look like this:
   `New-ManagementScope -Name:SwimlaneScope -RecipientRestrictionFilter:"Name -eq 'john'"`
2. If the command completes successfully, you will see a printout description of your new Management Scope in table-like form.
3. Now to apply the *ApplicationImpersonation* role to the user, run
   the following command, replacing `CUSTOMNAME` with a name for the Management Role, such as `SwimlaneMgmtRole`. Also, replace `MYACCOUNTHERE` with the name of your account, e.g. `john`.
   Replace `SCOPENAMEFROMABOVE` with the name of the Management Scope you created in step 10.

`New-ManagementRoleAssignment -Name:CUSTOMNAME -Role:ApplicationImpersonation -User:MYACCOUNTHERE -CustomRecipientWriteScope:SCOPENAMEFROMABOVE`

For example, to create a new role assignment for the Management Scope `SwimlaneScope` for the user `integrations` called `SwimlaneMgmtRole` with the role `ApplicationImpersonation` you would run
`New-ManagementRoleAssignment -Name:SwimlaneMgmtRole -Role:ApplicationImpersonation -User:integrations -CustomRecipientWriteScope:SwimlaneScope`.

4. To add Discovery Management Permissions using Powershell, skip step 5 and proceed to the section below.
5. To stop editing permissions, run the command `Remove-PSSession $Session`. Otherwise, you may run out of allowed sessions to Exchange and will have to wait until they expire.

### Discovery Management Permissions

Original Instructions [here.](https://docs.microsoft.com/en-us/exchange/security-and-compliance/in-place-ediscovery/assign-ediscovery-permissions)

1. Run the command `Add-RoleGroupMember -Identity "Discovery Management" -Member MYUSERNAME` and replace `MYUSERNAME` with the username who you want to grant permissions to.
   For example, to grant this permission to a user called `integrations` run:
   `Add-RoleGroupMember -Identity "Discovery Management" -Member integrations`
2. To add Impersonation Permissions using Powershell, skip step 3 and proceed to the section above.
3. To stop editing permissions, run the command `Remove-PSSession $Session`. Otherwise, you may run out of allowed sessions to Exchange and have to wait until they expire.

## Capabilities

The Microsoft Exchange connector has the following capabilities:

- Get Email Metadata
- Delete from All Mailboxes
- Set Email Category
- Move Email to Folder
- Reply to Email with Template
- Send an Email

### Limitations

### Known Errors

- `Error AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access`
  - See the *Graph Public Client* section for instructions on how to resolve this error.
- `ExchangeImpersonation SOAP header must be present for this type of OAuth token.`
  - See the *Graph Confidential Client* section for instructions on how to resolve this error.

### Input details

### Folder Name

Here is an example of how you can use the `Folder Name` input. In this example, you have an Exchange mailbox like this:

```javascript
├── Inbox
│       └── InboxSubFolder
└── CustomFolder
           └── SubCustomFolder
```

If you want to retrieve mail from `InboxSubFolder`, make sure that `Folder Name` is `Inbox/InboxSubFolder`.

To retrieve mail from `CustomFolder`, change `Folder Name` to `CustomFolder`.

To retrieve mail from `SubCustomFolder`, rename `Folder Name` to `CustomFolder/SubCustomFolder`.

**Note:**  This task does not support folders with '/' in their name.

### JSON Querystrings

`Search Query String` is a legacy input, `JSON Query String` should be used for any new searches.
Searching is modeled after the Django QuerySet API, and a large part of the API is supported.
The query is a JSON string where each key\:value pair represents an expression in the query.
Each expression in the query string takes the form:

`"{field}__{operation}": {value}` (That’s a double-underscore)

If you are matching a field to an exact value, you can use the form: `"{field}": {value}`

- **field**: The message field you are querying on, see the *fields* section below for more details.
- **operation**: The operation to use for the expression, see the *operations* section below for more details.
- **value**: The desired value to compare to using the operation.

### Fields

The `Instance variables` in these two links are all the fields you can search/sort on:

- [General Fields](https://ecederstrand.github.io/exchangelib/exchangelib/items/item.html#exchangelib.items.item.Item)
- [Email Specific Fields](https://ecederstrand.github.io/exchangelib/exchangelib/items/message.html#exchangelib.items.message.Message)

Non-basic fields are not able to be used in the query (such as attachments, headers, effectiverights, etc..)

### Operations

The query string is based on the Django QuerySet API. In the QuerySet API, operations are called "lookups".
Documentation for all the lookup options can be found [here](https://docs.djangoproject.com/en/dev/ref/models/querysets/#field-lookups)
(Some lookups may not be supported by exchange).
Below is a list of common operations you might use:

```javascript
range
in
not
gt
gte
lt
lte
exact
iexact
contains
icontains
startswith
istartswith
exists
```

Operations starting with 'i' such as `icontains` and `iexact` are case-insensitive

### Example JSON Querystrings

Query all emails from '[email@gmail.com](mailto\:email@gmail.com)\` with a subject containing 'test'.

```javascript
{
    "subject__icontains": "test",
    "sender": "email@gmail.com"
}
```

Query all emails from '[email@gmail.com](mailto\:email@gmail.com)' with subject matching exactly 'test', that are unread

```javascript
{
    "subject": "test",
    "sender": "email@gmail.com",
    "is_read": false
}
```

So for example, to query for an email between 15:05 3/2/2020 and 15:11 3/2/2020 MST,
when your Swimlane instance is also MST:

```javascript
{
    "datetime_received__gte": "2020-03-02T15:05:33",
    "datetime_received__lte": "2020-03-02T15:11:33"
}
```

But if your Swimlane instance is UTC time, you will need to modify the query by 7 hours:

```javascript
{
    "datetime_received__gte": "2020-03-02T22:05:33",
    "datetime_received__lte": "2020-03-02T22:11:33"
}
```

To use a timevalue that is 5 minutes before the current time, use the following format

```javascript
{
    "datetime_received__gte": "-5 minutes"
}
```

### Move Email to Folder

If you move an email, it will change that email's Message ID. Use the output `New Exchange Email ID` for the changed ID.

### Retrieve Deleted Email

If you retrieve a deleted email, it will change that email's Message ID. Use the output `New Exchange Email ID` for the changed ID.

### Notes

For more details on NTLM Authentication, please refer to [NTLM Authentication](https://github.com/ecederstrand/exchangelib/blob/7bf720d439bebf65f5e9f2ff2900b5fa9aa6c400/exchangelib/credentials.py)

## Additional Documentation

- [Microsoft Exchange Connector Documentation](https://docs.swimlane.com/connectors/microsoft-exchange)
- [Microsoft Exchange API Documentation](https://github.com/ecederstrand/exchangelib/blob/7bf720d439bebf65f5e9f2ff2900b5fa9aa6c400/exchangelib/credentials.py)
- [Microsoft Exchange Authentication Guide](https://docs.swimlane.com/authentication-guides/microsoft-exchange)

# Configurations

## Microsoft Exchange NTLM Authentication

Authenticates Microsoft Exchange using NTLM Authentication

### Configuration Parameters

| **Parameter**            | **Description**                                                                   | **Type** | **Required** |
| ------------------------ | --------------------------------------------------------------------------------- | -------- | ------------ |
| url                      | A URL to the target host.                                                         | string   | Required     |
| username                 | Email Address or Username                                                         | string   | Required     |
| password                 | Password                                                                          | string   | Required     |
| verify\_ssl              | Verify SSL certificate                                                            | boolean  | Optional     |
| http\_proxy              | A proxy to route requests through.                                                | string   | Optional     |
| username\_mailbox        | Mailbox email address                                                             | string   | Required     |
| use\_impersonate\_access | Use Impersonation rights to retrieve mail. If False will use Delegate permissions | boolean  | Optional     |
| use\_ntlm                | Use NTLM for authentication. otherwise, no authentication type will be applied.   | boolean  | Optional     |

## Oauth 2.0 Client Credentials

Authenticates using oauth 2.0 client credentials

### Configuration Parameters

| **Parameter**     | **Description**                                                                   | **Type** | **Required** |
| ----------------- | --------------------------------------------------------------------------------- | -------- | ------------ |
| url               | A URL to the target host.                                                         | string   | Required     |
| tenant\_id        |                                                                                   | string   | Required     |
| client\_id        | The client ID                                                                     | string   | Required     |
| client\_secret    | The client secret.                                                                | string   | Required     |
| scope             | Permission scopes for this action.                                                | array    | Optional     |
| verify\_ssl       | Verify SSL certificate                                                            | boolean  | Optional     |
| http\_proxy       | A proxy to route requests through.                                                | string   | Optional     |
| username\_mailbox | Mailbox email address                                                             | string   | Required     |
| full\_name        | User's full name                                                                  | string   | Optional     |
| use\_impersonate  | Use Impersonation rights to retrieve mail. If False will use Delegate permissions | boolean  | Optional     |

# Actions

## Delete Emails

Permanently deletes emails across all inboxes based on specified criteria, with options for dry run and exception handling.

### Input

| **Argument Name**          | **Type** | **Required** | **Description**             |
| -------------------------- | -------- | ------------ | --------------------------- |
| `assigner`                 | string   | Optional     | Parameter for Delete Emails |
| `delete_type`              | string   | Required     | Type of the resource        |
| `delimiter`                | string   | Optional     | Parameter for Delete Emails |
| `dry_run`                  | boolean  | Required     | Parameter for Delete Emails |
| `folder`                   | string   | Optional     | Parameter for Delete Emails |
| `ignore_exceptions`        | boolean  | Required     | Parameter for Delete Emails |
| `json_querystring`         | object   | Optional     | Parameter for Delete Emails |
| `json_querystring.subject` | string   | Optional     | Parameter for Delete Emails |
| `json_querystring.is_read` | boolean  | Optional     | Parameter for Delete Emails |
| `limit`                    | number   | Optional     | Parameter for Delete Emails |
| `mailbox_to_use`           | string   | Optional     | Parameter for Delete Emails |
| `querystring`              | string   | Optional     | Parameter for Delete Emails |
| `worker_count`             | number   | Optional     | Count value                 |

### Input Example

`{"assigner":"=","delete_type":"trash","delimiter":",","dry_run":true,"folder":"Inbox","ignore_exceptions":true,"json_querystring":{"subject":"asdf","is_read":false},"limit":5,"querystring":"subject=asdf,is_read=False","worker_count":4}`

### Output

| **Parameter**         | **Type** | **Description**                      |
| --------------------- | -------- | ------------------------------------ |
| `failed`              | string   | Output field: failed                 |
| `not_found`           | string   | Output field: not\_found             |
| `recipients_affected` | array    | Output field: recipients\_affected   |
| `success`             | string   | Whether the operation was successful |
| `wont_process`        | string   | Output field: wont\_process          |

### Output Example

`{"failed":"failed","not_found":"not_found","recipients_affected":["user1@example.com","user2@example.com"],"success":"success","wont_process":"wont_process"}`

## Export Email as EML

Retrieve and download the raw MIME content of an email from Microsoft Exchange as an .eml file, including body and attachments.

### Input

| **Argument Name** | **Type** | **Required** | **Description**                                                                                                   |
| ----------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------- |
| `folder_name`     | string   | Optional     | The folder where the email is located (e.g., "inbox", "sent", "My Folder"). Defaults to "inbox" if not specified. |
| `mailbox_to_use`  | string   | Optional     | The email address of the mailbox to query. If not specified, uses the default mailbox from the connection.        |
| `message_id`      | string   | Required     | Message ID of the email to export.                                                                                |
| `file_name`       | string   | Optional     | Name of the file to export.                                                                                       |

### Input Example

`{"folder_name":"inbox","message_id":"AAMkAGI2T...AAA=","file_name":"email.eml"}`

### Output

| **Parameter**    | **Type** | **Description**                      |
| ---------------- | -------- | ------------------------------------ |
| `success`        | boolean  | Whether the operation was successful |
| `file`           | object   | Output field: file                   |
| `file.filename`  | string   | Name of the resource                 |
| `file.file_data` | string   | Response data                        |

### Output Example

`{"success":true,"file":{"filename":"email.eml","file_data":"data:application/octet-stream;base64,..."}}`

## Get Email Metadata

Retrieve metadata for unread emails from a Microsoft Exchange account, including sender, subject, and timestamps.

### Input

| **Argument Name**    | **Type** | **Required** | **Description**                  |
| -------------------- | -------- | ------------ | -------------------------------- |
| `assigner`           | string   | Optional     | Parameter for Get Email Metadata |
| `delimiter`          | string   | Optional     | Parameter for Get Email Metadata |
| `exclude_extensions` | array    | Optional     | Parameter for Get Email Metadata |
| `folder_name`        | string   | Optional     | Name of the resource             |
| `ignore_errors`      | boolean  | Optional     | Error message if any             |
| `include_extensions` | array    | Optional     | Parameter for Get Email Metadata |
| `ingest_unread_only` | boolean  | Optional     | Parameter for Get Email Metadata |
| `json_querystring`   | string   | Optional     | Parameter for Get Email Metadata |
| `mailbox_to_query`   | string   | Optional     | Parameter for Get Email Metadata |
| `number_of_emails`   | number   | Optional     | Parameter for Get Email Metadata |
| `order_by`           | string   | Optional     | Parameter for Get Email Metadata |
| `querystring`        | string   | Optional     | Parameter for Get Email Metadata |
| `save_mail_as`       | boolean  | Optional     | Parameter for Get Email Metadata |
| `sender`             | string   | Optional     | Parameter for Get Email Metadata |
| `subject`            | string   | Optional     | Parameter for Get Email Metadata |

### Input Example

`{"assigner":"=","delimiter":",","exclude_extensions":[".png",".jpg",".jpeg",".gif"],"folder_name":"My Folder","ignore_errors":false,"include_extensions":[".png",".jpg",".jpeg",".gif"],"ingest_unread_only":false,"json_querystring":"asdf","number_of_emails":4,"order_by":"-datetime_received","querystring":"subject=asdf,is_read=False","save_mail_as":true,"sender":"mike@school.edu","subject":"invoice"}`

### Output

| **Parameter**           | **Type** | **Description**                   |
| ----------------------- | -------- | --------------------------------- |
| `attach_info`           | object   | Output field: attach\_info        |
| `attachments`           | array    | Output field: attachments         |
| `attachments.file_name` | string   | Name of the resource              |
| `attachments.file`      | string   | Output field: attachments.file    |
| `attachments_md5`       | string   | Output field: attachments\_md5    |
| `attachments_sha1`      | string   | Output field: attachments\_sha1   |
| `attachments_sha256`    | string   | Output field: attachments\_sha256 |
| `bcc`                   | string   | Output field: bcc                 |
| `cc`                    | string   | Output field: cc                  |
| `date`                  | string   | Date value                        |
| `error`                 | string   | Error message if any              |
| `exchange_message_id`   | string   | Unique identifier                 |
| `headers`               | string   | HTTP headers for the request      |
| `headers_json`          | string   | HTTP headers for the request      |
| `html_body`             | string   | Request body data                 |
| `id`                    | string   | Unique identifier                 |
| `orig_filename`         | string   | Name of the resource              |
| `raw_content`           | string   | Response content                  |
| `raw_headers`           | string   | HTTP headers for the request      |
| `recipients`            | string   | Output field: recipients          |
| `reply_to`              | string   | Output field: reply\_to           |
| `result`                | string   | Result of the operation           |
| `rtf_body`              | string   | Request body data                 |
| `sender`                | string   | Output field: sender              |
| `subject`               | string   | Output field: subject             |

### Output Example

`{"attach_info":{},"attachments":[],"attachments_md5":"string","attachments_sha1":"string","attachments_sha256":"string","bcc":"string","cc":"string","date":"string","error":"string","exchange_message_id":"string","headers":"string","headers_json":"string","html_body":"string","id":"string","orig_filename":"string"}`

## Move Email to Folder

Moves a specified email to a designated folder in Microsoft Exchange using the message ID and folder name.

### Input

| **Argument Name** | **Type** | **Required** | **Description**                    |
| ----------------- | -------- | ------------ | ---------------------------------- |
| `folder`          | string   | Required     | Parameter for Move Email to Folder |
| `mailbox_to_use`  | string   | Optional     | Parameter for Move Email to Folder |
| `message_id`      | string   | Required     | Unique identifier                  |

### Input Example

`{"folder":"My Folder"}`

### Output

| **Parameter**    | **Type** | **Description**                      |
| ---------------- | -------- | ------------------------------------ |
| `date_moved`     | string   | Output field: date\_moved            |
| `new_message_id` | string   | Unique identifier                    |
| `success`        | string   | Whether the operation was successful |

### Output Example

`{"date_moved":"string","new_message_id":"string","success":"string"}`

## Reply or Forward Mail

Reply to or forward an email in Microsoft Exchange with a specific template and message ID, with the option to directly reply.

### Input

| **Argument Name** | **Type** | **Required** | **Description**                     |
| ----------------- | -------- | ------------ | ----------------------------------- |
| `files`           | array    | Optional     | Parameter for Reply or Forward Mail |
| `files.file_name` | string   | Required     | Name of the resource                |
| `files.file`      | string   | Required     | Parameter for Reply or Forward Mail |
| `bcc_recipients`  | array    | Optional     | Parameter for Reply or Forward Mail |
| `cc_recipients`   | array    | Optional     | Parameter for Reply or Forward Mail |
| `include_senders` | boolean  | Optional     | Parameter for Reply or Forward Mail |
| `mailbox_to_use`  | string   | Optional     | Parameter for Reply or Forward Mail |
| `message_id`      | string   | Required     | Unique identifier                   |
| `subject`         | string   | Optional     | Parameter for Reply or Forward Mail |
| `template`        | string   | Required     | Parameter for Reply or Forward Mail |
| `to_recipients`   | array    | Optional     | Parameter for Reply or Forward Mail |
| `use_html`        | boolean  | Optional     | Parameter for Reply or Forward Mail |
| `use_reply`       | boolean  | Required     | Parameter for Reply or Forward Mail |

### Input Example

`{"include_senders":true,"message_id":"ANQWdKUqanABH47Gj6QKkavSZaDAXfYFNfoKpLyXPJ=K=mX58Q","subject":"This is the subject of my email","template":"Do not respond to this email.","use_html":true,"use_reply":true}`

### Output

| **Parameter**   | **Type** | **Description**              |
| --------------- | -------- | ---------------------------- |
| `sent_response` | string   | Output field: sent\_response |
| `time_sent`     | string   | Output field: time\_sent     |

### Output Example

`{"sent_response":"string","time_sent":"string"}`

## Restore Deleted Email

Restores a deleted email to a specified folder in Microsoft Exchange using the message ID provided.

### Input

| **Argument Name**         | **Type** | **Required** | **Description**                     |
| ------------------------- | -------- | ------------ | ----------------------------------- |
| `folder_to_restore_email` | string   | Required     | Parameter for Restore Deleted Email |
| `mailbox_to_use`          | string   | Optional     | Parameter for Restore Deleted Email |
| `message_id`              | string   | Required     | Unique identifier                   |

### Input Example

`{"message_id":"AAMkAD...HAAA="}`

### Output

| **Parameter**    | **Type** | **Description**                      |
| ---------------- | -------- | ------------------------------------ |
| `date_moved`     | string   | Output field: date\_moved            |
| `new_message_id` | string   | Unique identifier                    |
| `success`        | string   | Whether the operation was successful |

### Output Example

`{"date_moved":"string","new_message_id":"string","success":"string"}`

## Send An Email

Send an email through Microsoft Exchange using specified recipients and a chosen template.

### Input

| **Argument Name**       | **Type** | **Required** | **Description**             |
| ----------------------- | -------- | ------------ | --------------------------- |
| `attachments`           | array    | Optional     | Parameter for Send An Email |
| `attachments.file_name` | string   | Required     | Name of the resource        |
| `attachments.file`      | string   | Required     | Parameter for Send An Email |
| `bcc_recipients`        | array    | Optional     | Parameter for Send An Email |
| `ccs`                   | array    | Optional     | Parameter for Send An Email |
| `mailbox_to_use`        | string   | Optional     | Parameter for Send An Email |
| `recipients`            | array    | Required     | Parameter for Send An Email |
| `subject`               | string   | Optional     | Parameter for Send An Email |
| `template`              | string   | Required     | Parameter for Send An Email |
| `use_html`              | boolean  | Optional     | Parameter for Send An Email |
| `use_impersonate`       | boolean  | Optional     | Parameter for Send An Email |

### Input Example

`{"subject":"This is the subject of my email","template":"Do not respond to this email.","use_html":true,"use_impersonate":false}`

### Output

| **Parameter** | **Type** | **Description**           |
| ------------- | -------- | ------------------------- |
| `sent_email`  | boolean  | Output field: sent\_email |
| `time_sent`   | string   | Output field: time\_sent  |

### Output Example

`{"sent_email":true,"time_sent":"2025-01-09T07:50:21.485049+00:00"}`

## Set Email Category

Assign a specified category to an email in Microsoft Exchange using the message ID and category name.

### Input

| **Argument Name** | **Type** | **Required** | **Description**                  |
| ----------------- | -------- | ------------ | -------------------------------- |
| `category`        | array    | Required     | Parameter for Set Email Category |
| `clear`           | boolean  | Optional     | Parameter for Set Email Category |
| `message_id`      | string   | Required     | Unique identifier                |
| `override`        | boolean  | Optional     | Unique identifier                |

### Input Example

`{"category":["MyCategory"],"clear":true,"message_id":"AAMkADMxZmU3ZWQ4LTMzNGItNGY3ZC1iM2UxLWM3MDQzOGVjMzlkNwBGAAAAAAAGYPwuVwMWSrFeyLv6XHMzBwCBJRT7/oiDTLpLg45RvPkCAAAAAAEMAACBJRT9/oiDTLpLg45RvPkCAAAf+jMxAAA=","override":false}`

### Output

| **Parameter** | **Type** | **Description**                      |
| ------------- | -------- | ------------------------------------ |
| `date_added`  | string   | Output field: date\_added            |
| `success`     | string   | Whether the operation was successful |

### Output Example

`{"date_added":"string","success":"string"}`

# Response Headers

| **Header**   | **Description**                                       | **Example**                   |
| ------------ | ----------------------------------------------------- | ----------------------------- |
| Content-Type | The media type of the resource                        | application/json              |
| Date         | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |
