curl --request POST \
--url https://api.select.dev/v2/insights/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/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/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/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/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/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/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 insights 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. 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.
curl --request POST \
--url https://api.select.dev/v2/insights/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/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/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/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/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/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/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 insights.
Group with dimensions, aggregate with measures, narrow rows with filters or
filter_expression, and narrow aggregates with measure_filters. 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[InsightDimensionName], InsightDimensionName]]
- ArrayContainsFilter[Union[SemiStructuredDimension[InsightDimensionName], InsightDimensionName]]
- IsFilter[Union[SemiStructuredDimension[InsightDimensionName], InsightDimensionName]]
- LikeFilter[Union[SemiStructuredDimension[InsightDimensionName], InsightDimensionName]]
- MultiLikeFilter[Union[SemiStructuredDimension[InsightDimensionName], InsightDimensionName]]
- EqFilter[Union[SemiStructuredDimension[InsightDimensionName], InsightDimensionName]]
- FilterExpression[Union[SemiStructuredDimension[InsightDimensionName], InsightDimensionName]]
- InRelativeDateRangeFilter[Union[SemiStructuredDimension[InsightDimensionName], InsightDimensionName]]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- InFilter[InsightMeasureName]
- ArrayContainsFilter[InsightMeasureName]
- IsFilter[InsightMeasureName]
- LikeFilter[InsightMeasureName]
- MultiLikeFilter[InsightMeasureName]
- EqFilter[InsightMeasureName]
- FilterExpression[InsightMeasureName]
- InRelativeDateRangeFilter[InsightMeasureName]
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
