id. Only published domains are returned.
List domains
List a domain’s variables
id, key, title, description, default_value, display_type, and decimal_format.
Rendering a default value
default_value is not self-describing, so pair it with display_type and decimal_format:
- A
percentstores a decimal —0.06renders as6%. - A
duration,date,datetime, ortimestores a count of seconds. Render it with a UTC-pinned formatter; the notes under Dates and durations apply to a default verbatim. - A default of one of those four kinds may instead be the literal word
todayornow, which stands for the moment the calculation runs rather than the moment the domain was authored. Seetodayandnowas defaults.
List a domain’s activities
POST /v1/calculate, which returns computed values with a render-ready display for each. The two carry similar display information in different shapes — see Display configuration vs. display.
Activities — one entry per activity:
Variables — one entry per variable, in definition form:
display_metadata
display_metadata holds the variable’s display configuration under a single key naming its structural type — number (for number, percent, and no_separator), table, bar_chart, or pie_chart:
display object in a calculation result — decimal_format for a scalar; start_row_index, columns, and rows for a table; series or slice configuration for a chart. Unlike a calculation result’s display, the definition is not normalized: optional fields may be absent rather than filled with defaults.
The number key holds the configuration for every scalar type, the four time kinds included, so a date variable’s format token is at display_metadata.number.decimal_format:
Display configuration vs. display
The same variable’s formatting appears in two shapes, anddisplay_type does not mean the same thing in each:
The overloaded
display_type is the gotcha: in a definition it can be table, but in a result display_type is only ever a scalar format and the structural type is in data_type.
