Request

Fetches the tree structure of a content item, its parents, or its children. Use this endpoint when you know the identifier of the root item, for example, if you want to fetch the structure of a treelist field with a defined content item source.

Security
Bearer
Path
contentItemIdstringrequired

The identifier of the content item root item.

Example:3875AC96-8ECF-44AE-8E25-851068B373CE
Query
ChildrenModelIdsArray of strings

Identifiers of the child content types (base templates). Only child content items of the content types specified by these ids will be returned.

Example:ChildrenModelIds=4cf51e95-ee7e-4ad6-a69f-e4d740b03616&ChildrenModelIds=d9584f11-07d3-4cda-8373-7f97ceedbc09&ChildrenModelIds=4cf51e95-ee7e-4ad6-a69f-e
Languagestring

The language of the content items

Example:Language=en
environmentIdstring

The environment identifier. Defaults to "main". Currently only "main" is supported.

Example:environmentId=main
curl -i -X GET \
  'https://edge-platform.sitecorecloud.io/authoring/api/v1/content-items/3875AC96-8ECF-44AE-8E25-851068B373CE/hierarchy?ChildrenModelIds=4cf51e95-ee7e-4ad6-a69f-e4d740b03616%2Cd9584f11-07d3-4cda-8373-7f97ceedbc09&Language=en&environmentId=main' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Successful operation

Bodyapplication/json
hasChildrenboolean

Whether the content item has any child pages.

Example:true
hasPresentationboolean

Whether the content item has presentation. An item with presentation is an item with a layout assigned.

Example:true
childrenArray of objects or null(HierarchyItem)

Child content items, represented as "HierarchyItem" objects. Each object has the same structure as the root content item in the response.

Example:
[ { "hasChildren": false, "hasPresentation": false, "children": null, "ancestors": null, "insertOptions": null, "baseContentModels": null, "id": "059a5e63-6fca-44ea-be8b-e0b7919895f6", "name": "My item", "displayName": "Home", "language": "en", "version": 0, "templateId": "76036f5e-cbce-46d1-af0a-4143f9b557aa", "path": "/sitecore/content/Home/item", "permissions": {}, "system": {} } ]
ancestorsArray of objects or null(HierarchyItem)

Ancestor content items, represented as "HierarchyItem" objects. Each object has the same structure as the root content item in the response.

Example:
[ { "hasChildren": true, "hasPresentation": false, "children": null, "ancestors": null, "baseContentModels": [ … ], "id": "3875AC96-8ECF-44AE-8E25-851068B373CE", "insertOptions": null, "name": "sitecore", "displayName": "sitecore", "language": "en", "version": 1, "templateId": "c6576836-910c-4a3d-ba03-c277dbd3b827", "path": "/sitecore", "permissions": {}, "system": {} } ]
insertOptionsArray of objects or null(BaseContentModel)

Insert options of the content item. Insert options control which types of new items can be created beneath a specific item in the content tree.

baseContentModelsArray of strings or null

Base content type IDs of the content item.

allowedContentTypesArray of objects or null(BaseContentModel)

The allowed content types for the content item.

idstring or null

The content item identifier.

Example:"37265ed7-85cf-4876-9c09-b6590fc6cf3a"
namestring or null

The content item name.

Example:"My content item"
displayNamestring or null

The content item display name.

Example:"My content item display name"
languagestring or null

The content item language.

Example:"en"
versioninteger, (int32)

The content item version.

Example:1
templateIdstring or null

The template identifier.

Example:"97265ed7-85cf-4876-9c09-b6590fc6cf3a"
pathstring or null

The content item path

Example:"/sitecore/content/Home"
permissionsobject(Permissions)

The access rights of the current user to the site.

systemobject(System)
Response
{ "hasChildren": true, "hasPresentation": true, "children": [ { … } ], "ancestors": [ { … } ], "insertOptions": [ { … } ], "baseContentModels": [ "string" ], "allowedContentTypes": [ { … } ], "id": "37265ed7-85cf-4876-9c09-b6590fc6cf3a", "name": "My content item", "displayName": "My content item display name", "language": "en", "version": 1, "templateId": "97265ed7-85cf-4876-9c09-b6590fc6cf3a", "path": "/sitecore/content/Home", "permissions": { "canAdmin": true, "canWrite": true, "canCreate": true, "canDelete": true, "canRename": true, "canRead": true, "canPublish": true, "canDuplicate": true, "canWriteLanguage": true }, "system": { "created": "2024-01-15T10:30:00Z", "createdBy": "sitecore admin", "updated": "2024-01-15T10:30:00Z", "updatedBy": "sitecore admin" } }