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.
Gets all used kpis for the chosen insight
Parameters
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | The unique identifier (id) of the Gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
Expected response codes
401 | unauthorized |
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)
Gets KPI snapshots for a given list of KPI unique identifiers (KPI ids).
Parameters
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | The unique identifier (id) of the Gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
ids * | string | A comma-separated list of KPI unique identifiers (ids).
Ex: 5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365 expected in query, sample value: 5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365 |
timeZone | string | The time zone for which to calculate snapshot groups. expected in query, sample value: UTC-2 |
groupBy | string | Specifies how the snapshots to be grouped by. expected in query, sample value: string |
from | string | Gets the snapshots that start on this date only.
Date format: YYYY-MM-DD expected in query, sample value: 2020-05-02 |
to | string | Gets the snapshots that end on this date only.
Date format: YYYY-MM-DD expected in query, sample value: 2020-05-02 |
Expected response codes
401 | unauthorized |
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)
Loads all kpis using filter, sort and projection expressions coming from the request body
Parameters
Name | Type | Description |
---|
Expected response codes
200 | kpisWithTotalCount |
401 | unauthorized |
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
}
Gets KPI snapshots for a given list of KPI unique identifiers (KPI ids).
Parameters
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | The unique identifier (id) of the Gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
ids * | string | A comma-separated list of KPI unique identifiers (ids).
Ex: 5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365 expected in query, sample value: 5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365 |
timeZone | string | The time zone for which to calculate snapshot groups. expected in query, sample value: UTC-2 |
groupBy | string | Specifies how the snapshots to be grouped by. expected in query, sample value: string |
from | string | Gets the snapshots that start on this date only.
Date format: YYYY-MM-DD expected in query, sample value: 2020-05-02 |
to | string | Gets the snapshots that end on this date only.
Date format: YYYY-MM-DD expected in query, sample value: 2020-05-02 |
Expected response codes
401 | unauthorized |
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)
Gets an existing KPI by its unique identifier (id).
Parameters
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | The unique identifier (id) of the Gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
kpiId * | string | The unique identifier (id) of the KPI. expected in path
|
formatting | string | The 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
200 | kpi |
401 | unauthorized |
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"
}
Creates a new KPI.
Parameters
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | The unique identifier (id) of the Gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
createKpiRequest * | object | This 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" ], "groupsOrder": "{'group1_id': 2, 'group2_id': 5}", "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
201 | kpi |
401 | unauthorized |
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"],"groupsOrder":"{'group1_id': 2, 'group2_id': 5}","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" ], "groupsOrder": "{'group1_id': 2, 'group2_id': 5}", "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" ], "groupsOrder": "{'group1_id': 2, 'group2_id': 5}", "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"
}
Creates a new snapshot for an existing KPI.
Parameters
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | The unique identifier (id) of the Gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
kpiId * | string | The unique identifier (id) of the KPI. expected in path
|
kpiSnapshotRequest * | object | This object represents the snapshot of the KPI. expected in body, sample value: { "group": "2022-W36", "timeZone": "UTC+3", "value": 5 } |
Expected response codes
200 | resource created response message |
401 | unauthorized |
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)
Add/Remove a virtual KPI group to/from favorites of the current user.
Parameters
Name | Type | Description |
---|
Expected response codes
200 | ok |
400 | bad request |
401 | unauthorized |
404 | not found |
500 | internal 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)
Bulk update of KPIs.
Parameters
Name | Type | Description |
---|
Expected response codes
204 | no content |
curl -X PATCH 'https://app.gtmhub.com/api/v1/kpis' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
var settings = { "url": "https://app.gtmhub.com/api/v1/kpis", "method": "PATCH", "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"
requests.patch(url, headers = headers)
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
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | The unique identifier (id) of the Gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
kpiId * | string | The unique identifier (id) of the KPI. expected in path
|
updateKpiRequest * | object | This 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" ], "groupsOrder": "{'group1_id': 2, 'group2_id': 5}", "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
401 | unauthorized |
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"],"groupsOrder":"{'group1_id': 2, 'group2_id': 5}","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" ], "groupsOrder": "{'group1_id': 2, 'group2_id': 5}", "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" ], "groupsOrder": "{'group1_id': 2, 'group2_id': 5}", "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)
Deletes an existing KPI and its snapshots.
No request object required.
Parameters
Name | Type | Description |
---|---|---|
gtmhub-accountId * | string | The unique identifier (id) of the Gtmhub account. expected in header, sample value: 5be26318e5274a0007f17f61 |
kpiId * | string | The unique identifier (id) of the KPI. expected in path
|
Expected response codes
401 | unauthorized |
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)
Oops! Looks like there are no API calls of that type for this Endpoint