KPI Groups endpoints

The Kpigroups endpoints enable you to retrieve, create, update, or delete KPI Groups. KPI groups combine several KPIs in one place for better organization. For more information about KPI Groups check our Use KPI groups help article.

🔗
get
/kpis/groups
Gets all existing KPI groups in the account.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
Expected response codes
200kpiGroupsWithTotalCount
400bad request
401unauthorized
403forbidden
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v1/kpis/groups' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/groups", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/kpis/groups"



requests.get(url, headers = headers)
{
    "count": 2,
    "items": [
        {
            "accountId": "string value",
            "createdById": "string value",
            "dateCreated": "string value",
            "dateUpdated": "string value",
            "favorite": false,
            "id": "string value",
            "modifiedById": "string value",
            "name": "string value"
        }
    ],
    "totalCount": 2
}
🔗
get
/kpis/groups/{groupId}
Gets an existing KPI group by its unique identifier (id).
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
groupId
*
stringThe unique identifier of the KPI group.
expected in path
Expected response codes
200kpiGroup
400bad request
401unauthorized
403forbidden
404not found
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v1/kpis/groups/{groupId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}"



requests.get(url, headers = headers)
{
    "accountId": "string value",
    "createdById": "string value",
    "dateCreated": "string value",
    "dateUpdated": "string value",
    "favorite": false,
    "id": "string value",
    "modifiedById": "string value",
    "name": "string value"
}
🔗
post
/kpis/groups
Creates a new KPI group.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
createKpiGroupRequest
*
objectThe object representing the KPI Group to be created.
expected in body, sample value:
{
    "name": "string value"
}
Expected response codes
201kpiGroup
400bad request
401unauthorized
403forbidden
500internal server error

curl -X POST 'https://app.gtmhub.com/api/v1/kpis/groups' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"name":"string value"}'

var body ={ "name": "string value" };

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/groups", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/kpis/groups"

body = { "name": "string value" };

requests.post(url, data=json.dumps(body), headers = headers)
{
    "accountId": "string value",
    "createdById": "string value",
    "dateCreated": "string value",
    "dateUpdated": "string value",
    "favorite": false,
    "id": "string value",
    "modifiedById": "string value",
    "name": "string value"
}
🔗
put
/kpis/groups/{groupId}/favorite
Add a KPI group to favorites of the current user.
Parameters
NameTypeDescription
Expected response codes
200ok
400bad request
401unauthorized
404not found
500internal server error

curl -X PUT 'https://app.gtmhub.com/api/v1/kpis/groups/{groupId}/favorite' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}/favorite", "method": "PUT", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}/favorite"



requests.put(url, headers = headers)
🔗
put
/kpis/{kpiId}/groups/{groupId}
Adds an existing KPI to an existing group.
No request object required.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
kpiId
*
stringThe unique identifier (id) of the KPI.
expected in path
groupId
*
stringThe unique identifier of the KPI group.
expected in path
Expected response codes
200ok
400bad request
401unauthorized
403forbidden
404not found
500internal server error

curl -X PUT 'https://app.gtmhub.com/api/v1/kpis/{kpiId}/groups/{groupId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/{kpiId}/groups/{groupId}", "method": "PUT", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/kpis/{kpiId}/groups/{groupId}"



requests.put(url, headers = headers)
🔗
patch
/kpis/groups/{groupId}
Partially updates an existing KPI group.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
groupId
*
stringThe unique identifier of the KPI group.
expected in path
updateKpiGroupRequest
*
objectThis object represents the attributes of the KPI Group to be updated.
expected in body, sample value:
{
    "name": "string value"
}
Expected response codes
200ok
400bad request
401unauthorized
403forbidden
404not found
500internal server error

curl -X PATCH 'https://app.gtmhub.com/api/v1/kpis/groups/{groupId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"name":"string value"}'

var body ={ "name": "string value" };

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}", "method": "PATCH", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}"

body = { "name": "string value" };

requests.patch(url, data=json.dumps(body), headers = headers)
🔗
delete
/kpis/groups/{groupId}
Deletes an existing KPI group.
No request object required.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
groupId
*
stringThe unique identifier of the KPI group.
expected in path
Expected response codes
200ok
400bad request
401unauthorized
403forbidden
404not found
500internal server error

curl -X DELETE 'https://app.gtmhub.com/api/v1/kpis/groups/{groupId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}", "method": "DELETE", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}"



requests.delete(url, headers = headers)
🔗
delete
/kpis/groups/{groupId}/favorite
Removes a KPI group from favorites of the current user.
Parameters
NameTypeDescription
Expected response codes
200ok
400bad request
401unauthorized
404not found
500internal server error

curl -X DELETE 'https://app.gtmhub.com/api/v1/kpis/groups/{groupId}/favorite' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}/favorite", "method": "DELETE", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/kpis/groups/{groupId}/favorite"



requests.delete(url, headers = headers)
🔗
delete
/kpis/{kpiId}/groups/{groupId}
Removes an existing KPI from an existing group.
No request object required.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
kpiId
*
stringThe unique identifier (id) of the KPI.
expected in path
groupId
*
stringThe unique identifier of the KPI group.
expected in path
Expected response codes
200ok
400bad request
401unauthorized
403forbidden
404not found
500internal server error

curl -X DELETE 'https://app.gtmhub.com/api/v1/kpis/{kpiId}/groups/{groupId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/{kpiId}/groups/{groupId}", "method": "DELETE", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/kpis/{kpiId}/groups/{groupId}"



requests.delete(url, headers = headers)