Microsoft Graph API list categories for shared mailbox

Joshua Gentes 106 Reputation points

Thank you for your time and attention. I am interested in locating where to view the categories list for a shared mailbox. I have an app registered, it has permissions MailboxSettings.ReadWrite, and my app is using as a reference for how view all existing categories, but the response shows the default category list, instead of the ones I see if I click on a message in my outlook client and then click on the "categories" menu button. The end goal is to dynamically manage categories (create/update/remove) associated with messages. I have tested the "update message api" and it will update the categories attribute as expected, however I wish for the categories to have a corresponding color scheme beyond just the default "grey" that gets assigned if a category does not already exist. It is my assumption then, that in order for these categories to have the appropriate color scheme ("preset#"), I need to modify the known categories for the mailbox, which is why I want to list the currently known ones, so I may apply modifications (creating new ones, updating color of existing ones, removing ones that are no longer necessary). I would appreciate a reference point on where I am able to get the necessary education to complete this workflow. Best!

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,715 questions
{count} vote

3 additional answers

Sort by: Most helpful
  1. JamesTran-MSFT 36,056 Reputation points Microsoft Employee

    @Joshua Gentes
    I was able to create, update, and remove categories within Outlook using the below API calls.

    I retrieved the whole list of categories using the below GET call and highlight my test category. For more info.



    I updated the existing category preset, however, you can't modify the displayName property once you have created the category. For more info.

    Request Body:  
        "color": "preset9"  


    I created a new category and deleted my existing test categories:

    Create a new category  
    Delete categories:  
    DELETE /me/outlook/masterCategories/{id}  


    Create Outlook Category
    Delete Outlook category

    I hope this helps! If you have any other questions, please let me know.
    Thank you again for your time and patience throughout this issue.

  2. Joshua Gentes 106 Reputation points

    This is perfect documentation,Thank you. I am looking for a user that is not "me" (it is a shared mailbox); pardon if I was not clear.

    GET /users/{id|userPrincipalName}/outlook/masterCategories

    I was using the "id" from /users to locate the shared mailbox, which from this appears as if it is appropriate.

    Trying to find ms graph auth token
    performing GET
    {"@odata.context": "$metadata#users('...')/outlook/masterCategories", "value": [{"id": "...", "displayName": "Red category", "color": "preset0"}, {"id": "...", "displayName": "Orange category", "color": "preset1"}, {"id": "...", "displayName": "Yellow category", "color": "preset3"}, {"id": "...", "displayName": "Green category", "color": "preset4"}, {"id": "...", "displayName": "Blue category", "color": "preset7"}, {"id": "...", "displayName": "Purple category", "color": "preset8"}]}

    When I click on an email letter within the Inbox of the SharedMailbox, and select from one of the top menus "categories > manage categories", I see the following.

  3. Joshua Gentes 106 Reputation points

    @JeffYang-MSFT I suggest that you do not reference anyone to that site. It's been over a week and there has been no replies.

    0 comments No comments