KPIs endpoints

The Kpi endpoints enable you to retrieve, create, update, or delete Gtmhub KPIs. For more information about KPIs check our Create KPIs help article.

🔗
get
/insights/{id}/usages/kpis
Gets all used kpis for the chosen insight
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
Expected response codes
401unauthorized

curl -X GET 'https://app.gtmhub.com/api/v1/insights/{id}/usages/kpis' \ -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/insights/{id}/usages/kpis", "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/insights/{id}/usages/kpis"



requests.get(url, headers = headers)
🔗
get
/kpi-snapshots
Gets KPI snapshots for a given list of KPI unique identifiers (KPI ids).
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
ids
*
stringA comma-separated list of KPI unique identifiers (ids). Ex: 5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365
expected in query, sample value:
5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365
timeZonestringThe time zone for which to calculate snapshot groups.
expected in query, sample value:
UTC-2
groupBystringSpecifies how the snapshots to be grouped by.
expected in query, sample value:
string
fromstringGets the snapshots that start on this date only. Date format: YYYY-MM-DD
expected in query, sample value:
2020-05-02
tostringGets the snapshots that end on this date only. Date format: YYYY-MM-DD
expected in query, sample value:
2020-05-02
Expected response codes
401unauthorized

curl -X GET 'https://app.gtmhub.com/api/v1/kpi-snapshots?ids=5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365&timeZone=UTC-2&groupBy=string&from=2020-05-02&to=2020-05-02' \ -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/kpi-snapshots?ids=5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365&timeZone=UTC-2&groupBy=string&from=2020-05-02&to=2020-05-02", "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/kpi-snapshots"



requests.get(url, headers = headers)
🔗
get
/kpis
Loads all kpis using filter, sort and projection expressions coming from the request body
Parameters
NameTypeDescription
Expected response codes
200kpisWithTotalCount
401unauthorized

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

var settings = { "url": "https://app.gtmhub.com/api/v2/kpis", "method": "GET", "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/v2/kpis"



requests.get(url, headers = headers)
{
    "count": 2,
    "items": [
        {
            "accountId": "string value",
            "aggregation": "string value",
            "createdById": "string value",
            "dateCreated": "string value",
            "dateUpdated": "string value",
            "description": "string value",
            "formatting": {
                "fractionSize": 2,
                "prefix": "string value",
                "suffix": "string value"
            },
            "groups": [
                "string value 1",
                "string value 2"
            ],
            "id": "string value",
            "insightLink": {
                "fieldName": "string value",
                "insightName": "string value",
                "settings": [
                    {
                        "dynamicValues": [
                            {
                                "teamId": "ID",
                                "type": "DynamicValueType"
                            }
                        ],
                        "name": "string value",
                        "value": "string value",
                        "valueDisplayName": "string value"
                    }
                ]
            },
            "modifiedById": "string value",
            "name": "string value",
            "ownerId": "string value",
            "ownerIds": [
                "string value 1",
                "string value 2"
            ],
            "richTextDescription": "string value",
            "targetOperator": "string value"
        }
    ],
    "totalCount": 2
}
🔗
get
/kpis/snapshots
Gets KPI snapshots for a given list of KPI unique identifiers (KPI ids).
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
ids
*
stringA comma-separated list of KPI unique identifiers (ids). Ex: 5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365
expected in query, sample value:
5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365
timeZonestringThe time zone for which to calculate snapshot groups.
expected in query, sample value:
UTC-2
groupBystringSpecifies how the snapshots to be grouped by.
expected in query, sample value:
string
fromstringGets the snapshots that start on this date only. Date format: YYYY-MM-DD
expected in query, sample value:
2020-05-02
tostringGets the snapshots that end on this date only. Date format: YYYY-MM-DD
expected in query, sample value:
2020-05-02
Expected response codes
401unauthorized

curl -X GET 'https://app.gtmhub.com/api/v1/kpis/snapshots?ids=5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365&timeZone=UTC-2&groupBy=string&from=2020-05-02&to=2020-05-02' \ -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/snapshots?ids=5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365&timeZone=UTC-2&groupBy=string&from=2020-05-02&to=2020-05-02", "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/snapshots"



requests.get(url, headers = headers)
🔗
get
/kpis/{kpiId}
Gets an existing KPI by its unique identifier (id).
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
formattingstringThe formatting used for the description. By default it is returned as 'mentionsMarkup' and it can contain markdown and special markup for mentioned people. Use 'plainText' if you want the response without markdown and special markup.
expected in query, sample value:
string
Expected response codes
200kpi
401unauthorized

curl -X GET 'https://app.gtmhub.com/api/v1/kpis/{kpiId}?formatting=string' \ -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}?formatting=string", "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/{kpiId}"



requests.get(url, headers = headers)
{
    "accountId": "string value",
    "aggregation": "string value",
    "createdById": "string value",
    "dateCreated": "string value",
    "dateUpdated": "string value",
    "description": "string value",
    "formatting": {
        "fractionSize": 2,
        "prefix": "string value",
        "suffix": "string value"
    },
    "groups": [
        "string value 1",
        "string value 2"
    ],
    "id": "string value",
    "insightLink": {
        "fieldName": "string value",
        "insightName": "string value",
        "settings": [
            {
                "dynamicValues": [
                    {
                        "teamId": "string",
                        "type": "string"
                    }
                ],
                "name": "string value",
                "value": "string value",
                "valueDisplayName": "string value"
            }
        ]
    },
    "modifiedById": "string value",
    "name": "string value",
    "ownerId": "string value",
    "ownerIds": [
        "string value 1",
        "string value 2"
    ],
    "richTextDescription": "string value",
    "targetOperator": "string value"
}
🔗
post
/kpis
Creates a new KPI.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
createKpiRequest
*
objectThis object represents the attributes of a KPI to be created.
expected in body, sample value:
{
    "aggregation": "average",
    "description": "The average number of new customers per day in a given time period.",
    "formatting": {
        "fractionSize": 2,
        "prefix": "string value",
        "suffix": "string value"
    },
    "groups": [
        "string value 1",
        "string value 2"
    ],
    "insight": {
        "fieldName": "string value",
        "insightName": "string value",
        "insightValue": 2,
        "settings": [
            {
                "dynamicValues": [
                    {
                        "teamId": "string",
                        "type": "string"
                    }
                ],
                "name": "string value",
                "value": "string value",
                "valueDisplayName": "string value"
            }
        ]
    },
    "name": "New Customers per Day",
    "ownerId": "5e8ed44adcddda0da9eab365",
    "ownerIds": [
        "5e8ed44adcddda0da9eab365",
        "60b0d2c59bd8a6aff9b639ee",
        "60b0d2de9bd8a6aff9b639f0"
    ],
    "richTextDescription": "The average number of new customers per day in a given time period (in html form)",
    "targetOperator": "should_increase"
}
Expected response codes
201kpi
401unauthorized

curl -X POST 'https://app.gtmhub.com/api/v1/kpis' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"aggregation":"average","description":"The average number of new customers per day in a given time period.","formatting":{"fractionSize":2,"prefix":"string value","suffix":"string value"},"groups":["string value 1","string value 2"],"insight":{"fieldName":"string value","insightName":"string value","insightValue":2,"settings":[{"dynamicValues":[{"teamId":"string","type":"string"}],"name":"string value","value":"string value","valueDisplayName":"string value"}]},"name":"New Customers per Day","ownerId":"5e8ed44adcddda0da9eab365","ownerIds":["5e8ed44adcddda0da9eab365","60b0d2c59bd8a6aff9b639ee","60b0d2de9bd8a6aff9b639f0"],"richTextDescription":"The average number of new customers per day in a given time period (in html form)","targetOperator":"should_increase"}'

var body ={ "aggregation": "average", "description": "The average number of new customers per day in a given time period.", "formatting": { "fractionSize": 2, "prefix": "string value", "suffix": "string value" }, "groups": [ "string value 1", "string value 2" ], "insight": { "fieldName": "string value", "insightName": "string value", "insightValue": 2, "settings": [ { "dynamicValues": [ { "teamId": "string", "type": "string" } ], "name": "string value", "value": "string value", "valueDisplayName": "string value" } ] }, "name": "New Customers per Day", "ownerId": "5e8ed44adcddda0da9eab365", "ownerIds": [ "5e8ed44adcddda0da9eab365", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "richTextDescription": "The average number of new customers per day in a given time period (in html form)", "targetOperator": "should_increase" };

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis", "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"

body = { "aggregation": "average", "description": "The average number of new customers per day in a given time period.", "formatting": { "fractionSize": 2, "prefix": "string value", "suffix": "string value" }, "groups": [ "string value 1", "string value 2" ], "insight": { "fieldName": "string value", "insightName": "string value", "insightValue": 2, "settings": [ { "dynamicValues": [ { "teamId": "string", "type": "string" } ], "name": "string value", "value": "string value", "valueDisplayName": "string value" } ] }, "name": "New Customers per Day", "ownerId": "5e8ed44adcddda0da9eab365", "ownerIds": [ "5e8ed44adcddda0da9eab365", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "richTextDescription": "The average number of new customers per day in a given time period (in html form)", "targetOperator": "should_increase" };

requests.post(url, data=json.dumps(body), headers = headers)
{
    "accountId": "string value",
    "aggregation": "string value",
    "createdById": "string value",
    "dateCreated": "string value",
    "dateUpdated": "string value",
    "description": "string value",
    "formatting": {
        "fractionSize": 2,
        "prefix": "string value",
        "suffix": "string value"
    },
    "groups": [
        "string value 1",
        "string value 2"
    ],
    "id": "string value",
    "insightLink": {
        "fieldName": "string value",
        "insightName": "string value",
        "settings": [
            {
                "dynamicValues": [
                    {
                        "teamId": "string",
                        "type": "string"
                    }
                ],
                "name": "string value",
                "value": "string value",
                "valueDisplayName": "string value"
            }
        ]
    },
    "modifiedById": "string value",
    "name": "string value",
    "ownerId": "string value",
    "ownerIds": [
        "string value 1",
        "string value 2"
    ],
    "richTextDescription": "string value",
    "targetOperator": "string value"
}
🔗
post
/kpis/{kpiId}/snapshots
Creates a new snapshot for an existing KPI.
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
kpiSnapshotRequest
*
objectThis object represents the snapshot of the KPI.
expected in body, sample value:
{
    "group": "2022-W36",
    "timeZone": "UTC+3",
    "value": 5
}
Expected response codes
200resource created response
401unauthorized

curl -X POST 'https://app.gtmhub.com/api/v1/kpis/{kpiId}/snapshots' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"group":"2022-W36","timeZone":"UTC+3","value":5}'

var body ={ "group": "2022-W36", "timeZone": "UTC+3", "value": 5 };

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/{kpiId}/snapshots", "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/{kpiId}/snapshots"

body = { "group": "2022-W36", "timeZone": "UTC+3", "value": 5 };

requests.post(url, data=json.dumps(body), headers = headers)
🔗
put
/users/kpi-virtual-group/favorite
Add/Remove a virtual KPI group to/from 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/users/kpi-virtual-group/favorite' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \

var settings = { "url": "https://app.gtmhub.com/api/v1/users/kpi-virtual-group/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/users/kpi-virtual-group/favorite"



requests.put(url, headers = headers)
🔗
patch
/kpis/{kpiId}
Partially updates the KPI with the specified unique identifier (id).
Updates the KPI's attributes that are specified in the KPI request body only. The attributes that are not specified in the KPI request body will not be updated.
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
updateKpiRequest
*
objectThis object represents the attributes of a KPI to be updated.
expected in body, sample value:
{
    "aggregation": "average",
    "description": "string value",
    "formatting": {
        "fractionSize": 2,
        "prefix": "string value",
        "suffix": "string value"
    },
    "groups": [
        "60b0d2d09bd8a6aff9b639ef",
        "60b0d2c59bd8a6aff9b639ee",
        "60b0d2de9bd8a6aff9b639f0"
    ],
    "insight": {
        "Present": false,
        "Value": {
            "fieldName": "string value",
            "insightName": "string value",
            "insightValue": 2,
            "settings": [
                {
                    "dynamicValues": [
                        {
                            "teamId": "ID",
                            "type": "DynamicValueType"
                        }
                    ],
                    "name": "string value",
                    "value": "string value",
                    "valueDisplayName": "string value"
                }
            ]
        }
    },
    "name": "string value",
    "ownerId": "5e8ed44adcddda0da9eab365",
    "ownerIds": [
        "5e8ed44adcddda0da9eab365",
        "60b0d2c59bd8a6aff9b639ee",
        "60b0d2de9bd8a6aff9b639f0"
    ],
    "richTextDescription": "string value",
    "targetOperator": "should_increase"
}
Expected response codes
401unauthorized

curl -X PATCH 'https://app.gtmhub.com/api/v1/kpis/{kpiId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"aggregation":"average","description":"string value","formatting":{"fractionSize":2,"prefix":"string value","suffix":"string value"},"groups":["60b0d2d09bd8a6aff9b639ef","60b0d2c59bd8a6aff9b639ee","60b0d2de9bd8a6aff9b639f0"],"insight":{"Present":false,"Value":{"fieldName":"string value","insightName":"string value","insightValue":2,"settings":[{"dynamicValues":[{"teamId":"ID","type":"DynamicValueType"}],"name":"string value","value":"string value","valueDisplayName":"string value"}]}},"name":"string value","ownerId":"5e8ed44adcddda0da9eab365","ownerIds":["5e8ed44adcddda0da9eab365","60b0d2c59bd8a6aff9b639ee","60b0d2de9bd8a6aff9b639f0"],"richTextDescription":"string value","targetOperator":"should_increase"}'

var body ={ "aggregation": "average", "description": "string value", "formatting": { "fractionSize": 2, "prefix": "string value", "suffix": "string value" }, "groups": [ "60b0d2d09bd8a6aff9b639ef", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "insight": { "Present": false, "Value": { "fieldName": "string value", "insightName": "string value", "insightValue": 2, "settings": [ { "dynamicValues": [ { "teamId": "ID", "type": "DynamicValueType" } ], "name": "string value", "value": "string value", "valueDisplayName": "string value" } ] } }, "name": "string value", "ownerId": "5e8ed44adcddda0da9eab365", "ownerIds": [ "5e8ed44adcddda0da9eab365", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "richTextDescription": "string value", "targetOperator": "should_increase" };

var settings = { "url": "https://app.gtmhub.com/api/v1/kpis/{kpiId}", "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/{kpiId}"

body = { "aggregation": "average", "description": "string value", "formatting": { "fractionSize": 2, "prefix": "string value", "suffix": "string value" }, "groups": [ "60b0d2d09bd8a6aff9b639ef", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "insight": { "Present": false, "Value": { "fieldName": "string value", "insightName": "string value", "insightValue": 2, "settings": [ { "dynamicValues": [ { "teamId": "ID", "type": "DynamicValueType" } ], "name": "string value", "value": "string value", "valueDisplayName": "string value" } ] } }, "name": "string value", "ownerId": "5e8ed44adcddda0da9eab365", "ownerIds": [ "5e8ed44adcddda0da9eab365", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "richTextDescription": "string value", "targetOperator": "should_increase" };

requests.patch(url, data=json.dumps(body), headers = headers)
🔗
delete
/kpis/{kpiId}
Deletes an existing KPI and its snapshots.
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
Expected response codes
401unauthorized

curl -X DELETE 'https://app.gtmhub.com/api/v1/kpis/{kpiId}' \ -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}", "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}"



requests.delete(url, headers = headers)