Query project analytics
curl --request POST \
--url https://api.uselemma.ai/projects/{project_id}/analytics/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start": "2023-11-07T05:31:56Z",
"end_exclusive": "2023-11-07T05:31:56Z",
"measures": [
{
"as": "<string>"
}
],
"filters": [
{
"value": "<string>"
}
],
"group_by": [
{
"as": "<string>"
}
],
"order_by": [
{
"measure": "<string>"
}
],
"limit": 123
}
'import requests
url = "https://api.uselemma.ai/projects/{project_id}/analytics/query"
payload = {
"start": "2023-11-07T05:31:56Z",
"end_exclusive": "2023-11-07T05:31:56Z",
"measures": [{ "as": "<string>" }],
"filters": [{ "value": "<string>" }],
"group_by": [{ "as": "<string>" }],
"order_by": [{ "measure": "<string>" }],
"limit": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '2023-11-07T05:31:56Z',
end_exclusive: '2023-11-07T05:31:56Z',
measures: [{as: '<string>'}],
filters: [{value: '<string>'}],
group_by: [{as: '<string>'}],
order_by: [{measure: '<string>'}],
limit: 123
})
};
fetch('https://api.uselemma.ai/projects/{project_id}/analytics/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.uselemma.ai/projects/{project_id}/analytics/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([
'start' => '2023-11-07T05:31:56Z',
'end_exclusive' => '2023-11-07T05:31:56Z',
'measures' => [
[
'as' => '<string>'
]
],
'filters' => [
[
'value' => '<string>'
]
],
'group_by' => [
[
'as' => '<string>'
]
],
'order_by' => [
[
'measure' => '<string>'
]
],
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.uselemma.ai/projects/{project_id}/analytics/query"
payload := strings.NewReader("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end_exclusive\": \"2023-11-07T05:31:56Z\",\n \"measures\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"group_by\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"order_by\": [\n {\n \"measure\": \"<string>\"\n }\n ],\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.uselemma.ai/projects/{project_id}/analytics/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end_exclusive\": \"2023-11-07T05:31:56Z\",\n \"measures\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"group_by\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"order_by\": [\n {\n \"measure\": \"<string>\"\n }\n ],\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselemma.ai/projects/{project_id}/analytics/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end_exclusive\": \"2023-11-07T05:31:56Z\",\n \"measures\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"group_by\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"order_by\": [\n {\n \"measure\": \"<string>\"\n }\n ],\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"rows": [
{}
],
"truncated": true,
"window": {
"start": "<string>",
"end_exclusive": "<string>"
}
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}Projects
Query project analytics
Runs one catalog aggregate over stored analytics for a project.
POST
/
projects
/
{project_id}
/
analytics
/
query
Query project analytics
curl --request POST \
--url https://api.uselemma.ai/projects/{project_id}/analytics/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"start": "2023-11-07T05:31:56Z",
"end_exclusive": "2023-11-07T05:31:56Z",
"measures": [
{
"as": "<string>"
}
],
"filters": [
{
"value": "<string>"
}
],
"group_by": [
{
"as": "<string>"
}
],
"order_by": [
{
"measure": "<string>"
}
],
"limit": 123
}
'import requests
url = "https://api.uselemma.ai/projects/{project_id}/analytics/query"
payload = {
"start": "2023-11-07T05:31:56Z",
"end_exclusive": "2023-11-07T05:31:56Z",
"measures": [{ "as": "<string>" }],
"filters": [{ "value": "<string>" }],
"group_by": [{ "as": "<string>" }],
"order_by": [{ "measure": "<string>" }],
"limit": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '2023-11-07T05:31:56Z',
end_exclusive: '2023-11-07T05:31:56Z',
measures: [{as: '<string>'}],
filters: [{value: '<string>'}],
group_by: [{as: '<string>'}],
order_by: [{measure: '<string>'}],
limit: 123
})
};
fetch('https://api.uselemma.ai/projects/{project_id}/analytics/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.uselemma.ai/projects/{project_id}/analytics/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([
'start' => '2023-11-07T05:31:56Z',
'end_exclusive' => '2023-11-07T05:31:56Z',
'measures' => [
[
'as' => '<string>'
]
],
'filters' => [
[
'value' => '<string>'
]
],
'group_by' => [
[
'as' => '<string>'
]
],
'order_by' => [
[
'measure' => '<string>'
]
],
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.uselemma.ai/projects/{project_id}/analytics/query"
payload := strings.NewReader("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end_exclusive\": \"2023-11-07T05:31:56Z\",\n \"measures\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"group_by\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"order_by\": [\n {\n \"measure\": \"<string>\"\n }\n ],\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.uselemma.ai/projects/{project_id}/analytics/query")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end_exclusive\": \"2023-11-07T05:31:56Z\",\n \"measures\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"group_by\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"order_by\": [\n {\n \"measure\": \"<string>\"\n }\n ],\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uselemma.ai/projects/{project_id}/analytics/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end_exclusive\": \"2023-11-07T05:31:56Z\",\n \"measures\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"filters\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"group_by\": [\n {\n \"as\": \"<string>\"\n }\n ],\n \"order_by\": [\n {\n \"measure\": \"<string>\"\n }\n ],\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_body{
"rows": [
{}
],
"truncated": true,
"window": {
"start": "<string>",
"end_exclusive": "<string>"
}
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}{
"detail": "<string>",
"code": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Project ID.
Body
application/json
Available options:
generation.completed, insight.activated, insight.created, insight.deleted, insight.merged, insight.review_completed, issue.created, issue.dismissed, issue.flagged, issue.insight_assessed, issue.insight_moved, issue.occurrence_recorded, issue.reopened, issue.resolved, issue.review_started, issue.slack_sent, issue.unflagged, span.errored, tool.called, trace.processed Second-aligned UTC instant. The window must end after start and must be at most 90 days.
Second-aligned UTC instant. The window must end after start and must be at most 90 days.
Required array length:
1 - 8 elementsShow child attributes
Show child attributes
Maximum array length:
12Show child attributes
Show child attributes
Maximum array length:
3- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum array length:
2Show child attributes
Show child attributes
Required range:
x <= 500