Microsoft 365 profile card customization using Microsoft Graph API

Finally Microsoft comes with solution to customize the people profile card in Microsoft 365 using Microsoft Graph API. Using this solution, you can existing user properties from Azure AD and custom attributes to the profile card. The real beauty is that it involves zero code. So, your tenant administrator can customize the user profile card using Graph Explorer itself.

What is profile card customization?

Administrators can customize people’s profile cards by adding Azure AD properties and custom attributes. Using this feature you can customize the profile card with important information such as Employee ID, Cost Centre, Division name, etc.. It is available in Beta endpoint of Microsoft Graph API.

What are the additional attributes can added in the profile card

Currently Microsoft support following set of attributes to add in the profile card

How to add the attribute in profile card using Microsoft Graph API

We are going to use profileCardProperties resource in Graph API to update the profile card. This requires Global administrator rights. Log in to Microsoft Graph explorer with Global administrator account and enable the following permissions

After enabling the above permissions, run the below query in the Graph Explorer. In this API, we need to change Tenant id with yours and we can get tenant Id from Azure AD console.

Note: You can add one profileCardProperty resource at a time. Takes up to 24 hours for the changes to show on profile card. So, to add multiple attributes to profile card you need to make one request for each attribute to add.

Adding Azure AD attributes

API :https://Graph.microsoft.com/beta/organization/{tenantid}/settings/profileCardProperties
Method : Post
 Body : 
 {
 ”directoryPropertyName”: “Alias”
}

Adding Custom attributes

When we are adding the custom attribute in the profile card, we need to define the display name for custom attribute to show in the profile card.

API : https://Graph.microsoft.com/beta/organization/{tenantid}/settings/profileCardProperties
Method : Post 
Body : 
 { 
“directoryPropertyName”: “customAttribute1”,
“annotations”: [
{
“displayName”: “Cost center”,
}
]
}

User Experience

Before modifying the profile card

After modifying the profile card

The additional attributes are listed in the Contact section of the profile card.

Additional Microsoft resources