Skip to main content
POST
Create a chart

Authorizations

next-auth.session-token
string
cookie
required

NextAuth session JWT cookie. Development: often next-auth.session-token. Production (HTTPS): often __Secure-next-auth.session-token. Send the cookie your browser receives after sign-in.

Body

application/json
workspaceId
string<cuid2>
required
datasetId
string<cuid2>
required

The Feedback Dataset the chart reads. Needs write access to it from workspaceId. Fixed once the chart exists.

name
string
required

Unique within the workspace; leading and trailing spaces are trimmed.

Required string length: 1 - 255
type
enum<string>
required

matrix is refused with 422 while an instance's online upgrade to 6.1 is unfinished.

Available options:
area,
bar,
pie,
big_number,
matrix
query
object
required

What a chart computes, in Cube's query format (ADR 0001): measures, dimensions, time dimensions, filters, order and limit over its Feedback Dataset's fields. Every field must come from the field catalog (GET /api/v3/charts/fields), named with its data-source prefix. Display settings are separate (config).

Refused with 422 (invalid_params names each problem): a field that is not in the catalog; Cube options the app does not use (ungrouped, segments, renewQuery, joinHints, total, compareDateRange); a timezone (every range is read in the organization's display time zone); more than 15 fields across measures, dimensions and timeDimensions; more than 25 filter conditions or filters nested deeper than three levels; a date range that is not a preset, all-time or two ISO calendar dates; on a chart grouped by time alone, a date range that spans more than 10,000 buckets of its granularity (code limit_exceeded).

config
object

Display settings, kept apart from the chart query. Every key is optional; each applies to the chart types named in its description and is ignored by the others.

Response

Chart created

data
object
required

A chart: one saved visualisation of one Feedback Dataset. It belongs to a workspace and can sit on any number of dashboards — dashboards lists them, so a caller can see what an edit or a delete would affect.