KPIs endpoints

The Kpi endpoints enable you to retrieve, create, update, or delete Quantive Results 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 Quantive Results account.
expected in header, sample value:
5be26318e5274a0007f17f61
Expected response codes
200ok
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X GET 'https://app.quantive.com/results/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.quantive.com/results/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.quantive.com/results/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 Quantive Results account.
expected in header, sample value:
5be26318e5274a0007f17f61
idsstringA comma-separated list of KPI unique identifiers (ids). Ex: 5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365
expected in query, sample value:
5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365
groupIdsstringA comma-separated list of KPI Groups unique identifiers (ids). Ex: 5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365
expected in query, sample value:
string
ungroupedbooleanA true/false value to return all KPIs which the user has access and which don't belong to a group
expected in query
mykpisbooleanA true/false value to return all KPIs which the user is an owner
expected in query
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
200ok
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

curl -X GET 'https://app.quantive.com/results/api/v1/kpi-snapshots?ids=5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365&groupIds=string&ungrouped=undefined&mykpis=undefined&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.quantive.com/results/api/v1/kpi-snapshots?ids=5e8c27e3dcdddaa4addbdee8,5e8ed44adcddda0da9eab365&groupIds=string&ungrouped=undefined&mykpis=undefined&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.quantive.com/results/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
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

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

var settings = { "url": "https://app.quantive.com/results/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.quantive.com/results/api/v2/kpis"



requests.get(url, headers = headers)
{
    "count": 2,
    "items": [
        {
            "accountId": "string value",
            "aggregation": "string value",
            "createdById": "string value",
            "currentUserAllowedActions": [
                "string value 1",
                "string value 2"
            ],
            "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",
                        "valueDisplayNameAsArray": [
                            "string value 1",
                            "string value 2"
                        ]
                    }
                ],
                "usedDataSourceBlueprintNames": [
                    "string value 1",
                    "string value 2"
                ]
            },
            "isOwner": false,
            "links": {
                "expanded": {
                    "goals": [
                        {
                            "access": "defaultAccess",
                            "accountId": "string value",
                            "assignee": "assigneeResponse",
                            "assignees": [
                                "assigneeResponse"
                            ],
                            "attainment": 2,
                            "attainmentTypeString": "string value",
                            "createdById": "string value",
                            "dateCreated": "string value",
                            "dateFrom": "string value",
                            "dateTo": "string value",
                            "description": "string value",
                            "id": "string value",
                            "name": "string value",
                            "numberOfOwners": 2,
                            "obfuscated": false,
                            "ownerId": "string value",
                            "ownerIds": [
                                "string value 1",
                                "string value 2"
                            ],
                            "parentGoalSessionId": "string value",
                            "parentId": "string value",
                            "parentType": "string value",
                            "private": false,
                            "sessionId": "string value",
                            "url": "string value"
                        }
                    ],
                    "kpis": [
                        {
                            "access": "defaultAccess",
                            "accountId": "ID",
                            "aggregation": "string value",
                            "createdById": "ID",
                            "dateCreated": "string value",
                            "dateUpdated": "string value",
                            "description": "string value",
                            "groups": "IDs",
                            "id": "ID",
                            "mentions": "Mentions",
                            "modifiedById": "ID",
                            "name": "string value",
                            "obfuscated": false,
                            "ownerId": "ID",
                            "ownerIds": "IDs",
                            "targetOperator": "string value"
                        }
                    ],
                    "metrics": [
                        {
                            "actual": 6,
                            "cascadeType": "absolute_value",
                            "description": "My Description",
                            "dynamic": true,
                            "fieldName": "count",
                            "format": "MetricFormat",
                            "goalId": "string value",
                            "goalName": "string value",
                            "initialValue": 2,
                            "insightName": "1k42vv2z24",
                            "manualType": "double",
                            "name": "string value",
                            "numberOfOwners": 2,
                            "obfuscated": false,
                            "ownerId": "string value",
                            "ownerIds": "Ids",
                            "sessionId": "6093fdabd251f200015e8f92",
                            "tags": [
                                "tagResponse"
                            ],
                            "target": 100,
                            "targetOperator": "at_least"
                        }
                    ],
                    "sessions": [
                        {
                            "accountId": "string value",
                            "end": "string value",
                            "id": "string value",
                            "inherits": false,
                            "ownerPermissions": "OwnerPermission",
                            "parentId": "string value",
                            "permissions": [
                                "Permission"
                            ],
                            "start": "string value",
                            "status": "string value",
                            "title": "string value"
                        }
                    ]
                }
            },
            "modifiedById": "string value",
            "name": "string value",
            "ownerId": "string value",
            "ownerIds": [
                "string value 1",
                "string value 2"
            ],
            "projections": [
                {
                    "createdById": "string",
                    "date": "string value",
                    "dateCreated": "string value",
                    "dateModified": "string value",
                    "id": "string",
                    "modifiedById": "string",
                    "value": 2
                }
            ],
            "targetOperator": "string value"
        }
    ],
    "totalCount": 2
}
🔗
get
/kpis/snapshots
Loads all kpis using filter, sort and projection expressions coming from the request body and then loads the snapshots of these using the from,to,timeZone,groupBy queryParams
Parameters
NameTypeDescription
Expected response codes
200kpiSnapshotGroupsByKpiDto
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

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

var settings = { "url": "https://app.quantive.com/results/api/v2/kpis/snapshots", "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.quantive.com/results/api/v2/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 Quantive Results 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
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X GET 'https://app.quantive.com/results/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.quantive.com/results/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.quantive.com/results/api/v1/kpis/{kpiId}"



requests.get(url, headers = headers)
{
    "accountId": "string value",
    "aggregation": "string value",
    "createdById": "string value",
    "currentUserAllowedActions": [
        "string value 1",
        "string value 2"
    ],
    "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",
                "valueDisplayNameAsArray": [
                    "string value 1",
                    "string value 2"
                ]
            }
        ],
        "usedDataSourceBlueprintNames": [
            "string value 1",
            "string value 2"
        ]
    },
    "isOwner": false,
    "links": {
        "expanded": {
            "goals": [
                {
                    "access": {
                        "inherits": false,
                        "ownerPermissions": "OwnerPermission",
                        "permissions": [
                            "Permission"
                        ]
                    },
                    "accountId": "string value",
                    "assignee": {
                        "accountId": "string value",
                        "avatar": "string value",
                        "color": "string value",
                        "dynamicValueType": "string value",
                        "email": "string value",
                        "id": "string value",
                        "isActive": false,
                        "name": "string value",
                        "picture": "string value",
                        "tags": [
                            "tagResponse"
                        ],
                        "type": "string value"
                    },
                    "assignees": [
                        {
                            "accountId": "string value",
                            "avatar": "string value",
                            "color": "string value",
                            "dynamicValueType": "string value",
                            "email": "string value",
                            "id": "string value",
                            "isActive": false,
                            "name": "string value",
                            "picture": "string value",
                            "tags": [
                                "tagResponse"
                            ],
                            "type": "string value"
                        }
                    ],
                    "attainment": 2,
                    "attainmentTypeString": "string value",
                    "createdById": "string value",
                    "dateCreated": "string value",
                    "dateFrom": "string value",
                    "dateTo": "string value",
                    "description": "string value",
                    "id": "string value",
                    "name": "string value",
                    "numberOfOwners": 2,
                    "obfuscated": false,
                    "ownerId": "string value",
                    "ownerIds": [
                        "string value 1",
                        "string value 2"
                    ],
                    "parentGoalSessionId": "string value",
                    "parentId": "string value",
                    "parentType": "string value",
                    "private": false,
                    "sessionId": "string value",
                    "url": "string value"
                }
            ],
            "kpis": [
                {
                    "access": {
                        "inherits": false,
                        "ownerPermissions": "OwnerPermission",
                        "permissions": [
                            "Permission"
                        ]
                    },
                    "accountId": "string",
                    "aggregation": "string value",
                    "createdById": "string",
                    "dateCreated": "string value",
                    "dateUpdated": "string value",
                    "description": "string value",
                    "groups": [
                        "ID"
                    ],
                    "id": "string",
                    "mentions": {},
                    "modifiedById": "string",
                    "name": "string value",
                    "obfuscated": false,
                    "ownerId": "string",
                    "ownerIds": [
                        "ID"
                    ],
                    "targetOperator": "string value"
                }
            ],
            "metrics": [
                {
                    "actual": 6,
                    "cascadeType": "absolute_value",
                    "description": "My Description",
                    "dynamic": true,
                    "fieldName": "count",
                    "format": {
                        "ID": "ID",
                        "fractionSize": 2,
                        "prefix": "string value",
                        "suffix": "string value"
                    },
                    "goalId": "string value",
                    "goalName": "string value",
                    "initialValue": 2,
                    "insightName": "1k42vv2z24",
                    "manualType": "double",
                    "name": "string value",
                    "numberOfOwners": 2,
                    "obfuscated": false,
                    "ownerId": "string value",
                    "ownerIds": {},
                    "sessionId": "6093fdabd251f200015e8f92",
                    "tags": [
                        {
                            "createdBy": "ID",
                            "dateCreated": "string value",
                            "id": "string value",
                            "isActive": false,
                            "items": [
                                "tagResponse"
                            ],
                            "name": "string value",
                            "title": "string value"
                        }
                    ],
                    "target": 100,
                    "targetOperator": "at_least"
                }
            ],
            "sessions": [
                {
                    "accountId": "string value",
                    "end": "string value",
                    "id": "string value",
                    "inherits": false,
                    "ownerPermissions": {
                        "grant": "Binary"
                    },
                    "parentId": "string value",
                    "permissions": [
                        {
                            "grant": "Binary",
                            "principalId": "ID",
                            "principalKind": "string value"
                        }
                    ],
                    "start": "string value",
                    "status": "string value",
                    "title": "string value"
                }
            ]
        }
    },
    "modifiedById": "string value",
    "name": "string value",
    "ownerId": "string value",
    "ownerIds": [
        "string value 1",
        "string value 2"
    ],
    "projections": [
        {
            "createdById": "string",
            "date": "string value",
            "dateCreated": "string value",
            "dateModified": "string value",
            "id": "string",
            "modifiedById": "string",
            "value": 2
        }
    ],
    "targetOperator": "string value"
}
🔗
get
/kpis/{kpiId}/projections
Gets all Projections for an existing Kpi.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Quantive Results account.
expected in header, sample value:
5be26318e5274a0007f17f61
Expected response codes
200KpiProjectionsResponse
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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

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



requests.get(url, headers = headers)
{
    "items": [
        {
            "date": "string value",
            "id": "string value",
            "value": 2
        }
    ],
    "totalCount": 2
}
🔗
get
/kpis/{kpiId}/statistics
Gets an existing KPI statistics by its unique identifier (id).
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Quantive Results account.
expected in header, sample value:
5be26318e5274a0007f17f61
type
*
stringSpecifies the period type to be used for the statistics "week" | "month" | "three-months" | "year" | "all-time"
expected in query, sample value:
week
timeZonestringSpecifies timezone offset it defaults to UTC timeZone format: UTC-X or UTC+X
expected in query, sample value:
UTC+1
Expected response codes
200KpiStatisticsDto
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X GET 'https://app.quantive.com/results/api/v1/kpis/{kpiId}/statistics?type=week&timeZone=UTC+1' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.quantive.com/results/api/v1/kpis/{kpiId}/statistics?type=week&timeZone=UTC+1", "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.quantive.com/results/api/v1/kpis/{kpiId}/statistics"



requests.get(url, headers = headers)
{
    "currentPeriod": {
        "deltaPercentage": 0.6,
        "value": 150
    },
    "nextProjection": {
        "deltaPercentage": 0.6,
        "value": 150
    },
    "previousPeriod": {
        "deltaPercentage": 0.6,
        "value": 150
    }
}
🔗
post
/kpis
Creates a new KPI.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Quantive Results 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"
    ],
    "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",
                "valueDisplayNameAsArray": [
                    "string value 1",
                    "string value 2"
                ]
            }
        ],
        "usedDataSourceBlueprintNames": [
            "string value 1",
            "string value 2"
        ]
    },
    "name": "New Customers per Day",
    "ownerId": "5e8ed44adcddda0da9eab365",
    "ownerIds": [
        "5e8ed44adcddda0da9eab365",
        "60b0d2c59bd8a6aff9b639ee",
        "60b0d2de9bd8a6aff9b639f0"
    ],
    "targetOperator": "should_increase"
}
Expected response codes
201kpi
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

curl -X POST 'https://app.quantive.com/results/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","valueDisplayNameAsArray":["string value 1","string value 2"]}],"usedDataSourceBlueprintNames":["string value 1","string value 2"]},"name":"New Customers per Day","ownerId":"5e8ed44adcddda0da9eab365","ownerIds":["5e8ed44adcddda0da9eab365","60b0d2c59bd8a6aff9b639ee","60b0d2de9bd8a6aff9b639f0"],"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", "valueDisplayNameAsArray": [ "string value 1", "string value 2" ] } ], "usedDataSourceBlueprintNames": [ "string value 1", "string value 2" ] }, "name": "New Customers per Day", "ownerId": "5e8ed44adcddda0da9eab365", "ownerIds": [ "5e8ed44adcddda0da9eab365", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "targetOperator": "should_increase" };

var settings = { "url": "https://app.quantive.com/results/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.quantive.com/results/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", "valueDisplayNameAsArray": [ "string value 1", "string value 2" ] } ], "usedDataSourceBlueprintNames": [ "string value 1", "string value 2" ] }, "name": "New Customers per Day", "ownerId": "5e8ed44adcddda0da9eab365", "ownerIds": [ "5e8ed44adcddda0da9eab365", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "targetOperator": "should_increase" };

requests.post(url, data=json.dumps(body), headers = headers)
{
    "accountId": "string value",
    "aggregation": "string value",
    "createdById": "string value",
    "currentUserAllowedActions": [
        "string value 1",
        "string value 2"
    ],
    "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",
                "valueDisplayNameAsArray": [
                    "string value 1",
                    "string value 2"
                ]
            }
        ],
        "usedDataSourceBlueprintNames": [
            "string value 1",
            "string value 2"
        ]
    },
    "isOwner": false,
    "links": {
        "expanded": {
            "goals": [
                {
                    "access": {
                        "inherits": false,
                        "ownerPermissions": "OwnerPermission",
                        "permissions": [
                            "Permission"
                        ]
                    },
                    "accountId": "string value",
                    "assignee": {
                        "accountId": "string value",
                        "avatar": "string value",
                        "color": "string value",
                        "dynamicValueType": "string value",
                        "email": "string value",
                        "id": "string value",
                        "isActive": false,
                        "name": "string value",
                        "picture": "string value",
                        "tags": [
                            "tagResponse"
                        ],
                        "type": "string value"
                    },
                    "assignees": [
                        {
                            "accountId": "string value",
                            "avatar": "string value",
                            "color": "string value",
                            "dynamicValueType": "string value",
                            "email": "string value",
                            "id": "string value",
                            "isActive": false,
                            "name": "string value",
                            "picture": "string value",
                            "tags": [
                                "tagResponse"
                            ],
                            "type": "string value"
                        }
                    ],
                    "attainment": 2,
                    "attainmentTypeString": "string value",
                    "createdById": "string value",
                    "dateCreated": "string value",
                    "dateFrom": "string value",
                    "dateTo": "string value",
                    "description": "string value",
                    "id": "string value",
                    "name": "string value",
                    "numberOfOwners": 2,
                    "obfuscated": false,
                    "ownerId": "string value",
                    "ownerIds": [
                        "string value 1",
                        "string value 2"
                    ],
                    "parentGoalSessionId": "string value",
                    "parentId": "string value",
                    "parentType": "string value",
                    "private": false,
                    "sessionId": "string value",
                    "url": "string value"
                }
            ],
            "kpis": [
                {
                    "access": {
                        "inherits": false,
                        "ownerPermissions": "OwnerPermission",
                        "permissions": [
                            "Permission"
                        ]
                    },
                    "accountId": "string",
                    "aggregation": "string value",
                    "createdById": "string",
                    "dateCreated": "string value",
                    "dateUpdated": "string value",
                    "description": "string value",
                    "groups": [
                        "ID"
                    ],
                    "id": "string",
                    "mentions": {},
                    "modifiedById": "string",
                    "name": "string value",
                    "obfuscated": false,
                    "ownerId": "string",
                    "ownerIds": [
                        "ID"
                    ],
                    "targetOperator": "string value"
                }
            ],
            "metrics": [
                {
                    "actual": 6,
                    "cascadeType": "absolute_value",
                    "description": "My Description",
                    "dynamic": true,
                    "fieldName": "count",
                    "format": {
                        "ID": "ID",
                        "fractionSize": 2,
                        "prefix": "string value",
                        "suffix": "string value"
                    },
                    "goalId": "string value",
                    "goalName": "string value",
                    "initialValue": 2,
                    "insightName": "1k42vv2z24",
                    "manualType": "double",
                    "name": "string value",
                    "numberOfOwners": 2,
                    "obfuscated": false,
                    "ownerId": "string value",
                    "ownerIds": {},
                    "sessionId": "6093fdabd251f200015e8f92",
                    "tags": [
                        {
                            "createdBy": "ID",
                            "dateCreated": "string value",
                            "id": "string value",
                            "isActive": false,
                            "items": [
                                "tagResponse"
                            ],
                            "name": "string value",
                            "title": "string value"
                        }
                    ],
                    "target": 100,
                    "targetOperator": "at_least"
                }
            ],
            "sessions": [
                {
                    "accountId": "string value",
                    "end": "string value",
                    "id": "string value",
                    "inherits": false,
                    "ownerPermissions": {
                        "grant": "Binary"
                    },
                    "parentId": "string value",
                    "permissions": [
                        {
                            "grant": "Binary",
                            "principalId": "ID",
                            "principalKind": "string value"
                        }
                    ],
                    "start": "string value",
                    "status": "string value",
                    "title": "string value"
                }
            ]
        }
    },
    "modifiedById": "string value",
    "name": "string value",
    "ownerId": "string value",
    "ownerIds": [
        "string value 1",
        "string value 2"
    ],
    "projections": [
        {
            "createdById": "string",
            "date": "string value",
            "dateCreated": "string value",
            "dateModified": "string value",
            "id": "string",
            "modifiedById": "string",
            "value": 2
        }
    ],
    "targetOperator": "string value"
}
🔗
post
/kpis/{kpiId}/projections
Creates a new Projection for the specified KPI.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Quantive Results account.
expected in header, sample value:
5be26318e5274a0007f17f61
createKpiProjectionRequest
*
objectThis object represents the attributes of a KPI Projection to be created.
expected in body, sample value:
{
    "date": "2006-01-02",
    "value": 5
}
Expected response codes
201KpiProjectionDto
400bad request
401unauthorized
402payment required
403forbidden
404not found
409conflict
500internal server error

curl -X POST 'https://app.quantive.com/results/api/v1/kpis/{kpiId}/projections' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"date":"2006-01-02","value":5}'

var body ={ "date": "2006-01-02", "value": 5 };

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

body = { "date": "2006-01-02", "value": 5 };

requests.post(url, data=json.dumps(body), headers = headers)
{
    "date": "string value",
    "id": "string value",
    "value": 2
}
🔗
post
/kpis/{kpiId}/snapshots
Creates a new snapshot for an existing KPI.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Quantive Results 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
201created
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X POST 'https://app.quantive.com/results/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.quantive.com/results/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.quantive.com/results/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.quantive.com/results/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.quantive.com/results/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.quantive.com/results/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 Quantive Results 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"
    ],
    "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",
                    "valueDisplayNameAsArray": [
                        "string value 1",
                        "string value 2"
                    ]
                }
            ],
            "usedDataSourceBlueprintNames": [
                "string value 1",
                "string value 2"
            ]
        }
    },
    "name": "string value",
    "ownerId": "5e8ed44adcddda0da9eab365",
    "ownerIds": [
        "5e8ed44adcddda0da9eab365",
        "60b0d2c59bd8a6aff9b639ee",
        "60b0d2de9bd8a6aff9b639f0"
    ],
    "targetOperator": "should_increase"
}
Expected response codes
200ok
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X PATCH 'https://app.quantive.com/results/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","valueDisplayNameAsArray":["string value 1","string value 2"]}],"usedDataSourceBlueprintNames":["string value 1","string value 2"]}},"name":"string value","ownerId":"5e8ed44adcddda0da9eab365","ownerIds":["5e8ed44adcddda0da9eab365","60b0d2c59bd8a6aff9b639ee","60b0d2de9bd8a6aff9b639f0"],"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", "valueDisplayNameAsArray": [ "string value 1", "string value 2" ] } ], "usedDataSourceBlueprintNames": [ "string value 1", "string value 2" ] } }, "name": "string value", "ownerId": "5e8ed44adcddda0da9eab365", "ownerIds": [ "5e8ed44adcddda0da9eab365", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "targetOperator": "should_increase" };

var settings = { "url": "https://app.quantive.com/results/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.quantive.com/results/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", "valueDisplayNameAsArray": [ "string value 1", "string value 2" ] } ], "usedDataSourceBlueprintNames": [ "string value 1", "string value 2" ] } }, "name": "string value", "ownerId": "5e8ed44adcddda0da9eab365", "ownerIds": [ "5e8ed44adcddda0da9eab365", "60b0d2c59bd8a6aff9b639ee", "60b0d2de9bd8a6aff9b639f0" ], "targetOperator": "should_increase" };

requests.patch(url, data=json.dumps(body), headers = headers)
🔗
patch
/kpis/{kpiId}/projections/{projectionId}
Partially updates the Projection with the specified unique identifier (id).
Updates the Projection's attributes that are specified in the Projection request body only. The attributes that are not specified in the Projection request body will not be updated.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Quantive Results account.
expected in header, sample value:
5be26318e5274a0007f17f61
patchKpiProjectionRequest
*
objectThis object represents the attributes of a KPI Projection to be updated.
expected in body, sample value:
{
    "date": "2006-01-02",
    "value": 5
}
Expected response codes
204no content
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X PATCH 'https://app.quantive.com/results/api/v1/kpis/{kpiId}/projections/{projectionId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"date":"2006-01-02","value":5}'

var body ={ "date": "2006-01-02", "value": 5 };

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

body = { "date": "2006-01-02", "value": 5 };

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 Quantive Results account.
expected in header, sample value:
5be26318e5274a0007f17f61
kpiId
*
stringThe unique identifier (id) of the KPI.
expected in path
Expected response codes
204no content
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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



requests.delete(url, headers = headers)
🔗
delete
/kpis/{kpiId}/projections/{projectionId}
Deletes an existing Projection.
No request object required.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringThe unique identifier (id) of the Quantive Results account.
expected in header, sample value:
5be26318e5274a0007f17f61
Expected response codes
204no content
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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

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



requests.delete(url, headers = headers)