curl --request POST \
--url https://api.select.dev/v2/insights/activity/actions/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"measures": [
{
"aggregate_function": "array_unique_agg",
"dimension": {
"path": [
"<string>"
]
}
}
],
"dimensions": [
{
"path": [
"<string>"
]
}
],
"filters": [
{
"field": {
"path": [
"<string>"
]
},
"values": [
123
],
"not": false
}
],
"filter_expression": {
"filters": [
{
"field": {
"path": [
"<string>"
]
},
"value": 123,
"not": false
}
],
"component_type": "Resource Filter"
},
"measure_filters": [
{
"values": [
123
],
"not": false
}
],
"sort": [
{
"field": {
"path": [
"<string>"
]
}
}
],
"limit": 10000
}
'import requests
url = "https://api.select.dev/v2/insights/activity/actions/query"
payload = {
"measures": [
{
"aggregate_function": "array_unique_agg",
"dimension": { "path": ["<string>"] }
}
],
"dimensions": [{ "path": ["<string>"] }],
"filters": [
{
"field": { "path": ["<string>"] },
"values": [123],
"not": False
}
],
"filter_expression": {
"filters": [
{
"field": { "path": ["<string>"] },
"value": 123,
"not": False
}
],
"component_type": "Resource Filter"
},
"measure_filters": [
{
"values": [123],
"not": False
}
],
"sort": [{ "field": { "path": ["<string>"] } }],
"limit": 10000
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
measures: [{aggregate_function: 'array_unique_agg', dimension: {path: ['<string>']}}],
dimensions: [{path: ['<string>']}],
filters: [{field: {path: ['<string>']}, values: [123], not: false}],
filter_expression: {
filters: [{field: {path: ['<string>']}, value: 123, not: false}],
component_type: 'Resource Filter'
},
measure_filters: [{values: [123], not: false}],
sort: [{field: {path: ['<string>']}}],
limit: 10000
})
};
fetch('https://api.select.dev/v2/insights/activity/actions/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.select.dev/v2/insights/activity/actions/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'measures' => [
[
'aggregate_function' => 'array_unique_agg',
'dimension' => [
'path' => [
'<string>'
]
]
]
],
'dimensions' => [
[
'path' => [
'<string>'
]
]
],
'filters' => [
[
'field' => [
'path' => [
'<string>'
]
],
'values' => [
123
],
'not' => false
]
],
'filter_expression' => [
'filters' => [
[
'field' => [
'path' => [
'<string>'
]
],
'value' => 123,
'not' => false
]
],
'component_type' => 'Resource Filter'
],
'measure_filters' => [
[
'values' => [
123
],
'not' => false
]
],
'sort' => [
[
'field' => [
'path' => [
'<string>'
]
]
]
],
'limit' => 10000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.select.dev/v2/insights/activity/actions/query"
payload := strings.NewReader("{\n \"measures\": [\n {\n \"aggregate_function\": \"array_unique_agg\",\n \"dimension\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"dimensions\": [\n {\n \"path\": [\n \"<string>\"\n ]\n }\n ],\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"Resource Filter\"\n },\n \"measure_filters\": [\n {\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"sort\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"limit\": 10000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.select.dev/v2/insights/activity/actions/query")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"measures\": [\n {\n \"aggregate_function\": \"array_unique_agg\",\n \"dimension\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"dimensions\": [\n {\n \"path\": [\n \"<string>\"\n ]\n }\n ],\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"Resource Filter\"\n },\n \"measure_filters\": [\n {\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"sort\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"limit\": 10000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/insights/activity/actions/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"measures\": [\n {\n \"aggregate_function\": \"array_unique_agg\",\n \"dimension\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"dimensions\": [\n {\n \"path\": [\n \"<string>\"\n ]\n }\n ],\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"Resource Filter\"\n },\n \"measure_filters\": [\n {\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"sort\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"limit\": 10000\n}"
response = http.request(request)
puts response.read_body{
"items": [
{}
],
"page_token": "<string>",
"row_count": 123
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Query insight activity by dimension and measure
Returns one row per combination of the requested dimensions, carrying the requested measures. Each row is keyed by dimension and measure name. Activity is recorded per changed field, so an edit that changes several fields of an insight at once counts once for each. A view is recorded when it changes who last viewed the insight, so a repeat view by its last viewer adds no activity. row_count is the number of rows in items: results are not paginated, so an aggregation with more rows than limit is cut short at limit rather than continued under a page_token. Requires access to the audit log as well as to insights.
curl --request POST \
--url https://api.select.dev/v2/insights/activity/actions/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"measures": [
{
"aggregate_function": "array_unique_agg",
"dimension": {
"path": [
"<string>"
]
}
}
],
"dimensions": [
{
"path": [
"<string>"
]
}
],
"filters": [
{
"field": {
"path": [
"<string>"
]
},
"values": [
123
],
"not": false
}
],
"filter_expression": {
"filters": [
{
"field": {
"path": [
"<string>"
]
},
"value": 123,
"not": false
}
],
"component_type": "Resource Filter"
},
"measure_filters": [
{
"values": [
123
],
"not": false
}
],
"sort": [
{
"field": {
"path": [
"<string>"
]
}
}
],
"limit": 10000
}
'import requests
url = "https://api.select.dev/v2/insights/activity/actions/query"
payload = {
"measures": [
{
"aggregate_function": "array_unique_agg",
"dimension": { "path": ["<string>"] }
}
],
"dimensions": [{ "path": ["<string>"] }],
"filters": [
{
"field": { "path": ["<string>"] },
"values": [123],
"not": False
}
],
"filter_expression": {
"filters": [
{
"field": { "path": ["<string>"] },
"value": 123,
"not": False
}
],
"component_type": "Resource Filter"
},
"measure_filters": [
{
"values": [123],
"not": False
}
],
"sort": [{ "field": { "path": ["<string>"] } }],
"limit": 10000
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
measures: [{aggregate_function: 'array_unique_agg', dimension: {path: ['<string>']}}],
dimensions: [{path: ['<string>']}],
filters: [{field: {path: ['<string>']}, values: [123], not: false}],
filter_expression: {
filters: [{field: {path: ['<string>']}, value: 123, not: false}],
component_type: 'Resource Filter'
},
measure_filters: [{values: [123], not: false}],
sort: [{field: {path: ['<string>']}}],
limit: 10000
})
};
fetch('https://api.select.dev/v2/insights/activity/actions/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.select.dev/v2/insights/activity/actions/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'measures' => [
[
'aggregate_function' => 'array_unique_agg',
'dimension' => [
'path' => [
'<string>'
]
]
]
],
'dimensions' => [
[
'path' => [
'<string>'
]
]
],
'filters' => [
[
'field' => [
'path' => [
'<string>'
]
],
'values' => [
123
],
'not' => false
]
],
'filter_expression' => [
'filters' => [
[
'field' => [
'path' => [
'<string>'
]
],
'value' => 123,
'not' => false
]
],
'component_type' => 'Resource Filter'
],
'measure_filters' => [
[
'values' => [
123
],
'not' => false
]
],
'sort' => [
[
'field' => [
'path' => [
'<string>'
]
]
]
],
'limit' => 10000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.select.dev/v2/insights/activity/actions/query"
payload := strings.NewReader("{\n \"measures\": [\n {\n \"aggregate_function\": \"array_unique_agg\",\n \"dimension\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"dimensions\": [\n {\n \"path\": [\n \"<string>\"\n ]\n }\n ],\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"Resource Filter\"\n },\n \"measure_filters\": [\n {\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"sort\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"limit\": 10000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.select.dev/v2/insights/activity/actions/query")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"measures\": [\n {\n \"aggregate_function\": \"array_unique_agg\",\n \"dimension\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"dimensions\": [\n {\n \"path\": [\n \"<string>\"\n ]\n }\n ],\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"Resource Filter\"\n },\n \"measure_filters\": [\n {\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"sort\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"limit\": 10000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/insights/activity/actions/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"measures\": [\n {\n \"aggregate_function\": \"array_unique_agg\",\n \"dimension\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"dimensions\": [\n {\n \"path\": [\n \"<string>\"\n ]\n }\n ],\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"filter_expression\": {\n \"filters\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n },\n \"value\": 123,\n \"not\": false\n }\n ],\n \"component_type\": \"Resource Filter\"\n },\n \"measure_filters\": [\n {\n \"values\": [\n 123\n ],\n \"not\": false\n }\n ],\n \"sort\": [\n {\n \"field\": {\n \"path\": [\n \"<string>\"\n ]\n }\n }\n ],\n \"limit\": 10000\n}"
response = http.request(request)
puts response.read_body{
"items": [
{}
],
"page_token": "<string>",
"row_count": 123
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Authorizations
Organization API key (sl_…).
Headers
The organization ID the request is scoped to.
Body
An aggregate query over the activity on insights.
Each activity record is one change to one insight field: a view, or an edit to its
status, assignee, effort or savings estimate. A view is recorded when it changes
who last viewed the insight, so a repeat view by its last viewer adds no record. Group with dimensions, aggregate
with measures, narrow rows with filters or filter_expression, and narrow
aggregates with measure_filters. The action_* and actor dimensions describe
the change; every other dimension describes the insight it was made to. Rows are
already limited to the insights the caller may see.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- InFilter[Union[SemiStructuredDimension[InsightActivityDimensionName], InsightActivityDimensionName]]
- ArrayContainsFilter[Union[SemiStructuredDimension[InsightActivityDimensionName], InsightActivityDimensionName]]
- IsFilter[Union[SemiStructuredDimension[InsightActivityDimensionName], InsightActivityDimensionName]]
- LikeFilter[Union[SemiStructuredDimension[InsightActivityDimensionName], InsightActivityDimensionName]]
- MultiLikeFilter[Union[SemiStructuredDimension[InsightActivityDimensionName], InsightActivityDimensionName]]
- EqFilter[Union[SemiStructuredDimension[InsightActivityDimensionName], InsightActivityDimensionName]]
- FilterExpression[Union[SemiStructuredDimension[InsightActivityDimensionName], InsightActivityDimensionName]]
- InRelativeDateRangeFilter[Union[SemiStructuredDimension[InsightActivityDimensionName], InsightActivityDimensionName]]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- InFilter[InsightActivityMeasureName]
- ArrayContainsFilter[InsightActivityMeasureName]
- IsFilter[InsightActivityMeasureName]
- LikeFilter[InsightActivityMeasureName]
- MultiLikeFilter[InsightActivityMeasureName]
- EqFilter[InsightActivityMeasureName]
- FilterExpression[InsightActivityMeasureName]
- InRelativeDateRangeFilter[InsightActivityMeasureName]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum rows to return, at most 10000. An aggregation that produces more rows than this is silently cut short at the limit, so narrow the filters or group by fewer dimensions rather than raising it to see everything.
1 <= x <= 10000
