Skip to content

spo list contenttype add

Adds content type to list

Usage

spo list contenttype add [options]

Options

Option Description
--help output usage information
-u, --webUrl <webUrl> URL of the site where the list is located
-l, --listId [listId] ID of the list to which to add the content type. Specify listId or listTitle but not both
-t, --listTitle [listTitle] Title of the list to which to add the content type. Specify listId or listTitle but not both
-c, --contentTypeId <contentTypeId> ID of the content type to add to the list
-o, --output [output] Output type. json|text. Default text
--verbose Runs command with verbose logging
--debug Runs command with debug logging

Important

Before using this command, log in to SharePoint, using the spo login command.

Remarks

To add existing content type to a list, you have to first log in to SharePoint using the spo login command, eg. spo login https://contoso.sharepoint.com.

Examples

Add existing content type with ID 0x0120 to the list with ID 0cd891ef-afce-4e55-b836-fce03286cccf located in site https://contoso.sharepoint.com/sites/project-x

spo list contenttype add --webUrl https://contoso.sharepoint.com/sites/project-x --listId 0cd891ef-afce-4e55-b836-fce03286cccf --contentTypeId 0x0120

Add existing content type with ID 0x0120 to the list with title Documents located in site https://contoso.sharepoint.com/sites/project-x

spo list contenttype add --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle Documents --contentTypeId 0x0120