Outlook Mail REST API reference

Applies to: Exchange Online | Office 365

The Outlook Mail API lets you read, create, and send messages and attachments, view and respond to event messages, and manage folders in a user's mailbox in Office 365 or Exchange Online.

The API relies on Microsoft Azure Active Directory and OAuth to authenticate application requests. You can access the Mail API by calling the corresponding REST APIs directly in your apps, or by using the Office 365 client libraries and SDKs.

To access the Mail REST API from your application, you'll need to explicitly register it in Azure AD with permissions at the appropriate scope. You also need to manage authentication tokens, and construct the correct URL and queries for your needs.

As an alternative, the Office 365 client libraries and SDKs make it easier to interact with the Mail API: .NET, JavaScript, Android, and iOS. They help manage authentication tokens, simplify the code needed to query and consume data, and perform discovery. To learn more, see Office 365 APIs platform overview.

Note If you develop apps for Office 365 in China, see API endpoints of Office 365 for China for the specification of the required URLs.

All Mail API operations

Message operations Messages are stored in mailbox folders, so message endpoints often include the folder that contains the message. A folder is either specified by ID or by one of the following well-known folder names: Inbox, Drafts, SentItems, or DeletedItems.

Get messages | Create and send messages | Reply or reply all to messages | Forward new or drafted messages | Update messages

Delete messages | Move or copy messages | Get attachments | Create attachments | Delete attachments

Folder operations Mailbox folders can contain messages and other folders. You can get, create, change, delete, and manage folders. You can use the following well-known folder names instead of the ID to specify the corresponding folder: Inbox, SentItems, Drafts, or DeletedItems.

Get folders | Create folders | Update folders | Delete folders | Move or copy folders

See also:

REST API message resource | REST API Folder resource

Use the Mail REST API

To interact with the Mail REST API, you send HTTP requests that use a supported method: GET, POST, PATCH, or DELETE.

All Mail REST API requests use the following root URL:

https://outlook.office365.com/api/{version}/{user_context}

{user_context} is the current user, as Mail API requests are always performed on behalf of the current user. You can specify the user context in one of two ways:

  • With the me shortcut: /api/v1.0/me. The root URL becomes https://outlook.office365.com/api/v1.0/me.

  • With the users/{upn} format to pass the UPN or a proxy address, such as: /api/v1.0/users/sadie@contoso.com. In this example, the root URL would become https://outlook.office365.com/api/v1.0/users/sadie@contoso.com.

Usage is a matter of preference. In server responses, the user context is identified in this format: /api/v1.0/users('sadie@contoso.com')

You send requests to endpoints that you want to act on. For example, to get the user's Inbox messages in Office 365, send a GET request to the following URL:

https://outlook.office365.com/api/v1.0/me/messages

POST and PATCH request bodies and server responses are sent in JSON payloads.

The Mail API supports two ways of specifying an ID or key in an entity collection. They are evaluated identically, so usage is a matter of preference.

  • In the URL segment after the collection: /api/v1.0/me/messages/AAMkAGI3...

  • In parentheses as a quoted string: /api/v1.0/me/messages('AAMkAGI3...')

The API supports query parameters to filter messages and folders in the user's mailbox. The path URL resource names, query parameters, and well-known folder names are case insensitive. However, values you assign, entity IDs, and other base64 encoded values are case sensitive.

Use a client library to access the Mail API

The Office 365 API client libraries and SDKs make it easier to interact with the REST APIs. You can get the .NET and Cordova JavaScript client libraries in the latest version of Office 365 API Tools for Visual Studio.

To access the Mail API by using the .NET or JavaScript client library, you need to acquire an access token and get the Outlook Services client. Then, you can send async queries to interact with mail data.

Get an access token | Get the Outlook Services client

Get an access token

Acquire the access token used for authentication. The client ID and authorization URI are assigned when you register your app with Microsoft Azure Active Directory.

Note This pattern applies only to code that runs on Windows devices. In a Windows Store App, values for ClientID and AuthorizationUri are added to your project's App.xaml file when you register your application. AuthorizationUri is used as the host name for the CommonAuthority variable.

// Properties of the native client app. Get the ClientId from the resources section of the App.xaml file.
public const string ClientID = Application.Current.Resources["ida:ClientID"] as String; 
// Get the _returnUri from app settings.
public static Uri _returnUri = Windows.Security.Authentication.Web.WebAuthenticationBroker.GetCurrentApplicationCallbackUri();

// Properties used to communicate with a Windows Azure AD tenant.  
public const string CommonAuthority = "https://login.windows.net/Common"; 
public const string DiscoveryResourceId = "https://api.office.com/discovery/"; 

//Store authority in application data so that it isn't tied to the lifetime of the access token.
private static ApplicationDataContainer _settings = ApplicationData.Current.LocalSettings;
private static string LastAuthority
{
    get
    {
        if (_settings.Values.ContainsKey("LastAuthority") && _settings.Values["LastAuthority"] != null)
        {
            return _settings.Values["LastAuthority"].ToString();
        }
        else
        {
            return string.Empty;
        }

    }

    set
    {
        _settings.Values["LastAuthority"] = value;
    }
}

public static AuthenticationContext _authenticationContext { get; set; } 
private static async Task<string> GetTokenHelperAsync(AuthenticationContext context, string resourceId)
{
    string accessToken = null;
    AuthenticationResult result = null;

    result = await context.AcquireTokenAsync(resourceId, ClientID, _returnUri);

    accessToken = result.AccessToken;
    //Store authority in application data.
    _settings.Values["LastAuthority"] = context.Authority;

    return accessToken;
}
var authContext;
var authToken; // for use with creating an outlookClient later.
authContext = new O365Auth.Context();
authContext.getIdToken("https://outlook.office365.com/")
   .then((function (token) {
       authToken = token;
       // The auth token also carries additional information. For example:    
       userName = token.givenName + " " + token.familyName;
   }).bind(this), function (reason) {
       console.log('Failed to login. Error = ' + reason.message);
   });

Get the Outlook Services client

Get the OutlookServicesClient object. You can call this code from other methods that use the Outlook Services client.

public static async Task<OutlookServicesClient> CreateOutlookClientAsync(string capability)
{
    try
    {
        //First, look for the authority used during the last authentication.
        //If that value is not populated, use CommonAuthority.
        string authority = null;
        if (String.IsNullOrEmpty(LastAuthority))
        {
            authority = CommonAuthority;
        }
        else
        {
            authority = LastAuthority;
        }
        // Create an AuthenticationContext using this authority.
        _authenticationContext = new AuthenticationContext(authority);

        //See the Discovery Service Sample (https://github.com/OfficeDev/Office365-Discovery-Service-Sample)
        //for an approach that improves performance by storing the discovery service information in a cache.
        DiscoveryClient discoveryClient = new DiscoveryClient(
            async () => await GetTokenHelperAsync(_authenticationContext, DiscoveryResourceId));

        // Get the specified capability ("Mail").
        CapabilityDiscoveryResult result = 
            await discoveryClient.DiscoverCapabilityAsync(capability);
        var client = new OutlookServicesClient(
            result.ServiceEndpointUri,
            async () => 
                await GetTokenHelperAsync(_authenticationContext, result.ServiceResourceId));
        return client;
    }
    catch (Exception)
    {
        if (_authenticationContext != null && _authenticationContext.TokenCache != null)
        _authenticationContext.TokenCache.Clear();
        return null;
    }
}
// Once the authToken has been acquired, create an outlookClient. One place to do this is inside of the
//    ".then" function callback of authContext.getIdToken(...) above.
var outlookClient = new Microsoft.OutlookServices.Client('https://outlook.office365.com/api/v1.0', authToken.getAccessTokenFn('https://outlook.office365.com'));

Get messages

You can get a message collection or an individual message from a mailbox folder.

REST API: Get a message collection (REST) | Get a message (REST)

Client libraries: Get a message collection (Client) | Get a message (Client)

Get a message collection (REST)

Required scope: Mail.Read or Mail.Write

Get a message collection from the Inbox (/me/messages) or from another folder in the user's mailbox.

GET https://outlook.office365.com/api/v1.0/me/messages
GET https://outlook.office365.com/api/v1.0/me/folders/{folder_id}/messages
Required parameterTypeDescription
URL parameters
folder_idstringThe folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name, if you're getting messages from a specific folder.

Sample request

GET https://outlook.office365.com/api/v1.0/me/folders/sentitems/messages

Sample response

Status code: 200
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Folders('sentitems')/Messages",
  "value": [
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADTIzAAAA=')",
      "@odata.etag": "W/\"CQAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTJqS\"",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADTIzAAAA=",
      "ChangeKey": "CQAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTJqS",
      "Categories": [],
      "DateTimeCreated": "2014-10-20T00:28:24Z",
      "DateTimeLastModified": "2014-10-20T00:28:26Z",
      "Subject": "Meeting Notes",
      "BodyPreview": "Please send me the meeting notes ASAP",
      "Body": {
        "ContentType": "Text",
        "Content": "Please send me the meeting notes ASAP"
      },
      "Importance": "Normal",
      "HasAttachments": false,
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEJAAA=",
      "From": {
        "EmailAddress": {
          "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
          "Name": "Alex D"
        }
      },
      "Sender": {
        "EmailAddress": {
          "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
          "Name": "Alex D"
        }
      },
      "ToRecipients": [
        {
          "EmailAddress": {
            "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
            "Name": "Katie Jordan"
          }
        }
      ],
      "CcRecipients": [],
      "BccRecipients": [],
      "ReplyTo": [],
      "ConversationId": "AAQkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAQAEmjRj3pwjRLrbymGMYyEto=",
      "DateTimeReceived": "2014-10-20T00:28:24Z",
      "DateTimeSent": "2014-10-20T00:28:24Z",
      "IsDeliveryReceiptRequested": false,
      "IsReadReceiptRequested": false,
      "IsDraft": false,
      "IsRead": true
    },
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADTIy-AAA=')",
      "@odata.etag": "W/\"CQAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTJqP\"",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADTIy-AAA=",
      "ChangeKey": "CQAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTJqP",
      "Categories": [],
      "DateTimeCreated": "2014-10-20T00:13:21Z",
      "DateTimeLastModified": "2014-10-20T00:13:23Z",
      "Subject": "Contract Signing",
      "BodyPreview": "There will be a detailed legal review of Project Falcon once the contract is ready.",
      "Body": {
        "ContentType": "Text",
        "Content": "There will be a detailed legal review of Project Falcon once the contract is ready."
      },
      "Importance": "Normal",
      "HasAttachments": false,
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEJAAA=",
      "From": {
        "EmailAddress": {
          "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
          "Name": "Alex D"
        }
      },
      "Sender": {
        "EmailAddress": {
          "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
          "Name": "Alex D"
        }
      },
      "ToRecipients": [
        {
          "EmailAddress": {
            "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
            "Name": "Katie Jordan"
          }
        },
        {
          "EmailAddress": {
            "Address": "garthf@a830edad9050849NDA1.onmicrosoft.com",
            "Name": "Garth Fort"
          }
        }
      ],
      "CcRecipients": [],
      "BccRecipients": [],
      "ReplyTo": [],
      "ConversationId": "AAQkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAQAKjRc0YJSUBJpofjWgitxag=",
      "DateTimeReceived": "2014-10-20T00:13:21Z",
      "DateTimeSent": "2014-10-20T00:13:21Z",
      "IsDeliveryReceiptRequested": false,
      "IsReadReceiptRequested": false,
      "IsDraft": false,
      "IsRead": true
    },
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADTIy9AAA=')",
      "@odata.etag": "W/\"CwAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTJqJ\"",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADTIy9AAA=",
      "ChangeKey": "CwAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTJqJ",
      "Categories": [],
      "DateTimeCreated": "2014-10-19T23:12:40Z",
      "DateTimeLastModified": "2014-10-19T23:12:42Z",
      "Subject": "Rob:Alex 1:1",
      "BodyPreview": "Let's meet every month to engage in project review and career discussion",
      "Body": {
        "ContentType": "HTML",
        "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<style type=\"text/css\" style=\"display:none\"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>\r\n</head>\r\n<body dir=\"ltr\" style=\"font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;\">\r\n<p>Let's meet every month to engage in project review and career discussion<br>\r\n</p>\r\n</body>\r\n</html>\r\n"
      },
      "Importance": "Normal",
      "HasAttachments": false,
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEJAAA=",
      "From": {
        "EmailAddress": {
          "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
          "Name": "Alex D"
        }
      },
      "Sender": {
        "EmailAddress": {
          "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
          "Name": "Alex D"
        }
      },
      "ToRecipients": [
        {
          "EmailAddress": {
            "Address": "roby@a830edad9050849NDA1.onmicrosoft.com",
            "Name": "Rob Young"
          }
        }
      ],
      "CcRecipients": [],
      "BccRecipients": [],
      "ReplyTo": [],
      "ConversationId": "AAQkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAQAFeDWE5GradIk5oqUb-_emE=",
      "DateTimeReceived": "2014-10-19T23:12:42Z",
      "DateTimeSent": "2014-10-19T23:12:40Z",
      "IsDeliveryReceiptRequested": null,
      "IsReadReceiptRequested": false,
      "IsDraft": false,
      "IsRead": true
    }
  ]
}

Response type

The requested message collection.

Note By default, each message in the response includes all its properties. Use $select to specify only those properties you need for best performance. The Id property is always returned. See OData query parameters for filtering, sorting, and paging parameters.

The following example shows how to use $select to specify returning only the Sender and Subject properties of each message in the response.

GET https://outlook.office365.com/api/v1.0/me/messages?$select=Sender,Subject

Get a message (REST)

Required scope: Mail.Read or Mail.Write

Get a message by ID.

GET https://outlook.office365.com/api/v1.0/me/messages/{message_id}
Required parameterTypeDescription
URL parameters
message_idstringThe message ID.

Sample request

GET https://outlook.office365.com/api/v1.0/me/messages/AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAA=

Sample response

Status code: 200
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAA=')",
  "@odata.etag": "W/\"CQAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTIKz\"",
  "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAA=",
  "ChangeKey": "CQAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTIKz",
  "Categories": [],
  "DateTimeCreated": "2014-10-20T00:41:57Z",
  "DateTimeLastModified": "2014-10-20T00:41:57Z",
  "Subject": "Re: Meeting Notes",
  "BodyPreview": "________________________________________\nFrom: Alex D\nSent: Sunday, October 19, 2014 5:28 PM\nTo: Katie Jordan\nSubject: Meeting Notes\n\nPlease send me the meeting notes ASAP",
  "Body": {
    "ContentType": "Text",
    "Content": "\n________________________________________\nFrom: Alex D\nSent: Sunday, October 19, 2014 5:28 PM\nTo: Katie Jordan\nSubject: Meeting Notes\n\nPlease send me the meeting notes ASAP\n"
  },
  "Importance": "Normal",
  "HasAttachments": true,
  "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEMAAA=",
  "From": {
    "EmailAddress": {
      "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Katie Jordan"
    }
  },
  "Sender": {
    "EmailAddress": {
      "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Katie Jordan"
    }
  },
  "ToRecipients": [
    {
      "EmailAddress": {
        "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Alex D"
      }
    }
  ],
  "CcRecipients": [],
  "BccRecipients": [],
  "ReplyTo": [],
  "ConversationId": "AAQkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAQAEmjRj3pwjRLrbymGMYyEto=",
  "DateTimeReceived": "2014-10-20T00:41:57Z",
  "DateTimeSent": "2014-10-20T00:41:53Z",
  "IsDeliveryReceiptRequested": false,
  "IsReadReceiptRequested": false,
  "IsDraft": false,
  "IsRead": false
}
Required parameterTypeDescription
URL parameters
message_idstringThe message ID.

Response type

The requested message.

Note By default, the response includes all the properties of the specified message. Use $select to specify only those properties you need for best performance. The Id property is always returned. See OData query parameters for filtering, sorting, and paging parameters.

The following example shows how to use $select to specify returning only the Sender and Subject properties of the message in the response.

GET https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE1M2IyNGNmLTI5MTktNDUyZi1iOTVlLTY0YjcxZWUzNTE1MABGAAAAAADBl2ZeO-NJTqt5NqHlVnKVBwCY4MQpaFz9SbqUDe4_bs88AAAAAAEMAACY4MQpaFz9SbqUDe4_bs88AAAHt60CAAA=?$select=Sender,Subject

Get a message collection (Client)

Get the messages in the Inbox by using the Me.Messages shortcut property. To get the messages from a different folder, use the folder's Messages property. You can use the following well-known folder names instead of the ID for the corresponding folder: Inbox, SentItems, Drafts, DeletedItems.

Example: outlookClient.Me.Folders["SentItems"].Messages.ExecuteAsync()

Note Message collections support query expressions such as Select, OrderBy, and Take.

This example calls the method that creates the Outlook Services client.

var outlookClient = await CreateOutlookClientAsync("Mail");
    var messages = await outlookClient.Me.Folders["Inbox"].Messages
      .OrderByDescending(m => m.DateTimeReceived)
      .Take(10)
      .ExecuteAsync();

foreach(var message in messages.CurrentPage)
{
  System.Diagnostics.Debug.WriteLine("Message '{0}' received at '{1}'.",
    message.Subject,
    message.DateTimeReceived.ToString());
}
outlookClient.me.folders.getFolder('Inbox').messages.getMessages().orderBy('DateTimeReceived desc').fetchAll(10).then(function (result) {
    result.forEach(function (message) {
        console.log('Message "' + message.subject + '" received at "' + message.dateTimeReceived.toString() + '"');
    });
}, function(error) {
    console.log(error);
});

Get a message (Client)

To get a particular message, specify the message ID as the index of the Messages collection or use the GetById method.


Create and send messages

You can send a new message on the fly, or create a draft message and then send it. You can create drafts in any folder.

REST API: Send a new message on the fly (REST) | Create a draft message (REST) | Send a draft message (REST)

Client libraries: Send a new message on the fly (Client) | Create a draft message (Client) | Send a draft message (Client)

Send a new message on the fly (REST)

Required scope: Mail.Send

Send the message supplied in the request body by using the SendMail method. You can optionally save the message in the Sent Items folder.

POST https://outlook.office365.com/api/v1.0/me/sendmail
Required parameterTypeDescription
Body parameters
MessageMessageThe message to send.
SavetoSentItemsbooleanIndicates whether to save the message in Sent Items. Default is true.

Specify the Message parameter with the required ToRecipients property and any writable message properties in the request body. The SaveToSentItems parameter is required only if false.

Sample request

POST https://outlook.office365.com/api/v1.0/me/sendmail
Content-Type: application/json
{
  "Message": {
    "Subject": "Meet for lunch?",
    "Body": {
      "ContentType": "Text",
      "Content": "The new cafeteria is open."
    },
    "ToRecipients": [
      {
        "EmailAddress": {
          "Address": "garthf@a830edad9050849NDA1.onmicrosoft.com"
        }
      }
    ],
    "Attachments": [
      {
        "@odata.type": "#Microsoft.OutlookServices.FileAttachment",
        "Name": "menu.txt",
        "ContentBytes": "bWFjIGFuZCBjaGVlc2UgdG9kYXk="
      }
    ]
  },
  "SaveToSentItems": "false"
}

Sample response

Status code: 202
"none"

Create a draft message (REST)

Required scope: Mail.Write

Create a draft of a new message. Drafts can be created in any folder and optionally updated before sending. To save to the Drafts folder, you use the /me/messages shortcut.

POST https://outlook.office365.com/api/v1.0/me/messages
POST https://outlook.office365.com/api/v1.0/me/folders/{folder_id}/messages
Required parameterTypeDescription
URL parameters
folder_idstringThe destination folder ID, or the Inbox or Drafts well-known folder name..

Specify any writable message properties in the request body.

Sample request

POST https://outlook.office365.com/api/v1.0/me/folders/inbox/messages
Content-Type: application/json
{
  "Subject": "Did you see last night's game?",
  "Importance": "Low",
  "Body": {
    "ContentType": "HTML",
    "Content": "They were <b>awesome</b>!"
  },
  "ToRecipients": [
    {
      "EmailAddress": {
        "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com"
      }
    }
  ]
}

Sample response

Status code: 201
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAAmP1Ln1wcHRariNdTMGAO9AAASz7k0AAA=')",
  "@odata.etag": "W/\"CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0Ag5\"",
  "Id": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAAmP1Ln1wcHRariNdTMGAO9AAASz7k0AAA=",
  "ChangeKey": "CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0Ag5",
  "Categories": [],
  "DateTimeCreated": "2014-10-18T20:06:51Z",
  "DateTimeLastModified": "2014-10-18T20:06:51Z",
  "Subject": "Did you see last night's game?",
  "BodyPreview": "They were awesome!",
  "Body": {
    "ContentType": "HTML",
    "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body>\r\nThey were <b>awesome</b>!\r\n</body>\r\n</html>\r\n"
  },
  "Importance": "Low",
  "HasAttachments": false,
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAA=",
  "From": null,
  "Sender": null,
  "ToRecipients": [
    {
      "EmailAddress": {
        "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Katie Jordan"
      }
    }
  ],
  "CcRecipients": [],
  "BccRecipients": [],
  "ReplyTo": [],
  "ConversationId": "AAQkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAQADXiGXoAtX9IubRTpv2hisc=",
  "DateTimeReceived": "2014-10-18T20:06:51Z",
  "DateTimeSent": "2014-10-18T20:06:51Z",
  "IsDeliveryReceiptRequested": false,
  "IsReadReceiptRequested": false,
  "IsDraft": true,
  "IsRead": true
}

Response type

The draft message.


Send a draft message (REST)

Required scope: Mail.Send

Send a new message draft, a Reply draft, a Reply All draft, or a Forward draft by using the Send method. The message is then saved in the Sent Items folder.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/send
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the draft message to send.

Sample request

POST https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAAmP1Ln1wcHRariNdTMGAO9AAASz7k0AAA=/send

Sample response

Status code: 202
"none"

Send a new message on the fly (Client)

Create a message and pass it to the SendMailAsync method.

This example assumes you already got the Outlook Services client.

ItemBody body = new ItemBody
{
    Content = "It was <b>awesome</b>!",
    ContentType = BodyType.HTML
};
List<Recipient> toRecipients = new List<Recipient>();
toRecipients.Add(new Recipient
{
    EmailAddress = new EmailAddress
    {
        Address = "katiej@a830edad9050849NDA1.onmicrosoft.com"
    }
});
toRecipients.Add(new Recipient
{
    EmailAddress = new EmailAddress
    {
        Address = "pavelb@a830edad9050849NDA1.onmicrosoft.com"
    }
});
Message newMessage = new Message
{
    Subject = "Did you see last night's game?",
    Body = body,
    ToRecipients = toRecipients
};

// To send a message without saving to Sent Items, specify false for  
// the SavetoSentItems parameter. 
await outlookClient.Me.SendMailAsync(newMessage, true);

Create a draft message (Client)

Create a draft message and pass it to the AddMessageAsync method. Then you can update the draft and send it.

This example assumes you already got the Outlook Services client.

ItemBody body = new ItemBody
{
    Content = "I'm coming out a week later.",
    ContentType = BodyType.HTML
};
List<Recipient> toRecipients = new List<Recipient>();
toRecipients.Add(new Recipient
{
    EmailAddress = new EmailAddress
    {
        Address = "katiej@a830edad9050849NDA1.onmicrosoft.com"
    }
});
Message draftMessage = new Message
{
    Subject = "Changed my travel plans",
    Body = body,
    ToRecipients = toRecipients,
    Importance = Importance.High
};

// Save the draft message. Saving to Me.Messages saves the message in the Drafts folder.
await outlookClient.Me.Messages.AddMessageAsync(draftMessage);

// Get the ID of the message.
string messageId = draftMessage.Id;

Adding a message to the Me.Messages collection saves the draft in the Drafts folder, but you can save a draft in the Messages collection of any folder.

Example: outlookClient.Me.Folders["AAMkADE3N..."].Messages.AddMessageAsync(newMessage)


Send a draft message (Client)

Send a draft message by calling SendAsync. You can send a draft of a new, reply, reply-all, or forward message.

This example assumes you already got the Outlook Services client and got the message ID.

await outlookClient.Me.Messages[messageId].SendAsync();

Reply or reply all to messages

You can reply with a message on the fly, or you can first create a reply draft, then update and send the draft. You can reply to only the sender of the message or reply to all recipients at once.

REST API: Reply to sender on the fly (REST) | Reply all on the fly (REST) | Create a draft reply message (REST) | Create a draft reply-all message (REST)

Client libraries: Reply or reply all on the fly (Client) | Create a draft reply or draft reply-all message (Client)

Reply to sender on the fly (REST)

Required scope: Mail.Send

Reply to the sender of a message by using the Reply method. The message is then saved in the Sent Items folder.

Or, you can create draft Reply message and then update and send it.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/reply
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to reply to.
Body parameters
CommentstringA comment to include. Can be an empty string.

Sample request

POST https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEJAAAmP1Ln1wcHRariNdTMGAO9AAASz8DmAAA=/reply
Content-Type: application/json
{
  "Comment": "Sounds great! See you tomorrow."
}

Sample response

Status code: 202
"none"

Reply all on the fly (REST)

Required scope: Mail.Send

Reply to all recipients of a message by using the ReplyAll method. The message is then saved in the Sent Items folder.

Or, you can create draft Reply All message and then update and send it.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/replyall
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to reply to.
Body parameters
CommentstringA comment to include. Can be an empty string.

Sample request

POST https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEJAAAmP1Ln1wcHRariNdTMGAO9AAASz8DmAAA=/replyall
Content-Type: application/json
{
  "Comment": "Thanks for the heads up."
}

Sample response

Status code: 202
"none"

Create a draft reply message (REST)

Required scope: Mail.Write

Create a draft of the Reply message by using the CreateReply method. You can then update and send the draft.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/createreply
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to reply to.

Sample request

POST https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAAmP1Ln1wcHRariNdTMGAO9AAASz8TAAAA=/createreply

Sample response

Status code: 201
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAAmP1Ln1wcHRariNdTMGAO9AAASz7k2AAA=')",
  "@odata.etag": "W/\"CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0Ag+\"",
  "Id": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAAmP1Ln1wcHRariNdTMGAO9AAASz7k2AAA=",
  "ChangeKey": "CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0Ag+",
  "Categories": [],
  "DateTimeCreated": "2014-10-18T20:59:38Z",
  "DateTimeLastModified": "2014-10-18T20:59:38Z",
  "Subject": "RE: Did you see last night's game?",
  "BodyPreview": "________________________________\r\nFrom: Alex D\r\nSent: Saturday, October 18, 2014 8:49:03 PM\r\nTo: Katie Jordan\r\nSubject: RE: Did you see last night's game?\r\n\r\nI was at the game!\r\n\r\nFrom: Alex D [mailto:alexd@a830edad9050849NDA1.onmicrosoft.com]",
  "Body": {
    "ContentType": "HTML",
    "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=us-ascii\">\r\n<meta name=\"Generator\" content=\"Microsoft Word 15 (filtered medium)\">\r\n<style>\r\n<!--\r\n@font-face\r\n\t{font-family:\"Cambria Math\"}\r\n@font-face\r\n\t{font-family:Calibri}\r\np.MsoNormal, li.MsoNormal, div.MsoNormal\r\n\t{margin:0in;\r\n\tmargin-bottom:.0001pt;\r\n\tfont-size:12.0pt;\r\n\tfont-family:\"Times New Roman\",\"serif\"}\r\na:link, span.MsoHyperlink\r\n\t{color:#0563C1;\r\n\ttext-decoration:underline}\r\na:visited, span.MsoHyperlinkFollowed\r\n\t{color:#954F72;\r\n\ttext-decoration:underline}\r\nspan.EmailStyle17\r\n\t{font-family:\"Calibri\",\"sans-serif\";\r\n\tcolor:#1F497D}\r\n.MsoChpDefault\r\n\t{font-size:10.0pt}\r\n@page WordSection1\r\n\t{margin:1.0in 1.0in 1.0in 1.0in}\r\ndiv.WordSection1\r\n\t{}\r\n-->\r\n</style>\r\n</head>\r\n<body lang=\"EN-US\" link=\"#0563C1\" vlink=\"#954F72\">\r\n<hr tabindex=\"-1\" style=\"display:inline-block; width:98%\">\r\n<div id=\"divRplyFwdMsg\" dir=\"ltr\"><font face=\"Calibri, sans-serif\" color=\"#000000\" style=\"font-size:11pt\"><b>From:</b> Katie Jordan;<br>\r\n<b>Sent:</b> Saturday, October 18, 2014 8:49:03 PM<br>\r\n<b>To:</b> Alex D<br>\r\n<b>Subject:</b> RE: Did you see last night's game?</font>\r\n<div>&amp;nbsp;</div>\r\n</div>\r\n<div>\r\n<div class=\"WordSection1\">\r\n<p class=\"MsoNormal\"><span style=\"font-size:11.0pt; font-family:&amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color:#1F497D\">I was at the game!</span></p>\r\n<p class=\"MsoNormal\"><span style=\"font-size:11.0pt; font-family:&amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color:#1F497D\">&amp;nbsp;</span></p>\r\n<div>\r\n<div style=\"border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0in 0in 0in\">\r\n<p class=\"MsoNormal\"><b><span style=\"font-size:11.0pt; font-family:&amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;\">From:</span></b><span style=\"font-size:11.0pt; font-family:&amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;\"> Alex D [mailto:alexd@a830edad9050849NDA1.onmicrosoft.com]\r\n<br>\r\n<b>Sent:</b> Saturday, October 18, 2014 1:39 PM<br>\r\n<b>To:</b> Katie Jordan<br>\r\n<b>Subject:</b> Did you see last night's game?<br>\r\n<b>Importance:</b> Low</span></p>\r\n</div>\r\n</div>\r\n<p class=\"MsoNormal\">&amp;nbsp;</p>\r\n<p class=\"MsoNormal\">They were <b>awesome</b>! </p>\r\n</div>\r\n</div>\r\n</body>\r\n</html>\r\n"
  },
  "Importance": "Normal",
  "HasAttachments": false,
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAA=",
  "From": null,
  "Sender": {
    "EmailAddress": {
      "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Alex D"
    }
  },
  "ToRecipients": [
    {
      "EmailAddress": {
        "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Katie Jordan"
      }
    }
  ],
  "CcRecipients": [],
  "BccRecipients": [],
  "ReplyTo": [],
  "ConversationId": "AAQkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAQADXiGXoAtX9IubRTpv2hisc=",
  "DateTimeReceived": "2014-10-18T20:59:38Z",
  "DateTimeSent": "2014-10-18T20:59:38Z",
  "IsDeliveryReceiptRequested": false,
  "IsReadReceiptRequested": false,
  "IsDraft": true,
  "IsRead": true
}

Response type

The draft Reply message with the ToRecipient, IsDraft, and other appropriate properties prepopulated.


Create a draft reply-all message (REST)

Required scope: Mail.Write

Create a draft of the Reply All message by using the CreateReplyAll method. You can then update and send the draft.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/createreplyall
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to reply-all to.

Sample request

POST https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEJAAAmP1Ln1wcHRariNdTMGAO9AAASz8DmAAA=/createreplyall

Sample response

Status code: 201
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAAmP1Ln1wcHRariNdTMGAO9AAASz7k5AAA=')",
  "@odata.etag": "W/\"CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0AhF\"",
  "Id": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAAmP1Ln1wcHRariNdTMGAO9AAASz7k5AAA=",
  "ChangeKey": "CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0AhF",
  "Categories": [],
  "DateTimeCreated": "2014-10-18T21:21:06Z",
  "DateTimeLastModified": "2014-10-18T21:21:06Z",
  "Subject": "RE: Check out the new Office 365 APIs",
  "BodyPreview": "________________________________\r\nFrom: Alex D\r\nSent: Saturday, October 18, 2014 9:18:18 PM\r\nTo: Katie Jordan; Garth Fort\r\nSubject: Check out the new Office 365 APIs\r\n\r\n\r\nhttp://msdn.microsoft.com/library/office/dn605892(v=office.15)",
  "Body": {
    "ContentType": "HTML",
    "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=iso-8859-1\">\r\n<style type=\"text/css\" style=\"\">\r\n<!--\r\np\r\n\t{margin-top:0px;\r\n\tmargin-bottom:0px}\r\n-->\r\n</style>\r\n</head>\r\n<body dir=\"ltr\">\r\n<hr tabindex=\"-1\" style=\"display:inline-block; width:98%\">\r\n<div id=\"divRplyFwdMsg\" dir=\"ltr\"><font face=\"Calibri, sans-serif\" color=\"#000000\" style=\"font-size:11pt\"><b>From:</b> Alex D<br>\r\n<b>Sent:</b> Saturday, October 18, 2014 9:18:18 PM<br>\r\n<b>To:</b> Katie Jordan; Garth Fort<br>\r\n<b>Subject:</b> Check out the new Office 365 APIs</font>\r\n<div>&amp;nbsp;</div>\r\n</div>\r\n<div>\r\n<div id=\"divtagdefaultwrapper\" style=\"font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif\">\r\n<p><a id=\"lnk681678\" href=\"http://msdn.microsoft.com/library/office/dn605892(v=office.15\">http://msdn.microsoft.com/library/office/dn605892(v=office.15)</a></p>\r\n</div>\r\n</div>\r\n</body>\r\n</html>\r\n"
  },
  "Importance": "Normal",
  "HasAttachments": false,
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAA=",
  "From": null,
  "Sender": {
    "EmailAddress": {
      "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Alex D"
    }
  },
  "ToRecipients": [
    {
      "EmailAddress": {
        "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Katie Jordan"
      }
    },
    {
      "EmailAddress": {
        "Address": "garthf@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Garth Fort"
      }
    }
  ],
  "CcRecipients": [],
  "BccRecipients": [],
  "ReplyTo": [],
  "ConversationId": "AAQkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAQAOg2iJIA6sVCj8rl3HbTkEU=",
  "DateTimeReceived": "2014-10-18T21:21:06Z",
  "DateTimeSent": "2014-10-18T21:21:06Z",
  "IsDeliveryReceiptRequested": false,
  "IsReadReceiptRequested": false,
  "IsDraft": true,
  "IsRead": true
}

Response type

The draft Reply All message with the ToRecipient, IsDraft, and other appropriate properties prepopulated.


Reply or reply all on the fly (Client)

Reply directly to the sender of the message or to all recipients by calling ReplyAsync or ReplyAllAsync and passing in a comment.

This example assumes you already got the Outlook Services client and got the message ID.

await outlookClient.Me.Messages[messageId].ReplyAsync("Count me in.");
await outlookClient.Me.Messages[messageId].ReplyAllAsync("Count me in.");

Create a draft reply or draft reply-all message (Client)

Create a draft Reply or ReplyAll message by calling CreateReplyAsync or CreateReplyAllAsync. Then you can update the draft and send it.

This example assumes you already got the Outlook Services client and got the message ID.

IMessage replyDraft = await outlookClient.Me.Messages[messageId].CreateReplyAsync();

// Get the ID of the draft Reply message.
string replyMessageId = replyDraft.Id;
IMessage replyAllDraft = await outlookClient.Me.Messages[messageId].CreateReplyAllAsync();

// Get the ID of the draft Reply All message.
string replyAllMessageId = replyAllDraft.Id;

CreateReplyAsync and CreateReplyAllAsync create a draft message with the ToRecipients, IsDraft, and other appropriate properties prepopulated.


Forward new or drafted messages

You can forward a message directly, or you can create a draft forward message, update and then send it.

REST API: Forward a message directly (REST) | Create a Forward message (REST)

Client libraries: Forward a message directly (Client) | Create a draft Forward message (Client)

Forward a message directly (REST)

Required scope: Mail.Send

Forward a message by using the Forward method. The message is saved in the Sent Items folder.

Or, you can create draft Forward message and then update and send it.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/forward
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to forward.
Body parameters
CommentstringA comment to include. Can be an empty string.
ToRecipientsCollection(Recipient)The list of recipients.

Specify the Comment and ToRecipients parameters in the request body.

Sample request

POST https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEJAAAmP1Ln1wcHRariNdTMGAO9AAASz8DmAAA=/forward
Content-Type: application/json
{
  "Comment": "FYI",
  "ToRecipients": [
    {
      "EmailAddress": {
        "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com"
      }
    },
    {
      "EmailAddress": {
        "Address": "garthf@a830edad9050849NDA1.onmicrosoft.com"
      }
    }
  ]
}

Sample response

Status code: 202
"none"

Create a draft forward message (REST)

Required scope: Mail.Write

Create a draft of the Forward message by using the CreateForward method. You can then update and send the draft.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/createforward
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to forward.

Sample request

POST https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEJAAAmP1Ln1wcHRariNdTMGAO9AAASz8DmAAA=/createforward

Sample response

Status code: 201
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAAmP1Ln1wcHRariNdTMGAO9AAASz7k6AAA=')",
  "@odata.etag": "W/\"CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0AhG\"",
  "Id": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAAmP1Ln1wcHRariNdTMGAO9AAASz7k6AAA=",
  "ChangeKey": "CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0AhG",
  "Categories": [],
  "DateTimeCreated": "2014-10-18T21:29:28Z",
  "DateTimeLastModified": "2014-10-18T21:29:28Z",
  "Subject": "FW: Check out the new Office 365 APIs",
  "BodyPreview": "________________________________\r\nFrom: Alex D\r\nSent: Saturday, October 18, 2014 9:18:18 PM\r\nTo: Katie Jordan; Garth Fort\r\nSubject: Check out the new Office 365 APIs\r\n\r\n\r\nhttp://msdn.microsoft.com/library/office/dn605892(v=office.15)",
  "Body": {
    "ContentType": "HTML",
    "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=iso-8859-1\">\r\n<style type=\"text/css\" style=\"\">\r\n<!--\r\np\r\n\t{margin-top:0px;\r\n\tmargin-bottom:0px}\r\n-->\r\n</style>\r\n</head>\r\n<body dir=\"ltr\">\r\n<hr tabindex=\"-1\" style=\"display:inline-block; width:98%\">\r\n<div id=\"divRplyFwdMsg\" dir=\"ltr\"><font face=\"Calibri, sans-serif\" color=\"#000000\" style=\"font-size:11pt\"><b>From:</b> Alex D<br>\r\n<b>Sent:</b> Saturday, October 18, 2014 9:18:18 PM<br>\r\n<b>To:</b> Katie Jordan; Garth Fort<br>\r\n<b>Subject:</b> Check out the new Office 365 APIs</font>\r\n<div>&amp;nbsp;</div>\r\n</div>\r\n<div>\r\n<div id=\"divtagdefaultwrapper\" style=\"font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif\">\r\n<p><a id=\"lnk681678\" href=\"http://msdn.microsoft.com/library/office/dn605892(v=office.15\">http://msdn.microsoft.com/library/office/dn605892(v=office.15)</a></p>\r\n</div>\r\n</div>\r\n</body>\r\n</html>\r\n"
  },
  "Importance": "Normal",
  "HasAttachments": false,
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAAAAEPAAA=",
  "From": null,
  "Sender": {
    "EmailAddress": {
      "Address": "'alexd@a830edad9050849NDA1.onmicrosoft.com'",
      "Name": "Alex D"
    }
  },
  "ToRecipients": [],
  "CcRecipients": [],
  "BccRecipients": [],
  "ReplyTo": [],
  "ConversationId": "AAQkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAQAOg2iJIA6sVCj8rl3HbTkEU=",
  "DateTimeReceived": "2014-10-18T21:29:28Z",
  "DateTimeSent": "2014-10-18T21:29:28Z",
  "IsDeliveryReceiptRequested": false,
  "IsReadReceiptRequested": false,
  "IsDraft": true,
  "IsRead": true
}

Response type

The draft Forward message with IsDraft and appropriate properties prepopulated.


Forward a message directly (Client)

Forward a message directly by calling ForwardAsync and passing in a comment and the recipients.

This example assumes you already got the Outlook Services client and got the message ID.

List<Recipient> recipients = new List<Recipient>();
recipients.Add(new Recipient
{
    EmailAddress = new EmailAddress
    {
        Address = "garthf@a830edad9050849NDA1.onmicrosoft.com"
    }
});
await outlookClient.Me.Messages[messageId].ForwardAsync("Interested?", recipients);

Create a draft Forward message (Client)

Create a draft Forward message by calling CreateForwardAsync. Then you can update the draft and send it.

This example assumes you already got the Outlook Services client and got the message ID.

IMessage forwardDraft = await outlookClient.Me.Messages[messageId].CreateForwardAsync();

// Get the ID of the draft Forward message.
string forwardMessageId = forwardDraft.Id;

CreateForward creates a draft message with the IsDraft and other appropriate properties prepopulated.


Update messages

Change writable properties on a message and save the changes.

REST API: Update a message (REST)

Client libraries: Update a message (Client)

Update a message (REST)

Required scope: Mail.Write

Change writable properties on a draft or existing message. Only the properties that you specify are changed.

PATCH https://outlook.office365.com/api/v1.0/me/messages/{message_id}
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to update.

Specify one or more writable message properties in the request body.

Sample request

PATCH https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAAmP1Ln1wcHRariNdTMGAO9AAASz8S-AAA=
Content-Type: application/json
{
  "Categories": [
    "Orange category",
    "Green category"
  ],
  "IsRead": true
}

Sample response

Status code: 200
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAAmP1Ln1wcHRariNdTMGAO9AAASz8S-AAA=')",
  "@odata.etag": "W/\"CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0AIP\"",
  "Id": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAAmP1Ln1wcHRariNdTMGAO9AAASz8S-AAA=",
  "ChangeKey": "CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0AIP",
  "Categories": [
    "Orange category",
    "Green category"
  ],
  "DateTimeCreated": "2014-10-17T17:12:15Z",
  "DateTimeLastModified": "2014-10-19T03:24:35Z",
  "Subject": "Meeting notes from today",
  "BodyPreview": "​See attached​",
  "Body": {
    "ContentType": "HTML",
    "Content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<style type=\"text/css\" style=\"display:none\"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>\r\n</head>\r\n<body dir=\"ltr\">\r\n<div id=\"divtagdefaultwrapper\" style=\"color: rgb(0, 0, 0); font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; background-color: rgb(255, 255, 255);\">\r\n<p>​See attached</p>\r\n</div>\r\n</body>\r\n</html>\r\n"
  },
  "Importance": "Normal",
  "HasAttachments": true,
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAA=",
  "From": {
    "EmailAddress": {
      "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Alex D"
    }
  },
  "Sender": {
    "EmailAddress": {
      "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Alex D"
    }
  },
  "ToRecipients": [
    {
      "EmailAddress": {
        "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Katie Jordan"
      }
    }
  ],
  "CcRecipients": [],
  "BccRecipients": [],
  "ReplyTo": [],
  "ConversationId": "AAQkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAQANKneItHNYxNlwnKip-qvhs=",
  "DateTimeReceived": "2014-10-17T17:12:15Z",
  "DateTimeSent": "2014-10-17T17:12:12Z",
  "IsDeliveryReceiptRequested": false,
  "IsReadReceiptRequested": false,
  "IsDraft": false,
  "IsRead": true
}

Response type

The updated message.


Update a message (Client)

Change writable properties on a message, and call UpdateAsync to save the changes.

This example assumes you already got the Outlook Services client and got the message ID.

IMessage message = await outlookClient.Me.Messages[messageId].ExecuteAsync();
message.Body = new ItemBody
{
        Content = "I'm coming out a week earlier."
};
message.ToRecipients.Add(new Recipient
{
    EmailAddress = new EmailAddress
    {
        Address = "garthf@a830edad9050849NDA1.onmicrosoft.com"
    }
});
await message.UpdateAsync();

You can define multiple updates client-side and send the requests all at once (batch them) by using the following pattern:

  1. Call UpdateAsync(true) for each entity you want to update. Specifying true registers the updates locally on the client but doesn't post them to the server.
  2. Call outlookClient.Context.SaveChangesAsync() to post all updates that are registered locally.

Delete messages

Delete a message.

Note Be careful when you delete messages. Deleted contents might not be recoverable. To learn more, see Deleting items.

REST API: Delete a message (REST)

Client libraries: Delete a message (Client)

Delete a message (REST)

Required scope: Mail.Write

DELETE https://outlook.office365.com/api/v1.0/me/messages/{message_id}
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to delete.

Sample request

DELETE https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAAmP1Ln1wcHRariNdTMGAO9AAASz8TBAAA=

Sample response

Status code: 204
"None"

Delete a message (Client)

Delete a message by calling DeleteAsync.

This example assumes you already got the Outlook Services client and got the message ID.

IMessage message = await outlookClient.Me.Messages[messageId].ExecuteAsync();
await message.DeleteAsync();

Move or copy messages

You can move or copy a message to a folder.

REST API: Move a message (REST) | Copy a message (REST)

Client Libraries: Move or copy a message (Client)

Move a message (REST)

Required scope: Mail.Write

Move a message to a folder. This creates a new copy of the message in the destination folder.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/move
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to move.
Body parameters
DestinationIdstringThe destination folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.

Sample request

POST https://outlook.office365.com/api/v1.0/me/messages/AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADTIy-AAA=/move
Content-Type: application/json
{
  "DestinationId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEJAAA="
}

Sample response

Status code: 201
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEKAAAmP1Ln1wcHRariNdTMGAO9AAASz_vSAAA=')",
  "@odata.etag": "W/\"CQAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTJqP\"",
  "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADTshBhAAA=",
  "ChangeKey": "CQAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTJqP",
  "Categories": [],
  "DateTimeCreated": "2014-10-20T00:13:21Z",
  "DateTimeLastModified": "2014-10-20T00:13:23Z",
  "Subject": "Contract Signing",
  "BodyPreview": "There will be a detailed legal review of Project Falcon once the contract is ready.",
  "Body": {
    "ContentType": "Text",
    "Content": "There will be a detailed legal review of Project Falcon once the contract is ready."
  },
  "Importance": "Normal",
  "HasAttachments": false,
  "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEJAAA=",
  "From": {
    "EmailAddress": {
      "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Alex D"
    }
  },
  "Sender": {
    "EmailAddress": {
      "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Alex D"
    }
  },
  "ToRecipients": [
    {
      "EmailAddress": {
        "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Katie Jordan"
      }
    },
    {
      "EmailAddress": {
        "Address": "garthf@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Garth Fort"
      }
    }
  ],
  "CcRecipients": [],
  "BccRecipients": [],
  "ReplyTo": [],
  "ConversationId": "AAQkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAQAKjRc0YJSUBJpofjWgitxag=",
  "DateTimeReceived": "2014-10-20T00:13:21Z",
  "DateTimeSent": "2014-10-20T00:13:21Z",
  "IsDeliveryReceiptRequested": false,
  "IsReadReceiptRequested": false,
  "IsDraft": false,
  "IsRead": true
}

Response type

The message that was moved.


Copy a message (REST)

Required scope: Mail.Write

Copy a message to a folder.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/copy
Required parameterTypeDescription
URL parameters
message_idstringThe ID of the message to copy.
Body parameters
DestinationIdstringThe destination folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.

Sample request

POST https://outlook.office365.com/api/v1.0/me/messages/AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADTIy-AAA=/copy
Content-Type: application/json
{
  "DestinationId": "inbox"
}

Sample response

Status code: 201
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAAmP1Ln1wcHRariNdTMGAO9AAASz8TDAAA=')",
  "@odata.etag": "W/\"CQAAABYAAAAmP1Ln1wcHRariNdTMGAO9AAAS0AIS\"",
  "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEJAACd9nJ-tVysQos2hTfspaWRAAADT8DtAAA=",
  "ChangeKey": "CQAAABYAAACd9nJ/tVysQos2hTfspaWRAAADTJqP",
  "Categories": [],
  "DateTimeCreated": "2014-10-20T00:13:21Z",
  "DateTimeLastModified": "2014-10-20T00:13:23Z",
  "Subject": "Contract Signing",
  "BodyPreview": "There will be a detailed legal review of Project Falcon once the contract is ready.",
  "Body": {
    "ContentType": "Text",
    "Content": "There will be a detailed legal review of Project Falcon once the contract is ready."
  },
  "Importance": "Normal",
  "HasAttachments": false,
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAA=",
  "From": {
    "EmailAddress": {
      "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Alex D"
    }
  },
  "Sender": {
    "EmailAddress": {
      "Address": "alexd@a830edad9050849NDA1.onmicrosoft.com",
      "Name": "Alex D"
    }
  },
  "ToRecipients": [
    {
      "EmailAddress": {
        "Address": "katiej@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Katie Jordan"
      }
    },
    {
      "EmailAddress": {
        "Address": "garthf@a830edad9050849NDA1.onmicrosoft.com",
        "Name": "Garth Fort"
      }
    }
  ],
  "CcRecipients": [],
  "BccRecipients": [],
  "ReplyTo": [],
  "ConversationId": "AAQkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAQAKjRc0YJSUBJpofjWgitxag=",
  "DateTimeReceived": "2014-10-20T00:13:21Z",
  "DateTimeSent": "2014-10-20T00:13:21Z",
  "IsDeliveryReceiptRequested": false,
  "IsReadReceiptRequested": false,
  "IsDraft": false,
  "IsRead": true
}

Response type

The new copy of the message.


Move or copy a message (Client)

Move a or copy a message by passing the ID of the destination folder to the MoveAsync or CopyAsync method.

This example assumes you already got the Outlook Services client, got the message ID, and got the desination folder ID.

IMessage messageToMove = await outlookClient.Me.Messages[messageId].ExecuteAsync();
await messageToMove.MoveAsync("AAMkADE3N...");
IMessage messageToCopy = await outlookClient.Me.Messages[messageId].ExecuteAsync();
await messageToCopy.CopyAsync("Inbox");

Get attachments

You can get an attachment collection or get an attachment.

REST API: Get an attachment collection (REST) | Get an attachment (REST)

Client libraries: Get one or more message attachments (Client)

Get an attachment collection (REST)

Required scope: Mail.Read or Mail.Write

Get the attachments from a particular message.

GET https://outlook.office365.com/api/v1.0/me/messages/{message_id}/attachments
Required parameterTypeDescription
URL parameters
message_idstringThe message ID.

Sample request

GET https://outlook.office365.com/api/v1.0/me/messages/AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAA=/attachments

Sample response

Status code: 200
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAA%3D')/Attachments",
  "value": [
    {
      "@odata.type": "#Microsoft.OutlookServices.FileAttachment",
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAA=')/Attachments('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAABEgAQANQEWV4bM8FIlPwxj4kShdM=')",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAABEgAQANQEWV4bM8FIlPwxj4kShdM=",
      "Name": "minutes.docx",
      "ContentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
      "Size": 11585,
      "IsInline": false,
      "DateTimeLastModified": "2014-10-20T00:41:52Z",
      "ContentId": null,
      "ContentLocation": null,
      "IsContactPhoto": false,
      "ContentBytes": "UEsDBBQABgAIAAAAIQDfpNJsWgEAACAFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAoBEAAHdvcmQvc2V0dGluZ3MueG1sUEsBAi0AFAAGAAgAAAAhABmPyz/EAQAA7QQAABIAAAAAAAAAAAAAAAAAeRUAAHdvcmQvZm9udFRhYmxlLnhtbFBLAQItABQABgAIAAAAIQBbbf2TCQEAAPEBAAAUAAAAAAAAAAAAAAAAAG0XAAB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQB8xQ5SbAEAAMICAAAQAAAAAAAAAAAAAAAAAKgYAABkb2NQcm9wcy9hcHAueG1sUEsBAi0AFAAGAAgAAAAhAAR0pPJvAQAA8QIAABEAAAAAAAAAAAAAAAAAShsAAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhAAtGahAbCwAABHAAAA8AAAAAAAAAAAAAAAAA8B0AAHdvcmQvc3R5bGVzLnhtbFBLBQYAAAAACwALAMECAAA4KQAAAAA="
    }
  ]
}

Response type

The file attachment or item attachment collection for the message.

Note By default, each attachment in the response includes all its properties corresponding to that attachment type. Use $select to specify only those properties you need for best performance. The Id property is always returned. See OData query parameters for filtering, sorting, and paging parameters.

The following example shows how to use $select to specify returning only the Name property of each file attachment in the response.

GET https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE1M2IyNGNmLTI5MTktNDUyZi1iOTVlLTY0YjcxZWUzNTE1MABGAAAAAADBl2ZeO-NJTqt5NqHlVnKVBwCY4MQpaFz9SbqUDe4_bs88AAAAAAEMAACY4MQpaFz9SbqUDe4_bs88AAAHt60GAAA=/attachments?$select=Name

Get an attachment (REST)

Required scope: Mail.Read or Mail.Write

Get an attachment from a particular message.

GET https://outlook.office365.com/api/v1.0/me/messages/{message_id}/attachments/{attachment_id}

Note See OData query parameters for filtering, sorting, and paging parameters.

Required parameterTypeDescription
URL parameters
message_idstringThe message ID.
attachment_idstringThe attachment ID.

Sample request

GET https://outlook.office365.com/api/v1.0/me/messages/AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAA=/attachments/AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAABEgAQANQEWV4bM8FIlPwxj4kShdM=

Sample response

Status code: 200
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Messages('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAA%3D')/Attachments/$entity",
  "@odata.type": "#Microsoft.OutlookServices.FileAttachment",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Messages('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAA=')/Attachments('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAABEgAQANQEWV4bM8FIlPwxj4kShdM=')",
  "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQBGAAAAAADUuTJK1K9aTpCdqXop_4NaBwCd9nJ-tVysQos2hTfspaWRAAAAAAEMAACd9nJ-tVysQos2hTfspaWRAAADTHVSAAABEgAQANQEWV4bM8FIlPwxj4kShdM=",
  "Name": "minutes.docx",
  "ContentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "Size": 11585,
  "IsInline": false,
  "DateTimeLastModified": "2014-10-20T00:41:52Z",
  "ContentId": null,
  "ContentLocation": null,
  "IsContactPhoto": false,
  "ContentBytes": "UEsDBBQABgAIAAAAIQDfpNJsWgEAACAFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0lMtuwjAQRfeV+g+Rt1Vi6KKqKgKLPpYtUukHGHsCVv2Sx7z+vhMCUVUBkQpsIiUz994zVsaD0dqabA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AQAAAAAAAAAAAAAAAAAKgYAABkb2NQcm9wcy9hcHAueG1sUEsBAi0AFAAGAAgAAAAhAAR0pPJvAQAA8QIAABEAAAAAAAAAAAAAAAAAShsAAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhAAtGahAbCwAABHAAAA8AAAAAAAAAAAAAAAAA8B0AAHdvcmQvc3R5bGVzLnhtbFBLBQYAAAAACwALAMECAAA4KQAAAAA="
}

Response type

The requested file attachment or item attachment.

Note By default, the response includes all the properties of the attachment. Use $select to specify only those properties you need for best performance. The Id property is always returned. See OData query parameters for filtering, sorting, and paging parameters.


Get one or more message attachments (Client)

Get attachments on message by calling the Attachments property. To get a particular attachment, specify the attachment ID as the index of the Attachments collection or use the GetById method.

Note Attachment collections support query expressions such as Select, OrderBy, and Take.

This example calls the method that creates the Outlook Services client. The .NET code assumes you already got the message ID.

var outlookClient = await CreateOutlookClientAsync("Mail");
var messages = await outlookClient.Me.Folders["Inbox"].Messages
  .Where(m => m.HasAttachments == true)
  .Expand(m => m.Attachments)
  .Take(10)
  .ExecuteAsync();

foreach (var message in messages.CurrentPage)
{
  var attachments = message.Attachments.CurrentPage;
  System.Diagnostics.Debug.WriteLine("Message '{0}' contains '{1}' attachment(s).",
    message.Subject,
    attachments.Count);

  foreach (var attachment in attachments)
  {
    System.Diagnostics.Debug.WriteLine("*    '{0}' ({1} KB)",
      attachment.Name,
      attachment.Size);
  }
}
outlookClient.me.folders.getFolder('Inbox').messages.getMessages().filter('HasAttachments eq true').fetchAll(10).then(function (result) {
    result.forEach(function (message) {
        message.attachments.getAttachments().fetchAll(100).then(function (attachmentResult) {
            console.log('Message "' + message.subject + '" contains ' + attachmentResult.length + ' attachment(s)');
            attachmentResult.forEach(function (attachment) {
                console.log('*    "' + attachment.name + '" (' + attachment.size + ' KB)');
            });
        });
    }, function (error) {
        console.log(error);
    });
}, function (error) {
    console.log(error);
});

Create attachments

You can create a file attachment or create an item attachment for a message.

REST API: Create a file attachment (REST) | Create an item attachment (REST)

Create a file attachment (REST)

Required scope: Mail.Read or Mail.Write

Add a file attachment to a message.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/attachments
Required parameterTypeDescription
URL parameters
message_idstringThe message ID.
Body parameters
@odata.typestring#Microsoft.OutlookServices.FileAttachment
NamestringThe name of the attachment.
ContentBytesbinaryThe file to attach.

Specify the Name and ContentBytes parameters and any writable file attachment properties in the request body.

Response type

The new file attachment.


Create an item attachment (REST)

Required scope: Mail.Read or Mail.Write

Add an item attachment to a message.

POST https://outlook.office365.com/api/v1.0/me/messages/{message_id}/attachments
Required parameterTypeDescription
URL parameters
message_idstringThe message ID.
Body parameters
@odata.typestring#Microsoft.OutlookServices.ItemAttachment
NamestringThe name of the attachment.
ItemA Message or Event entity.The item to attach.

Specify the Name and Item parameters and any writable item attachment properties in the request body.

Response type

The new item attachment.


Delete attachments

Required scope: Mail.Read or Mail.Write

Delete a message attachment.

DELETE https://outlook.office365.com/api/v1.0/me/messages/{message_id}/attachments/{attachment_id}
Required parameterTypeDescription
URL parameters
message_idstringThe message ID.
attachment_idstringThe attachment ID.

Sample request

DELETE https://outlook.office365.com/api/v1.0/me/messages/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAAmP1Ln1wcHRariNdTMGAO9AAASz8S-AAA=/attachments/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MABGAAAAAAC_0WfqSjt_SqLtNkuO-bj1BwAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAAmP1Ln1wcHRariNdTMGAO9AAASz8S-AAABEgAQAG1aLWLNI65Iu36Ng67gL7o=

Sample response

Status code: 204
"none"

Get folders

You can get a folder collection or get a folder in the user's mailbox.

REST API: Get a folder collection (REST) | Get a folder (REST)

Client libraries: Get a folder or folder collection (Client)

Get a folder collection (REST)

Required scope: Mail.Read or Mail.Write

Get a folder collection. You can use the .../me/folders shortcut to get the top-level folder collection or navigate to another folder.

GET https://outlook.office365.com/api/v1.0/me/folders
GET https://outlook.office365.com/api/v1.0/me/folders/{folder_id}/childfolders

Note See OData query parameters for filtering, sorting, and paging parameters.

Required parameterTypeDescription
URL parameters
folder_idstringThe folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name, if you're getting folders from a specific folder.

Sample request

GET https://outlook.office365.com/api/v1.0/me/folders

Sample response

Status code: 200
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Folders",
  "value": [
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEfAAA=')",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEfAAA=",
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEIAAA=",
      "DisplayName": "Conversation Action Settings",
      "ChildFolderCount": 0
    },
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEKAAA=')",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEKAAA=",
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEIAAA=",
      "DisplayName": "Deleted Items",
      "ChildFolderCount": 0
    },
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEPAAA=')",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEPAAA=",
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEIAAA=",
      "DisplayName": "Drafts",
      "ChildFolderCount": 0
    },
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEMAAA=')",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEMAAA=",
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEIAAA=",
      "DisplayName": "Inbox",
      "ChildFolderCount": 0
    },
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEQAAA=')",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEQAAA=",
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEIAAA=",
      "DisplayName": "Journal",
      "ChildFolderCount": 0
    },
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEeAAA=')",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEeAAA=",
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEIAAA=",
      "DisplayName": "Junk Email",
      "ChildFolderCount": 0
    },
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAERAAA=')",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAERAAA=",
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEIAAA=",
      "DisplayName": "Notes",
      "ChildFolderCount": 0
    },
    {
      "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAELAAA=')",
      "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAELAAA=",
      "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEIAAA=",
      "DisplayName": "Outbox",
      "ChildFolderCount": 0
    }
  ]
}

Response type

The requested folder collection.


Get a folder (REST)

Required scope: Mail.Read or Mail.Write

Get a folder by ID.

GET https://outlook.office365.com/api/v1.0/me/folders/{folder_id}

Note See OData query parameters for filtering, sorting, and paging parameters.

Required parameterTypeDescription
URL parameters
folder_idstringThe folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.

Sample request

GET https://outlook.office365.com/api/v1.0/me/folders/sentitems

Sample response

Status code: 200
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Folders/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEJAAA=')",
  "Id": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEJAAA=",
  "ParentFolderId": "AAMkAGI2NGVhZTVlLTI1OGMtNDI4My1iZmE5LTA5OGJiZGEzMTc0YQAuAAAAAADUuTJK1K9aTpCdqXop_4NaAQCd9nJ-tVysQos2hTfspaWRAAAAAAEIAAA=",
  "DisplayName": "Sent Items",
  "ChildFolderCount": 0
}

Response type

The requested folder.


Get a folder or folder collection (Client)

Get the top-level folders in the mailbox by using the Me.Folders shortcut property. To get the folders from a specific folder, use its ChildFolders property. You can use the following well-known folder names instead of the ID for the corresponding folder: Inbox, SentItems, Drafts, DeletedItems.

Example: outlookClient.Me.Folders["Drafts"].ChildFolders.ExecuteAsync()

To get a particular folder, specify the folder ID as the index of the Folders collection or use the GetById method.

Note Folder collections support query expressions such as Select, OrderBy, and Take.

This example calls the method that gets the Outlook Services client.

var outlookClient = await CreateOutlookClientAsync("Mail");
var mailFolders = await outlookClient.Me.Folders
  .Take(10)
  .ExecuteAsync();

foreach(var mailFolder in mailFolders.CurrentPage)
{
  System.Diagnostics.Debug.WriteLine("Mail folder '{0}'.", mailFolder.DisplayName);
}
outlookClient.me.folders.getFolders().fetchAll(100).then(function (result) {
    result.forEach(function (folder) {
        console.log('Folder "' + folder.displayName + '"');
    });
}, function (error) {
    console.log(error);
});

Create folders

Add a new folder to a folder collection.

REST API: Create a folder (REST)

Client libraries: Create a folder (Client)

Create a folder (REST)

Required scope: Mail.Write

Create a child folder by the name specified in DisplayName. DisplayName is the only writable property for a folder.

POST https://outlook.office365.com/api/v1.0/me/folders/{folder_id}/childfolders
Required parameterTypeDescription
URL parameters
folder_idstringThe folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.
Body parameters
DisplayNamestringThe display name of the folder.

Sample request

POST https://outlook.office365.com/api/v1.0/me/folders/inbox/childfolders
Content-Type: application/json
{
  "DisplayName": "Company"
}

Sample response

Status code: 201
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Folders('inbox')/ChildFolders/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=')",
  "Id": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=",
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAA=",
  "DisplayName": "Company",
  "ChildFolderCount": 0
}

Response type

The new folder.

Remarks

You can't create a top-level folder. You can only add a folder to a childfolders endpoint.


Create a folder (Client)

Create a Folder object and pass it to the AddFolderAsync method on the destination folder's ChildFolders collection.

This example assumes you already got the Outlook Services client and got the folder ID of the parent folder.

Folder newFolder = new Folder
{
    DisplayName = "Private"
};
await outlookClient.Me.Folders["Inbox"].ChildFolders.AddFolderAsync(newFolder);

// Get the ID of the new folder.
string folderId = newFolder.Id;

Update folders

Change a folder name.

REST API: Update a folder (REST)

Client libraries: Update a folder (Client)

Update a folder (REST)

Required scope: Mail.Write

Change the folder name to that specified in DisplayName. The name is the only writable property for a folder.

PATCH https://outlook.office365.com/api/v1.0/me/folders/{folder_id}
Required parameterTypeDescription
URL parameters
folder_idstringThe folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.
Body parameters
DisplayNamestringThe new display name of the folder.

Sample request

PATCH https://outlook.office365.com/api/v1.0/me/folders/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=
Content-Type: application/json
{
  "DisplayName": "Business"
}

Sample response

Status code: 200
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Folders/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=')",
  "Id": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=",
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAA=",
  "DisplayName": "Business",
  "ChildFolderCount": 0
}

Response type

The updated folder.


Update a folder (Client)

Change a folder name. DisplayName is the only writeable property for a folder.

This example assumes you already got the Outlook Services client and got the folder ID.

IFolder folder = await outlookClient.Me.Folders[folderId].ExecuteAsync();
folder.DisplayName = "Personal";
await folder.UpdateAsync();

// Get the updated property.
string updatedName = folder.DisplayName;

You can define multiple updates client-side and send the requests all at once (batch them) by using the following pattern:

  1. Call UpdateAsync(true) for each entity you want to update. Specifying true registers the updates locally on the client but doesn't post them to the server.
  2. Call outlookClient.Context.SaveChangesAsync() to post all updates that are registered locally.

Delete folders

Delete a folder and all of its contents.

Note Be careful when you delete folders. Deleted contents might not be recoverable. To learn more, see Deleting items.

REST API: Delete a folder (REST)

Client libraries: Delete a folder (Client)

Delete a folder (REST)

Required scope: Mail.Write

Delete the folder specified in folder_id.

DELETE https://outlook.office365.com/api/v1.0/me/folders/{folder_id}
Required parameterTypeDescription
URL parameters
folder_idstringThe folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.

Sample request

DELETE https://outlook.office365.com/api/v1.0/me/folders/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=

Sample response

Status code: 204
"none"

Delete a folder (Client)

Delete a folder by its ID and calling DeleteAsync.

This example assumes you already got the Outlook Services client and got the folder ID.

IFolder folder = await outlookClient.Me.Folders[folderId].ExecuteAsync();
await folder.DeleteAsync();

Move or copy folders

You can move or copy a folder to another folder.

REST API: Move a folder (REST) | Copy a folder (REST)

Client libraries: Move or copy a folder (Client)

Move a folder (REST)

Required scope: Mail.Write

Move a folder and its contents to another folder by using the Move method.

POST https://outlook.office365.com/api/v1.0/me/folders/{folder_id}/move
Required parameterTypeDescription
URL parameters
folder_idstringThe folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.
Body parameters
DestinationIdstringThe destination folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.

Sample request

POST https://outlook.office365.com/api/v1.0/me/folders/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=/move
Content-Type: application/json
{
  "DestinationId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAOyxQ9AAA="
}

Sample response

Status code: 201
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Folders/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=')",
  "Id": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=",
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAOyxQ9AAA=",
  "DisplayName": "Business",
  "ChildFolderCount": 0
}

Response type

The folder that was moved.


Copy a folder (REST)

Required scope: Mail.Write

Copy a folder and its contents to another folder by using the Copy method.

POST https://outlook.office365.com/api/v1.0/me/folders/{folder_id}/copy
Required parameterTypeDescription
URL parameters
folder_idstringThe folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.
Body parameters
DestinationIdstringThe destination folder ID, or the Inbox, Drafts, SentItems, or DeletedItems well-known folder name.

Sample request

POST https://outlook.office365.com/api/v1.0/me/folders/AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-l_AAA=/copy
Content-Type: application/json
{
  "DestinationId": "inbox"
}

Sample response

Status code: 201
{
  "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Folders/$entity",
  "@odata.id": "https://outlook.office365.com/api/v1.0/Users('alexd@a830edad9050849NDA1.onmicrosoft.com')/Folders('AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-mAAAA=')",
  "Id": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAASz-mAAAA=",
  "ParentFolderId": "AAMkAGE0MGM1Y2M5LWEzMmUtNGVlNy05MjRlLTk0YmJjYzVkN2I5MAAuAAAAAAC_0WfqSjt_SqLtNkuO-bj1AQAmP1Ln1wcHRariNdTMGAO9AAAAAAEMAAA=",
  "DisplayName": "Business",
  "ChildFolderCount": 0
}

Response type

The new copy of the folder.


Move or copy a folder (Client)

Move or copy a folder by passing the ID of the destination folder to the MoveAsync or CopyAsync method.

This example assumes you already got the Outlook Services client and got the folder ID of the folder to move and the destination folder.

IFolder folder = await outlookClient.Me.Folders[folderId].ExecuteAsync();
await folder.MoveAsync("AAMkADE3N...");
IFolder folder = await outlookClient.Me.Folders[folderId].ExecuteAsync();
await folder.CopyAsync("Inbox");

Next steps

Whether you're ready to start building an app or just want to learn more, we've got you covered.

Or, learn more about using the Office 365 platform: