mailSearchFolder resource type

Namespace: microsoft.graph


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

Search folders created by your application can be deleted by Exchange Online 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.


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


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 is a JSON representation of the resource.

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