Skip to main content
These endpoints let you discover the domains available to your account and inspect their variables and activities. Domains, activities, and variables are addressed by id. Only published domains are returned. Each response carries a top-level version reporting the shape of its body, currently 2. It is not the /v1 API version — see Response version.

List domains

List a domain’s variables

Returns the domain and its variables, each with its default value, the two fields needed to render it, and its suggested units. Useful for building structured text and input forms.
Each variable carries exactly these fields: id, key, title, description, default_value, kind, and format, plus unit_options when the variable has any.

Rendering a default value

default_value is not self-describing, so pair it with kind and format:
  • A percent stores a decimal — 0.06 renders as 6%.
  • A duration, date, datetime, or time stores 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 today or now, which stands for the moment the calculation runs rather than the moment the domain was authored. See today and now as defaults.

Reading unit options

The list is the units the author suggests for this variable, in their order, and the first one is the primary unit — the one to offer first. Everything else is up to you: how you show a unit, whether people pick one from a menu or some other way, and how a compound unit such as USD/ft² looks next to a value. Two things to know before you build on it:
  • The list says nothing about any particular value. An author is not required to include the unit the default value uses, and a value you already hold can have any unit at all. A unit is part of the value, so read it from the value.
  • Nothing is enforced. A value whose unit is outside the list is accepted like any other, and dimensional validation is unchanged, so shortening a list never breaks a caller that sends something else.
Read the list here or from /activities, where a table variable’s columns each have their own in display_metadata.table.columns[].

List a domain’s activities

Returns a domain’s definition: its activities — each with its equation, state, and the variables it references — and its variables with their stored display configuration. This describes how the domain is configured, in contrast to 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.
Domain — the published domain, with flags for whether a draft and a published version exist: 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:
The inner object carries the same fields as the matching display object in a calculation result — 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. A table column is the exception. Each entry of columns is a name, a kind, a format, and, when the author set any, its own unit_options:
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.format:

Display configuration vs. display

The same variable’s formatting appears in two shapes, and kind does not cover the same ground in each: That split is the gotcha: in a definition kind can be table, but in a result kind is only ever one of the scalar kinds and the structural shape is in data_type. unit_options runs the other way: it is part of the definition and not part of a result.