Example: Create a Topic Hierarchy in Experience Cloud Sites

This example creates a topic hierarchy in an Experience Cloud site.

Example 1: Create a Hierarchy with Managed Topics 

Step 1: Identify or Create the Parent Topic 

The parent topic must be a navigational managed topic.

Resource 

/connect/communities/{communityId}/managed-topics

HTTP method 

GET to retrieve a list of navigational managed topics to identify the parent topic.

POST to create a parent topic. Community managers (users with the Create and Set Up Experiences or Manage Experiences permission) can create managed topics.

Response body for GET 

Managed Topic Collection

Make a note of the ID of the navigational managed topic you want to be the parent topic. It has a prefix of 0mt.

Request body for POST 

Managed Topic Input

Request body example for POST 

1{
2"name":"Parent Topic",
3"managedTopicType":"Navigational"
4}

Response body for POST 

Managed Topic

Make a note of the ID of the parent topic you created. It has a prefix of 0mt.

Step 2: Create the Child Topic and Link to the Parent in a Hierarchy 

In this step, create a managed child topic and link it to its parent in one step.

Resource 

/connect/communities/{communityId}/managed-topics

HTTP method 

POST

Community managers (users with the Create and Set Up Experiences or Manage Experiences permission) can create managed topics.

Request body 

Managed Topic Input

Request body example 

Use the navigational managed topic ID from Step 1 as the parentId.

1{
2"name":"Child Topic",
3"managedTopicType":"Navigational",
4"parentId":"0mtR000000001KLIAY"
5}

Response body for POST 

Managed Topic

See the Hierarchy 

By default, the managed topic response body shows only the top level of a hierarchy. You can have up to three levels in your topic hierarchy. To see all the levels, use this resource and these parameters:

1/connect/communities/{communityId}/managed-topics?depth=3&managedTopicType=Navigational

Example 2: Create a Hierarchy with Managed and Standard Topics 

It’s also possible to use a standard topic, instead of a managed topic, to be the child topic, but this requires an additional step.

Step 1: Identify or Create the Parent Topic 

The parent topic must be a navigational managed topic.

Resource 

/connect/communities/{communityId}/managed-topics

HTTP method 

GET to retrieve a list of navigational managed topics to identify the parent topic.

POST to create a parent topic. Community managers (users with the Create and Set Up Experiences or Manage Experiences permission) can create managed topics.

Response body for GET 

Managed Topic Collection

Make a note of the ID of the navigational managed topic you want to be the parent topic. It has a prefix of 0mt.

Request body for POST 

Managed Topic Input

Request body example for POST 

1{
2"name":"Parent Topic",
3"managedTopicType":"Navigational"
4}

Response body for POST 

Managed Topic

Make a note of the ID of the parent topic you created. It has a prefix of 0mt.

Step 2: Identify or Create the Child Topic 

In this example, identify or create a standard topic, instead of a managed topic, to be the child topic.

Resource 

/connect/communities/{communityId}/topics

HTTP method 

GET to retrieve a list of topics to identify the child topic.

POST to create a child topic. Users with the Create Topics permission can create topics.

Response body for GET 

Topic Collection

Make a note of the ID of the topic you want to be the child topic. It has a prefix of 0TO.

Request body for POST 

Topic Input

Request body example for POST 

1{
2"description":"This topic will be a child topic of Parent Topic.",
3"name":"Child Topic"
4}

Response body for POST 

Topic

Make a note of the ID of the child topic you created. It has a prefix of 0TO.

Step 3: Link the Child and Parent Topic in a Hierarchy 

Resource 

/connect/communities/{communityId}/managed-topics

HTTP method 

POST

Request body 

Managed Topic Input

Request body example 

Use the managed topic ID from Example 2, Step 1 as the parentId and the topic ID from Example 2, Step 2 as the recordId.

1{
2"managedTopicType":"Navigational",
3"parentId":"0mtR000000001KLIAY",
4"recordId":"0TOD00000000cwk"
5}

Response body 

Managed Topic