Skip to main content

spo contenttype sync

Adds a published content type from the content type hub to a site or syncs its latest changes.

Usage

m365 spo contenttype sync [options]

Options

-u, --webUrl <webUrl>

The site to sync the Content Type to.

-i, --id [id]

The Id of the published Content Type to sync from the Content Type Hub. Specify either id or name.

-n, --name [name]

The name of the published Content Type to sync from the Content Type Hub. Specify either id or name.

--listTitle [listTitle]

Title of the list. Specify either listTitle, listId or listUrl. Omit to sync as a site content type.

--listId [listId]

ID of the list. Specify either listTitle, listId or listUrl. Omit to sync as a site content type.

--listUrl [listUrl]

Server- or site-relative URL of the list. Specify either listTitle, listId or listUrl. Omit to sync as a site content type.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Examples

Syncs a given published content type from the hub to the specified site.

m365 spo contenttype sync —webUrl https://contoso.sharepoint.com/sites/sales --id 0x01007926A45D687BA842B947286090B8F67D

Syncs a given published content type from the hub to the specified site and adds it to the specified list.

m365 spo contenttype sync —webUrl https://contoso.sharepoint.com/sites/sales --id 0x01007926A45D687BA842B947286090B8F67D --listTitle Contacts

Response

info

This command will only return a response if the content type is added to the site initially. When syncing the content type, no response is returned.

{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#contentType",
"@odata.type": "#microsoft.graph.contentType",
"@odata.etag": "\"2\"",
"id": "0x0101003D510887202C894AB7CD88CCE011519D",
"isBuiltIn": false,
"description": "",
"group": "Custom Content Types",
"hidden": false,
"name": "Dummy",
"parentId": "0x0101",
"readOnly": true,
"sealed": false,
"base": {
"id": "0x0101",
"description": "Create a new document.",
"group": "Document Content Types",
"hidden": false,
"name": "Document",
"readOnly": false,
"sealed": false
}
}
CTRL + M