What is SharePoint Online content type ID?

2024-11-23

What is SharePoint Online Content Type ID?

Content type IDs in SharePoint uniquely identify the content type, such as Item, Document, Announcement. An example of a content type ID is 0x01 which is an Item Content Type ID. Content types based on other content types are often called child content types.

They are designed to be recursive. The content type ID shows that content type’s lineage, or the line of parent content types from which the content type inherits. Each SharePoint content type ID contains the ID of the parent content type, which in turn contains the ID of that content type’s parent, and so on, ultimately back to and including the System content type ID. SharePoint uses this information to determine the relationship between content types and for push-down operations.

You can construct a valid SharePoint content type ID using one of two conventions:

  • Parent content type ID + two hexadecimal values (the two hexadecimal values cannot be “00”)
  • Parent content type ID + “00” + hexadecimal GUID


Source: https://msdn.microsoft.com/en-us/library/office/aa543822%28v=office.14%29.aspx?f=255&MSPPError=-2147217396

An ID of a custom content type based on Item, will look like this when using GUID approach:
0x01 - which is an Item Content Type ID
00 - a kinf of “space” to differentiate where the parent ends and where the child content type begins
9e862727eed04408b2599b25356e7914 - the hexadecimal value

Item Content Type ID following the convention the hexadecimal value 0x01 00 9e862727eed04408b2599b25356e7914 Altogether: 0x01009e862727eed04408b2599b25356e7914

You can create a guid automatically using Windows Powershell

[guid]::NewGuid()

You can also invent your own content type ID :) Using 0x0100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa works :) though it’s not exactly the best practice.

Each SharePoint content type ID must be unique within a SharePoint site collection. If the code you are writing does not specify the guid, SharePoint will assign one to the content type, based on the parent content type.



How to find SharePoint Online content type ID using UI

Navigate to list settings, under Advanced enable Content Type Management and read the content type ID from the URL:



Using REST API and Browser

There is a nice trick how you can use GET Rest API directly in the browser without creating scripts or applications.

Open your browser, log in to your tenant and enter the following URL:

https://TENANT.sharepoint.com/sites/SITENAME/_api/web/lists/getbytitle(‘LISTNAME’)/contenttypes

e.g. https://acco967.sharepoint.com/sites/EWZ/_api/web/lists/getbytitle(‘test1’)/contenttypes


You will get a lovely XML of all your content types (more lovely in Edge and Firefox than Chrome)





See Also

Find content type ID using Powershell