Graph API introduces a transitiveReports endpoint for users and contacts

After a long overdue vacation, I took a look at the Graph API changelog in order to catch up with any new developments. One of the things that caught my eye was the new transitiveReports endpoint, which should nicely complement the already available directReports and manager endpoints. The latter in particular can be used together with the $expand and $levels operators to provide a chain list of managers, or in other words a “transitive” list. Now, thanks to the transitiveReports endpoint, we can do the same in the opposite direction. Well, eventually.

Since this endpoint is only available in /beta currently, it’s functionality is a bit limited. In fact, all you can do currently is get the number of direct reports, and not the actual objects themselves. In other words, currently the only working query is one that includes the $count operator, in addition to the required ConsistencyLevel=’eventual’ header. Here’s an example query:

https://graph.microsoft.com/beta/users/58412b38-888c-1b85-8871-c9766cb4791b/transitiveReports/$count

and how it looks like inside Graph explorer:

While this might seem rather useless for the time being, my hope here is that we will eventually be able to run a similar query to get the full list of reports, hopefully by also specifying a level value, similarly to how the manager endpoint works. This in turn will allow for easy just-in-time querying of managerial relationships within the organization, without having to run repeated queries for each individual up/down the chain.

For additional information on the endpoint as well as any future updates, keep an eye on the official documentation.

This entry was posted in Azure AD, Graph API. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.