Components
Model
Fields
Field | Type | Description |
|---|---|---|
object | "component" | |
id | string | Unique identifier, prefixed with comp_. |
page_id | string | |
name | string | null | Title of a card that shows several metrics. Null titles it with their names. |
created_at | | |
updated_at | | |
ui_card_size | | How much of the page width the component occupies. |
ui_sort_index | number | Position of the component on the page. Lower appears first. |
metrics | [] | The metrics the card shows together, in order: one to six. Metrics scheduled for deletion are left out until they are restored. |
Add Component
Endpoint
Add a card of one or more metrics to a page.
/v1/projects/:project_id/pages/:page_id/components Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
page_id | string | Unique identifier of the page. |
Request Body
Field | Type | Requirement | Description |
|---|---|---|---|
name | string | null | Optional | Title of a card that shows several metrics. Send null to title it with their names. |
ui_sort_index | integer | Optional | Position of the component on the page. Lower appears first. |
ui_card_size | | Optional | How much of the page width the component occupies. |
metric_ids | string[] | Required | Metrics the card shows together, in order. |
page_id | string | Optional | Page the component is added to. |
Response
{
message: string;
data: Component;
status: 201;
error: null;
pagination: null;
endpoint: string;
} Update Component
Endpoint
Change which metrics a component shows, its name, its size, or its position.
/v1/projects/:project_id/pages/:page_id/components/:component_id Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
page_id | string | Unique identifier of the page. |
component_id | string | Unique identifier of the component. |
Request Body
Field | Type | Requirement | Description |
|---|---|---|---|
name | string | null | Optional | Title of a card that shows several metrics. Send null to title it with their names. |
ui_sort_index | integer | Optional | Position of the component on the page. Lower appears first. |
ui_card_size | | Optional | How much of the page width the component occupies. |
metric_ids | string[] | Optional | Metrics the card shows together, in order. |
Response
{
message: string;
data: Component;
status: 200;
error: null;
pagination: null;
endpoint: string;
} Delete Component
Endpoint
Remove a component from a page.
/v1/projects/:project_id/pages/:page_id/components/:component_id Path Parameters
Field | Type | Description |
|---|---|---|
project_id | string | Unique identifier of the project. |
page_id | string | Unique identifier of the page. |
component_id | string | Unique identifier of the component. |
Response
{
message: string;
data: null;
status: 200;
error: null;
pagination: null;
endpoint: string;
} Referenced Types
ISODateString
An ISO 8601 date-time string returned at the JSON API boundary.
ComponentCardSize
MetricStatus
NullHandling
EmptyBucketHandling
BackfillStrategy
ChartFamily
ChartType
ChartColorMode
ChartColor
ChartCurve
ForecastHorizon
How far past now a chart projects its forecast. Values are relative to the moment the chart is
viewed, so a saved horizon keeps projecting the same distance ahead as time passes rather than
expiring on a fixed date. end_of_quarter and end_of_year run to the end of the calendar
period that contains today, in UTC.
ForecastModel
The curve a forecast is fitted with. auto follows the best-fitting model for the series, which
is recalculated as data arrives and can therefore change between views; naming a model pins the
projection to that curve.
MetricChartValue
Aggregation applied to a metric's values. Use last when records are snapshots of a persistent
thing such as a deal, user, or inventory item: each time bucket contains the latest reading for
that series in the bucket. Within the requested range, the last observed value carries forward
across complete empty intervals instead of reading them as zero.
AnalyticsTimeRange
The window a chart reads. Stored as a plain string rather than a database enum: the set is
presentation, not something any query filters on, and the forward ranges in particular are
expected to change as we learn what people forecast over.
A next_* range ends after now, which is what turns a fitted trend into a visible forecast. The
measured half of such a range is still measured; only the part past now is projected.
ChartInterval
The Data Interval setting (Metric.ui_chart_interval and the aggregation interval query
param). "auto" means the server picks the finest-safe tier for the current view, so brush-zoom
naturally drills into a finer bucket. The RESOLVED tier returned by aggregation is always a plain
DataInterval.
TimeDimension
The calendar position a metric's hourly data folds into. hour_of_day folds into hours 0 to 23,
weekday into ISO weekdays 1 (Monday) to 7 (Sunday), and hour_of_week into the 168 hours of a
week, numbered (weekday - 1) * 24 + hour.
ChartOrder
How a breakdown chart orders its groups. natural keeps their own order (hours, weekdays),
value ranks them largest first.