mailSearchFolder resource type

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

A mailSearchFolder is a virtual folder in the user's mailbox that contains all the email items matching specified search criteria. mailSearchFolder inherits from mailFolder. Search folders can be created in any folder in a user's Exchange Online mailbox. However, for a search folder to appear in Outlook, Outlook for the web, or Outlook Live, the folder must be created in the WellKnownFolderName.SearchFolders folder.

Search folder lifecycle

Exchange Online can delete search folders created by your application for one of the following reasons:

  1. Search folders expire after 45 days of no usage.
  2. There are limits on the number of search folders that can be created per source folder. When this limit is breached, older search folders are deleted to make way for new ones.

When a search folder is deleted, your app should create a new search folder resource and use the same.

Methods

Method Return Type Description
Create mailSearchFolder Create a search folder in this user's mailbox.
Get mailSearchFolder Get the specified search folder.
Update mailSearchFolder Update the specified search folder.
Delete None Delete the specified search folder.
Permanently delete None Permanently delete a mail search folder and remove its items from the user's mailbox.
List child folders mailFolder collection List all the folders in this user's mailbox, including search folders.
List messages in folder message collection List all the messages in the specified search folder.

Properties

Property Type Description
isSupported Boolean Indicates whether a search folder is editable using REST APIs.
includeNestedFolders Boolean Indicates how the mailbox folder hierarchy should be traversed in the search. true means that a deep search should be done to include child folders in the hierarchy of each folder explicitly specified in sourceFolderIds. false means a shallow search of only each of the folders explicitly specified in sourceFolderIds.
sourceFolderIds String collection The mailbox folders that should be mined.
filterQuery String The OData query to filter the messages.

JSON representation

The following JSON representation shows the resource type.

{
  "isSupported": true,
  "includeNestedFolders": true,
  "sourceFolderIds": ["string"],
  "filterQuery": "string"
}