Get all analytics data in a single batched request
curl --request POST \
--url https://api.getgranite.ai/api/analytics/batch \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"granularity": "day",
"workflow_name": "<string>"
}
'import requests
url = "https://api.getgranite.ai/api/analytics/batch"
payload = {
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"granularity": "day",
"workflow_name": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
granularity: 'day',
workflow_name: '<string>'
})
};
fetch('https://api.getgranite.ai/api/analytics/batch', 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.getgranite.ai/api/analytics/batch",
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_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'granularity' => 'day',
'workflow_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.getgranite.ai/api/analytics/batch"
payload := strings.NewReader("{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"granularity\": \"day\",\n \"workflow_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.getgranite.ai/api/analytics/batch")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"granularity\": \"day\",\n \"workflow_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getgranite.ai/api/analytics/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"granularity\": \"day\",\n \"workflow_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"total_executions": 0,
"completed": 0,
"total_failures": 0,
"success_rate": 0,
"avg_duration_ms": 0,
"active_today": 0,
"total_tokens": 0
},
"executions_over_time": {
"data": [
{
"time": "<string>",
"total": 0,
"completed": 0,
"failed": 0,
"running": 0,
"pending": 0
}
],
"granularity": "<string>"
},
"success_rate": {
"data": [
{
"time": "<string>",
"total": 0,
"completed": 0,
"success_rate": 0
}
],
"granularity": "<string>"
},
"failure_breakdown": {
"data": [
{
"category": "<string>",
"count": 123,
"sample_messages": [
"<string>"
]
}
],
"total_failures": 0
},
"trigger_distribution": {
"data": [
{
"trigger_type": "<string>",
"count": 123
}
]
},
"top_automations": {
"data": [
{
"workflow_name": "<string>",
"executions": 123,
"completed": 123,
"failures": 123,
"success_rate": 123,
"avg_duration_ms": 123,
"last_execution": "<string>"
}
],
"sort_by": "<string>"
},
"duration_distribution": {
"stats": {
"total": 0,
"avg_ms": 0,
"min_ms": 0,
"max_ms": 0,
"p50_ms": 0,
"p75_ms": 0,
"p90_ms": 0,
"p95_ms": 0,
"p99_ms": 0
},
"histogram": [
{
"bucket_start_ms": 123,
"bucket_end_ms": 123,
"count": 123
}
]
},
"recent_failures": {
"data": [
{
"execution_id": "<string>",
"run_id": "<string>",
"workflow_name": "<string>",
"error_category": "<string>",
"triggered_by": "<string>",
"started_at": "<string>",
"error_message": "<string>",
"duration_ms": 123
}
],
"total": 123,
"limit": 123,
"offset": 123
},
"actions_per_workflow": {
"data": [
{
"workflow_name": "<string>",
"clicks": 0,
"keystrokes": 0,
"scrolls": 0,
"screenshots": 0,
"total_steps": 0
}
]
},
"workflow_complexity": {
"data": [
{
"workflow_name": "<string>",
"complexity_score": 123,
"total_steps": 123,
"total_iterations": 123,
"parameters_count": 123,
"success_rate": 123,
"avg_duration_ms": 123
}
]
},
"endpoint_usage": {
"data": [
{
"endpoint_slug": "<string>",
"http_method": "<string>",
"invocations": 123,
"success_count": 123,
"success_rate": 123,
"avg_response_time_ms": 123,
"p95_response_time_ms": 123
}
]
},
"workflows": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Analytics
Batch Request
POST
/
api
/
analytics
/
batch
Get all analytics data in a single batched request
curl --request POST \
--url https://api.getgranite.ai/api/analytics/batch \
--header 'Content-Type: application/json' \
--data '
{
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"granularity": "day",
"workflow_name": "<string>"
}
'import requests
url = "https://api.getgranite.ai/api/analytics/batch"
payload = {
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"granularity": "day",
"workflow_name": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
granularity: 'day',
workflow_name: '<string>'
})
};
fetch('https://api.getgranite.ai/api/analytics/batch', 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.getgranite.ai/api/analytics/batch",
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_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'granularity' => 'day',
'workflow_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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.getgranite.ai/api/analytics/batch"
payload := strings.NewReader("{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"granularity\": \"day\",\n \"workflow_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.getgranite.ai/api/analytics/batch")
.header("Content-Type", "application/json")
.body("{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"granularity\": \"day\",\n \"workflow_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getgranite.ai/api/analytics/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"granularity\": \"day\",\n \"workflow_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"total_executions": 0,
"completed": 0,
"total_failures": 0,
"success_rate": 0,
"avg_duration_ms": 0,
"active_today": 0,
"total_tokens": 0
},
"executions_over_time": {
"data": [
{
"time": "<string>",
"total": 0,
"completed": 0,
"failed": 0,
"running": 0,
"pending": 0
}
],
"granularity": "<string>"
},
"success_rate": {
"data": [
{
"time": "<string>",
"total": 0,
"completed": 0,
"success_rate": 0
}
],
"granularity": "<string>"
},
"failure_breakdown": {
"data": [
{
"category": "<string>",
"count": 123,
"sample_messages": [
"<string>"
]
}
],
"total_failures": 0
},
"trigger_distribution": {
"data": [
{
"trigger_type": "<string>",
"count": 123
}
]
},
"top_automations": {
"data": [
{
"workflow_name": "<string>",
"executions": 123,
"completed": 123,
"failures": 123,
"success_rate": 123,
"avg_duration_ms": 123,
"last_execution": "<string>"
}
],
"sort_by": "<string>"
},
"duration_distribution": {
"stats": {
"total": 0,
"avg_ms": 0,
"min_ms": 0,
"max_ms": 0,
"p50_ms": 0,
"p75_ms": 0,
"p90_ms": 0,
"p95_ms": 0,
"p99_ms": 0
},
"histogram": [
{
"bucket_start_ms": 123,
"bucket_end_ms": 123,
"count": 123
}
]
},
"recent_failures": {
"data": [
{
"execution_id": "<string>",
"run_id": "<string>",
"workflow_name": "<string>",
"error_category": "<string>",
"triggered_by": "<string>",
"started_at": "<string>",
"error_message": "<string>",
"duration_ms": 123
}
],
"total": 123,
"limit": 123,
"offset": 123
},
"actions_per_workflow": {
"data": [
{
"workflow_name": "<string>",
"clicks": 0,
"keystrokes": 0,
"scrolls": 0,
"screenshots": 0,
"total_steps": 0
}
]
},
"workflow_complexity": {
"data": [
{
"workflow_name": "<string>",
"complexity_score": 123,
"total_steps": 123,
"total_iterations": 123,
"parameters_count": 123,
"success_rate": 123,
"avg_duration_ms": 123
}
]
},
"endpoint_usage": {
"data": [
{
"endpoint_slug": "<string>",
"http_method": "<string>",
"invocations": 123,
"success_count": 123,
"success_rate": 123,
"avg_response_time_ms": 123,
"p95_response_time_ms": 123
}
]
},
"workflows": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Body
application/json
Common filters for analytics queries.
Available options:
hour, day, week, month Available options:
manual, endpoint, scheduled Available options:
pending, running, completed, failed, cancelled Response
Successful Response
Dashboard summary statistics.
Show child attributes
Show child attributes
Response for executions over time.
Show child attributes
Show child attributes
Response for success rate over time.
Show child attributes
Show child attributes
Response for failure breakdown.
Show child attributes
Show child attributes
Response for trigger distribution.
Show child attributes
Show child attributes
Response for top automations.
Show child attributes
Show child attributes
Response for duration distribution.
Show child attributes
Show child attributes
Response for recent failures.
Show child attributes
Show child attributes
Response for actions per workflow.
Show child attributes
Show child attributes
Response for workflow complexity.
Show child attributes
Show child attributes
Response for endpoint usage.
Show child attributes
Show child attributes
⌘I