mailFolder resource type

A mailFolder in a user's mailbox, such as Inbox, Drafts, and Sent Items. MailFolders can contain messages and child mailFolders.

Methods

Method Return Type Description
Get mailFolder mailFolder Read properties and relationships of mailFolder object.
Create MailFolder MailFolder Create a new mailFolder under the current one by posting to the childFolders collection.
List childFolders MailFolder collection Get the folder collection under the specified folder. You can use the .../me/MailFolders shortcut to get the top-level folder collection and navigate to another folder.
Create Message Message Create a new message in the current mailFolder by posting to the messages collection.
List messages Message collection Get all the messages in the signed-in user's mailbox, or those messages in a specified folder in the mailbox.
Update mailFolder Update the specified mailFolder object.
Delete None Delete the specified mailFolder object.
copy MailFolder Copy a mailFolder and its contents to another mailFolder.
move MailFolder Move a mailFolder and its contents to another mailFolder.
Create single-value extended property mailFolder Create one or more single-value extended properties in a new or existing mailFolder.
Get mailFolder with single-value extended property mailFolder Get mailFolders that contain a single-value extended property by using $expand or $filter.
Create multi-value extended property mailFolder Create one or more multi-value extended properties in a new or existing mailFolder.
Get mailFolder with multi-value extended property mailFolder Get a mailFolder that contains a multi-value extended property by using $expand.

Properties

Property Type Description
childFolderCount Int32 The number of immediate child mailFolders in the current mailFolder.
displayName String The mailFolder's display name.
id String The mailFolder's unique identifier. You can use the following well-known names to access the corresponding folder: Inbox, Drafts, SentItems, DeletedItems.
parentFolderId String The unique identifier for the mailFolder's parent mailFolder.
totalItemCount Int32 The number of items in the mailFolder.
unreadItemCount Int32 The number of items in the mailFolder marked as unread.

Access item counts efficiently

The TotalItemCount and UnreadItemCount properties of a folder allow you to conveniently compute the number of read items in the folder. They let you avoid queries like the following that can incur significant latency:

https://outlook.office.com/api/v1.0/me/folders/inbox/messages?$count=true&$filter=isread%20eq%20false

MailFolders in Outlook can contain more than one type of items, for example, the Inbox can contain meeting request items which are distinct from mail items. TotalItemCount and UnreadItemCount include items in a mailFolder irrespective of their item types.

Relationships

Relationship Type Description
childFolders MailFolder collection The collection of child folders in the mailFolder.
messages Message collection The collection of messages in the mailFolder.
multiValueExtendedProperties multiValueLegacyExtendedProperty collection The collection of multi-value extended properties defined for the mailFolder. Read-only. Nullable.
singleValueExtendedProperties singleValueLegacyExtendedProperty collection The collection of single-value extended properties defined for the mailFolder. Read-only. Nullable.

JSON representation

Here is a JSON representation of the resource

{
  "childFolderCount": 1024,
  "displayName": "string",
  "id": "string (identifier)",
  "parentFolderId": "string",
  "totalItemCount": 1024,
  "unreadItemCount": 1024
}