Skip to main content
PATCH
/
dashboards
/
widgets
/
{id}
/
cURL
curl --request PATCH \
  --url https://api.cekura.ai/dashboards/widgets/{id}/ \
  --header 'Content-Type: application/json' \
  --header 'X-CEKURA-API-KEY: <api-key>' \
  --data '
{
  "dashboard": 123,
  "name": "<string>",
  "filters": {
    "field": "<string>",
    "value": "<unknown>",
    "conditions": [
      "<unknown>"
    ]
  },
  "field": "",
  "metric": 123,
  "group_by": "<unknown>",
  "metadata": "<unknown>"
}
'
import requests

url = "https://api.cekura.ai/dashboards/widgets/{id}/"

payload = {
"dashboard": 123,
"name": "<string>",
"filters": {
"field": "<string>",
"value": "<unknown>",
"conditions": ["<unknown>"]
},
"field": "",
"metric": 123,
"group_by": "<unknown>",
"metadata": "<unknown>"
}
headers = {
"X-CEKURA-API-KEY": "<api-key>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {'X-CEKURA-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dashboard: 123,
name: '<string>',
filters: {field: '<string>', value: '<unknown>', conditions: ['<unknown>']},
field: '',
metric: 123,
group_by: '<unknown>',
metadata: '<unknown>'
})
};

fetch('https://api.cekura.ai/dashboards/widgets/{id}/', 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/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'dashboard' => 123,
'name' => '<string>',
'filters' => [
'field' => '<string>',
'value' => '<unknown>',
'conditions' => [
'<unknown>'
]
],
'field' => '',
'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/{id}/"

payload := strings.NewReader("{\n \"dashboard\": 123,\n \"name\": \"<string>\",\n \"filters\": {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\",\n \"conditions\": [\n \"<unknown>\"\n ]\n },\n \"field\": \"\",\n \"metric\": 123,\n \"group_by\": \"<unknown>\",\n \"metadata\": \"<unknown>\"\n}")

req, _ := http.NewRequest("PATCH", 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.patch("https://api.cekura.ai/dashboards/widgets/{id}/")
.header("X-CEKURA-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dashboard\": 123,\n \"name\": \"<string>\",\n \"filters\": {\n \"field\": \"<string>\",\n \"value\": \"<unknown>\",\n \"conditions\": [\n \"<unknown>\"\n ]\n },\n \"field\": \"\",\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/{id}/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.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\": \"<string>\",\n \"value\": \"<unknown>\",\n \"conditions\": [\n \"<unknown>\"\n ]\n },\n \"field\": \"\",\n \"metric\": 123,\n \"group_by\": \"<unknown>\",\n \"metadata\": \"<unknown>\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "dashboard": 123,
  "name": "<string>",
  "filters": {
    "field": "<string>",
    "value": "<unknown>",
    "conditions": [
      "<unknown>"
    ]
  },
  "effective_filters": {
    "field": "<string>",
    "value": "<unknown>",
    "conditions": [
      "<unknown>"
    ]
  },
  "field": "",
  "metric": 123,
  "metric_name": "<string>",
  "group_by": "<unknown>",
  "metadata": "<unknown>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

X-CEKURA-API-KEY
string
header
required

API Key Authentication. It should be included in the header of each request.

Path Parameters

id
string
required

Body

Widget configuration. Key rules:

  • line / pie: set field only (e.g. "duration", "call_ended_reason"). No aggregation needed.
  • bar: set field + aggregation_function (e.g. "count") + time_period (e.g. "day").
  • stat: leave field empty — returns total_calls, success_rate, avg_duration, p95_latency.
  • field = "metric_evaluations.value": metric (integer metric ID) is required. Get valid IDs from GET /test_framework/v1/metrics?agent_id=<id>.
  • effective_filters (read-only): merged dashboard + widget filters — useful for debugging.
dashboard
integer | null

Dashboard this widget belongs to

name
string | null

Optional name/title for the widget

Maximum string length: 255
filters
object | null

Filter conditions to scope the data. See the Dashboards guide for supported fields, operators, and syntax.

Examples:
{
"field": "success",
"op": "eq",
"value": true
}
{
"operator": "and",
"conditions": [
{
"field": "timestamp",
"op": "gte",
"value": "today-7d"
},
{
"field": "duration",
"op": "gte",
"value": 60
}
]
}
chart_type
enum<string>

Type of chart to display

  • line - Line
  • bar - Bar
  • pie - Pie
  • stat - Stat
Available options:
line,
bar,
pie,
stat
data_type
enum<string> | null

Data type of the field being plotted (optional, can be inferred)

  • numeric - Numeric
  • boolean - Boolean
  • string - String
  • datetime - DateTime
  • dynamic - Dynamic
Available options:
numeric,
boolean,
string,
datetime,
dynamic,
,
null
field
string
default:""

Field name to plot. See the Dashboards guide for available fields, valid chart types, and aggregation combinations.

Maximum string length: 255
Examples:

"duration"

"success"

"call_ended_reason"

"metric_evaluations.value"

"metadata.region"

metric
integer | null

Metric to use when field is 'metric_evaluations.value'

time_period
enum<string> | null

Time period for aggregation (for bar charts)

  • hour - Hour
  • day - Day
  • week - Week
  • month - Month
Available options:
hour,
day,
week,
month,
,
null
aggregation_function
enum<string> | null

Aggregation function to apply (for bar charts)

  • count - Count
  • sum - Sum
  • avg - Average
  • min - Minimum
  • max - Maximum
  • p50 - 50th Percentile (Median)
  • p95 - 95th Percentile
  • p99 - 99th Percentile
Available options:
count,
sum,
avg,
min,
max,
p50,
p95,
p99,
,
null
group_by
any | 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.

metadata
any | null

Frontend metadata (e.g., position, size, styling)

Response

200 - application/json

Widget configuration. Key rules:

  • line / pie: set field only (e.g. "duration", "call_ended_reason"). No aggregation needed.
  • bar: set field + aggregation_function (e.g. "count") + time_period (e.g. "day").
  • stat: leave field empty — returns total_calls, success_rate, avg_duration, p95_latency.
  • field = "metric_evaluations.value": metric (integer metric ID) is required. Get valid IDs from GET /test_framework/v1/metrics?agent_id=<id>.
  • effective_filters (read-only): merged dashboard + widget filters — useful for debugging.
chart_type
enum<string>
required

Type of chart to display

  • line - Line
  • bar - Bar
  • pie - Pie
  • stat - Stat
Available options:
line,
bar,
pie,
stat
id
integer
read-only
dashboard
integer | null

Dashboard this widget belongs to

name
string | null

Optional name/title for the widget

Maximum string length: 255
filters
object | null

Filter conditions to scope the data. See the Dashboards guide for supported fields, operators, and syntax.

Examples:
{
"field": "success",
"op": "eq",
"value": true
}
{
"operator": "and",
"conditions": [
{
"field": "timestamp",
"op": "gte",
"value": "today-7d"
},
{
"field": "duration",
"op": "gte",
"value": 60
}
]
}
effective_filters
object
read-only

Merged filters from dashboard and widget (read-only). Can be used with the call logs API filters_v2 parameter.

Examples:
{
"field": "success",
"op": "eq",
"value": true
}
{
"operator": "and",
"conditions": [
{
"field": "timestamp",
"op": "gte",
"value": "today-7d"
},
{
"field": "duration",
"op": "gte",
"value": 60
}
]
}
data_type
enum<string> | null

Data type of the field being plotted (optional, can be inferred)

  • numeric - Numeric
  • boolean - Boolean
  • string - String
  • datetime - DateTime
  • dynamic - Dynamic
Available options:
numeric,
boolean,
string,
datetime,
dynamic,
,
null
field
string
default:""

Field name to plot. See the Dashboards guide for available fields, valid chart types, and aggregation combinations.

Maximum string length: 255
Examples:

"duration"

"success"

"call_ended_reason"

"metric_evaluations.value"

"metadata.region"

metric
integer | null

Metric to use when field is 'metric_evaluations.value'

metric_name
string
read-only

Name of the metric (if metric is set)

time_period
enum<string> | null

Time period for aggregation (for bar charts)

  • hour - Hour
  • day - Day
  • week - Week
  • month - Month
Available options:
hour,
day,
week,
month,
,
null
aggregation_function
enum<string> | null

Aggregation function to apply (for bar charts)

  • count - Count
  • sum - Sum
  • avg - Average
  • min - Minimum
  • max - Maximum
  • p50 - 50th Percentile (Median)
  • p95 - 95th Percentile
  • p99 - 99th Percentile
Available options:
count,
sum,
avg,
min,
max,
p50,
p95,
p99,
,
null
group_by
any | 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.

metadata
any | null

Frontend metadata (e.g., position, size, styling)

created_at
string<date-time> | null
read-only

When the widget was created

updated_at
string<date-time> | null
read-only

When the widget was last updated