Get one widget's data
const url = 'http://localhost:8080/api/v1/projects/example/dashboards/query';const options = { method: 'POST', headers: { cookie: 'cetra_session=<cetra_session>', 'Content-Type': 'application/json' }, body: '{"bucket":"auto","compare":true,"filter":"example","from":"2026-04-15T12:00:00Z","group_by":"model","include_eval":true,"include_experiments":true,"query":{"breakdown":{"field":"example","limit":1,"other":true},"filter":"example","measures":[{"agg":"count","field":"example","label":"example","where":"example"}],"source":"traces"},"shape":"series","to":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/v1/projects/example/dashboards/query \ --header 'Content-Type: application/json' \ --cookie cetra_session=<cetra_session> \ --data '{ "bucket": "auto", "compare": true, "filter": "example", "from": "2026-04-15T12:00:00Z", "group_by": "model", "include_eval": true, "include_experiments": true, "query": { "breakdown": { "field": "example", "limit": 1, "other": true }, "filter": "example", "measures": [ { "agg": "count", "field": "example", "label": "example", "where": "example" } ], "source": "traces" }, "shape": "series", "to": "2026-04-15T12:00:00Z" }'Answers one widget query over [from, to): a series (one value per bucket) or a total (one value over the range, with compare also the previous range). Spec 05 § Dashboard queries. The dashboard’s filter is a traces expression, and the default exclusions apply: evaluation, playground and assistant traces (environment = cetra-eval, environment = cetra-playground or environment = cetra-assistant) and experiment traces are left out unless include_eval or include_experiments is set. A read: a read-only personal access token and a read key may call it. Results are cached for 10 seconds per project and body.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project UUID, URL-encoded org-slug/project-slug, or current.
Request Bodyrequired
Section titled “Request Bodyrequired”Body of POST /api/v1/projects/{project}/dashboards/query. Spec 05 § Dashboard queries.
object
Bucket width. Defaults to auto. Ignored for total.
total only: also the value over the previous range of the same length. Default false.
The dashboard’s filter, a traces expression.
Inclusive range start, RFC 3339.
The dashboard’s split. Ignored when the query has its own breakdown, and for scores.
Include traces from the reserved environments (cetra-eval, cetra-playground, cetra-assistant). Default false.
Include experiment traces. Default false.
The widget’s query.
object
The split, if any.
object
The field the rows are grouped by.
Groups kept, 1 to 20. Default 5.
Whether the rows of every other value form one more group. Default true.
A filter over the source view.
One to six measures.
One measure of a widget query.
object
How the rows aggregate.
The field aggregated. Absent for count and rate.
Name shown in the legend, 0 to 60 characters. Not part of the query.
A filter over the source view. Required for rate.
The view the query reads.
series or total.
Exclusive range end, RFC 3339.
Responses
Section titled “Responses”The widget’s answer, tagged by shape.
A widget answer, tagged by shape.
shape: series.
object
Width of every bucket, nanoseconds.
The series: breakdown order (largest first, other last), then measure order.
One measure of one group over the buckets. Spec 05 § Dashboard queries.
object
The breakdown value. Omitted without a breakdown, and for the other group.
Index of the measure in the query.
Whether this is the group of every other value.
One point per bucket with rows, in time order.
One bucket of a series. Spec 05 § Dashboard queries.
object
Source rows of the group in the bucket.
Bucket start, nanoseconds since the Unix epoch. JSON is RFC 3339.
The aggregate over the bucket. Omitted when it is null.
shape: total.
object
One row per group, in breakdown order (other last). One row without a breakdown.
One group of a total, with every measure. Spec 05 § Dashboard queries.
object
The breakdown value. Omitted without a breakdown, and for the other group.
Whether this is the group of every other value.
With compare, the same values over the previous range of the same length.
The value of each measure, in query order. Null when the group has no rows.
Example
{ "shape": "series"}The request is malformed or a filter is invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}No credentials, or the credentials are invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The resource does not exist.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The request body is larger than the limit.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The request body is not JSON.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The query took longer than its time limit, needed more memory or temporary disk space than allowed, a filter deletion matched more than 100,000 traces, or the owner cannot be that user (code owner_not_allowed).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}Too many requests.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The server is busy or a dependency is unavailable. Retry later.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}