I am trying to add message forwarding rule for a user but it is not working.

Rahul Dewangan 21 Reputation points
2020-11-24T12:47:24.423+00:00

API : https://graph.microsoft.com/v1.0/users/rahul.dewangan@k4mobility.com/mailFolders/inbox/messageRules

request body : {
"displayName": "From partner",
"sequence": 2,
"isEnabled": true,
"conditions": {
"isAutomaticForward": true
},
"actions": {
"forwardTo": [
{
"emailAddress": {
"name": "Rahul Dewangan",
"address": "rahul.dewangan@truminds.com"
}
}
],
"stopProcessingRules": true
}
}

I am getting response as expected but rule is not added.42104-screenshot-from-2020-11-24-18-12-11.jpg

See in the screenshot Email forwarding NONE

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,733 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,221 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,373 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Deva-MSFT 2,256 Reputation points Microsoft Employee
    2020-11-24T19:03:44.097+00:00

    I tried the above payload, steps and it works for me!!

    (1) Create a new rule using Graph API

    POST https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messageRules  
    Content-type: application/json  
      
    {        
        "displayName": "From partner",        
        "sequence": 2,        
        "isAutomaticForward": true,            
         "actions": {  
            "forwardTo": [  
              {  
                 "emailAddress": {  
                    "name": "Alex Wilbur",  
                    "address": "AlexW@contoso.onmicrosoft.com"  
                  }  
               }  
            ],  
            "stopProcessingRules": true  
         }      
    }  
    

    (2) Test whether the rule is working or not.

    Result: It's working as expected

    (3) Check that the above rule shows or not (as part of Outlook.office.com or Outlook UI's rule section)
    Adding a snapshot that i captured from Outlook.office.com, mailbox settings!!

    42281-image.png