How to Pull Custom Content Types from Hub Using Power Automate REST API

Return to the Insights Blog

Nov 11, 2023 | Microsoft 365

For years, SharePoint utilized the content type hub as a place where default and custom content types could live. The process of adding a custom content type from the hub to a site was simple. Add the content type to the hub, waiting up to 4 hours and all would be synced to each site across the tenant.

Well…that is no longer. In September 2021, Microsoft changed its content type publishing process which can be found in this Microsoft support article titled: What’s changed in content type publishing.

This article provides a better understanding of how the process used to work with pushing all content types to how it now works with a pull-as-needed approach. I would encourage you to read it for yourself, but here’s a quick jist to help us understand what has happened as simply running the AddAvailableContentType call won’t grab the content types anymore.

How to PULL Content Types In Power Automate

In the past, we could add a custom content type to a document library for example by waiting a few minutes or hours and then running the following REST API call in Power Automate. The content type would sync from the hub to the site and then you could just run a POST to AddAvailableContentType.

Uri: _api/web/lists/GetByTitle(‘Documents’)/ContentTypes/AddAvailableContentType

This won’t work by itself anymore. You have to PULL the content type from the hub and then add it to your library or list as the new publishing process doesn’t push all content types across the tenant as stated in the above Microsoft support article.

The Magic Power Automate Action to PULL Content Types

Ready?… Here it is, you must run the addCopyFromContentTypeHub parameter. Check out the Microsoft documentation for more info. I’ll break it down on how it works. 

Uri: _api/v2.0/[sites/sitename]/ContentTypes/addCopyFromContentTypeHub

Update the sites parameter with your site (/sites/yoursite).

Make sure you update the content type id in the body and watch as this action will pull your content type. Here are the overall actions used. Both pulling from the hub and adding the available content type as has always been the case.

Looking for an expert to help? Contact C5 Insight.

Search Posts

Recent Posts

Resource Categories

Books
Videos

Subscribe to The Insights

Stay ahead with C5 Insight's latest resources delivered straight to your inbox. We share expert insights on Microsoft business solutions (e.g., Copilot, Dynamics 365 CRM, Microsoft 365), business strategy, employee and customer engagement, upcoming events, and more.