Add a Tag to the content system

{ addTag }

Adds a content Tag to the system so it can then be applied to content items



  • API Section: /API2/content
  • API Version: 2.0
  • From Release: 2018.5
  • Method operates via POST actions only.
  • Input Parameters



    Object Type


    The tag object used to capture a tag's settings.

    Output Response

    Successful Result Code


    Response Type

    Description of Response Type

    Generic API response object with success or failure flag and related messages.


    Tags need to be added to the system first before applying them to items. Use this method to add them, then use 'addTagToItem' to apply to a content item.

    Content and Tag Operations (JavaScript):

    This example demonstrates how to find item's and the manipulation of content tags.

    The example uses API authentication driven from JavaScript. See Authentication APIs for alternatives.

    // URL of the Pyramid installation and the path to the API 2.0 REST methods
    var pyramidURL = "";
    // step 1: authenticate admin account and get token
    // NOTE: callApi method is a generic REST method shown below.
    let token = callApi("auth/authenticateUser",{
    //step 2: add a tag to the system
    let addedTag = callApi("content/addTag ",{
    	"tagData": {
    	"auth": token
    let tagId =[0].id;
    //step 2: find/search for a Discover item called "sales figures"
    let dataDiscovery = callApi("content/findContentItem",{
    	"searchParams": {
    		"searchString": "sales figures",
    		"filterTypes": [3],
    		"searchMatchType": 2,
    	"auth": token // admin token generated above
    let itemId =[0].id;
    //step 3: bind the new tag to this report
    let itemIds = callApi("content/addTagToItem ",{
    	"tagUsageApiData": {
    	"auth": token
    //step 4: get a specific tag object using its tag id
    let getTag = callApi("content/getTag",{
    	"tagId": tagId,
    	"auth": token
    //step 5: remove the tag from a specific content item
    let removeTagFromItem = callApi("content/removeTagFromItem ",{
    	"tagUsageApiData": {
    	"auth": token
    //step 6: delete the tag
    let deleteTag = callApi("content/deleteTag ",{
    	"tagId": tagId,
    	"auth": token
    //step 7: permanently delete the content item
    let purgeContentItems = callApi("content/purgeContentItems",{
    	"auth": token
    // ##### optional generic logging method for debugging ##############
    function log(msg){
    // ##### generic REST API calling method ##############
    function callApi(path,data,parseResult=true){
    	var xhttp = new XMLHttpRequest();"POST", pyramidURL+path, false);
    		return JSON.parse(xhttp.responseText);
    		return xhttp.responseText;