curl --request POST \
--url https://api.cekura.ai/dashboards/widgets/preview_data/ \
--header 'Content-Type: application/json' \
--header 'X-CEKURA-API-KEY: <api-key>' \
--data '
{
"dashboard": 123,
"name": "<string>",
"filters": {
"field": "success",
"op": "eq",
"value": true
},
"field": "duration",
"metric": 123,
"group_by": "<unknown>",
"metadata": "<unknown>"
}
'import requests
url = "https://api.cekura.ai/dashboards/widgets/preview_data/"
payload = {
"dashboard": 123,
"name": "<string>",
"filters": {
"field": "success",
"op": "eq",
"value": True
},
"field": "duration",
"metric": 123,
"group_by": "<unknown>",
"metadata": "<unknown>"
}
headers = {
"X-CEKURA-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CEKURA-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dashboard: 123,
name: '<string>',
filters: {field: 'success', op: 'eq', value: true},
field: 'duration',
metric: 123,
group_by: '<unknown>',
metadata: '<unknown>'
})
};
fetch('https://api.cekura.ai/dashboards/widgets/preview_data/', 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.cekura.ai/dashboards/widgets/preview_data/",
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([
'dashboard' => 123,
'name' => '<string>',
'filters' => [
'field' => 'success',
'op' => 'eq',
'value' => true
],
'field' => 'duration',
'metric' => 123,
'group_by' => '<unknown>',
'metadata' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CEKURA-API-KEY: <api-key>"
],
]);
$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.cekura.ai/dashboards/widgets/preview_data/"
payload := strings.NewReader("{\n \"dashboard\": 123,\n \"name\": \"<string>\",\n \"filters\": {\n \"field\": \"success\",\n \"op\": \"eq\",\n \"value\": true\n },\n \"field\": \"duration\",\n \"metric\": 123,\n \"group_by\": \"<unknown>\",\n \"metadata\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CEKURA-API-KEY", "<api-key>")
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.cekura.ai/dashboards/widgets/preview_data/")
.header("X-CEKURA-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dashboard\": 123,\n \"name\": \"<string>\",\n \"filters\": {\n \"field\": \"success\",\n \"op\": \"eq\",\n \"value\": true\n },\n \"field\": \"duration\",\n \"metric\": 123,\n \"group_by\": \"<unknown>\",\n \"metadata\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cekura.ai/dashboards/widgets/preview_data/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CEKURA-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dashboard\": 123,\n \"name\": \"<string>\",\n \"filters\": {\n \"field\": \"success\",\n \"op\": \"eq\",\n \"value\": true\n },\n \"field\": \"duration\",\n \"metric\": 123,\n \"group_by\": \"<unknown>\",\n \"metadata\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"widget_id": 123,
"field_name": "<string>",
"chart_type": "<string>",
"data": [
{
"id": 1,
"timestamp": "2025-11-03T10:30:00Z",
"value": 45
},
{
"id": 2,
"timestamp": "2025-11-03T11:15:00Z",
"value": 62
}
],
"aggregation_function": "<string>",
"time_period": "<string>",
"group_by": null,
"metadata": {
"display_name": "<string>",
"data_type": "numeric",
"filter_value": "<unknown>"
},
"can_group_by": false
}Preview Widget Data
Preview widget data without saving.
curl --request POST \
--url https://api.cekura.ai/dashboards/widgets/preview_data/ \
--header 'Content-Type: application/json' \
--header 'X-CEKURA-API-KEY: <api-key>' \
--data '
{
"dashboard": 123,
"name": "<string>",
"filters": {
"field": "success",
"op": "eq",
"value": true
},
"field": "duration",
"metric": 123,
"group_by": "<unknown>",
"metadata": "<unknown>"
}
'import requests
url = "https://api.cekura.ai/dashboards/widgets/preview_data/"
payload = {
"dashboard": 123,
"name": "<string>",
"filters": {
"field": "success",
"op": "eq",
"value": True
},
"field": "duration",
"metric": 123,
"group_by": "<unknown>",
"metadata": "<unknown>"
}
headers = {
"X-CEKURA-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CEKURA-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dashboard: 123,
name: '<string>',
filters: {field: 'success', op: 'eq', value: true},
field: 'duration',
metric: 123,
group_by: '<unknown>',
metadata: '<unknown>'
})
};
fetch('https://api.cekura.ai/dashboards/widgets/preview_data/', 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.cekura.ai/dashboards/widgets/preview_data/",
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([
'dashboard' => 123,
'name' => '<string>',
'filters' => [
'field' => 'success',
'op' => 'eq',
'value' => true
],
'field' => 'duration',
'metric' => 123,
'group_by' => '<unknown>',
'metadata' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CEKURA-API-KEY: <api-key>"
],
]);
$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.cekura.ai/dashboards/widgets/preview_data/"
payload := strings.NewReader("{\n \"dashboard\": 123,\n \"name\": \"<string>\",\n \"filters\": {\n \"field\": \"success\",\n \"op\": \"eq\",\n \"value\": true\n },\n \"field\": \"duration\",\n \"metric\": 123,\n \"group_by\": \"<unknown>\",\n \"metadata\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CEKURA-API-KEY", "<api-key>")
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.cekura.ai/dashboards/widgets/preview_data/")
.header("X-CEKURA-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dashboard\": 123,\n \"name\": \"<string>\",\n \"filters\": {\n \"field\": \"success\",\n \"op\": \"eq\",\n \"value\": true\n },\n \"field\": \"duration\",\n \"metric\": 123,\n \"group_by\": \"<unknown>\",\n \"metadata\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cekura.ai/dashboards/widgets/preview_data/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CEKURA-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dashboard\": 123,\n \"name\": \"<string>\",\n \"filters\": {\n \"field\": \"success\",\n \"op\": \"eq\",\n \"value\": true\n },\n \"field\": \"duration\",\n \"metric\": 123,\n \"group_by\": \"<unknown>\",\n \"metadata\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"widget_id": 123,
"field_name": "<string>",
"chart_type": "<string>",
"data": [
{
"id": 1,
"timestamp": "2025-11-03T10:30:00Z",
"value": 45
},
{
"id": 2,
"timestamp": "2025-11-03T11:15:00Z",
"value": 62
}
],
"aggregation_function": "<string>",
"time_period": "<string>",
"group_by": null,
"metadata": {
"display_name": "<string>",
"data_type": "numeric",
"filter_value": "<unknown>"
},
"can_group_by": false
}Authorizations
API Key Authentication. It should be included in the header of each request.
Body
Widget configuration. Key rules:
line/pie: setfieldonly (e.g."duration","call_ended_reason"). No aggregation needed.bar: setfield+aggregation_function(e.g."count") +time_period(e.g."day").stat: leavefieldempty — returns total_calls, success_rate, avg_duration, p95_latency.field = "metric_evaluations.value":metric(integer metric ID) is required. Get valid IDs fromGET /test_framework/v1/metrics?agent_id=<id>.effective_filters(read-only): merged dashboard + widget filters — useful for debugging.
Type of chart to display
line- Linebar- Barpie- Piestat- Stat
line, bar, pie, stat Dashboard this widget belongs to
Optional name/title for the widget
255Filter conditions to scope the data. See the Dashboards guide for supported fields, operators, and syntax.
Show child attributes
Show child attributes
{
"field": "success",
"op": "eq",
"value": true
}
{
"operator": "and",
"conditions": [
{
"field": "timestamp",
"op": "gte",
"value": "today-7d"
},
{
"field": "duration",
"op": "gte",
"value": 60
}
]
}
Data type of the field being plotted (optional, can be inferred)
numeric- Numericboolean- Booleanstring- Stringdatetime- DateTimedynamic- Dynamic
numeric, boolean, string, datetime, dynamic, , null Field name to plot. See the Dashboards guide for available fields, valid chart types, and aggregation combinations.
255"duration"
"success"
"call_ended_reason"
"metric_evaluations.value"
"metadata.region"
Metric to use when field is 'metric_evaluations.value'
Time period for aggregation (for bar charts)
hour- Hourday- Dayweek- Weekmonth- Month
hour, day, week, month, , null Aggregation function to apply (for bar charts)
count- Countsum- Sumavg- Averagemin- Minimummax- Maximump50- 50th Percentile (Median)p95- 95th Percentilep99- 99th Percentile
count, sum, avg, min, max, p50, p95, p99, , null Optional group-by configuration. Field group: {"type": "field", "field": "agent.id"}. Time bucket: {"type": "bucket", "interval": 3600000} (interval in milliseconds). Leave null or empty for no grouping.
Frontend metadata (e.g., position, size, styling)
Response
Chart data. Format depends on chart_type:
Line chart: [{id, timestamp, value}, ...]
Bar chart: [{time_interval, value, sample_count}, ...]
Pie chart: [{label, value, percentage}, ...]
See the Dashboards guide for full examples.
[
{
"id": 1,
"timestamp": "2025-11-03T10:30:00Z",
"value": 45
},
{
"id": 2,
"timestamp": "2025-11-03T11:15:00Z",
"value": 62
}
]
[
{
"time_interval": "2025-11-03T00:00:00Z",
"value": 4.5,
"sample_count": 10
},
{
"time_interval": "2025-11-04T00:00:00Z",
"value": 3.2,
"sample_count": 8
}
]
[
{
"label": "customer_ended_call",
"value": 320,
"percentage": 45.7
},
{
"label": "agent_ended_call",
"value": 210,
"percentage": 30
}
]
Additional metadata about the plotted data. See the Dashboards guide for details.
Show child attributes
Show child attributes