Ultrahost/ docs

Define a metric, write points, and query them by time and dimension.

Paths in the tables are relative to https://api.ultrahost.com/v1/projects/{projectId}. Pagination, idempotency, and errors are described in Conventions.

Create

SDKRESTDescription
timeseries.createMetric(name, config?)POST /timeseries/metricsDefine a metric
timeseries.getMetric(name)GET /timeseries/metrics/{name}Retrieve metric configuration
timeseries.listMetrics()GET /timeseries/metricsList metrics
timeseries.updateMetric(name, config)PATCH /timeseries/metrics/{name}Update retention and aggregation settings
timeseries.deleteMetric(name)DELETE /timeseries/metrics/{name}Delete a metric and its readings
ts
await ultrahost.timeseries.createMetric("temperature", {
  unit: "celsius",
  retentionDays: 365,
  resolution: "minute"
});

Configure

The metric declares what the API will actually do. Do not promise arbitrary real-time grouping when the store only supports scheduled rollups.

Supported requirements:

  • Several measurements in one request
  • Configurable time resolution
  • Retention policies
  • Aggregations: min, max, avg, sum, count
  • Dimension filters where the metric says they are supported
  • Historical queries and latest-value reads
  • Cursor pagination

projects.getCapabilities() surfaces which of these a deployment implements.

Use

SDKRESTDescription
timeseries.write(metric, point)POST /timeseries/{metric}/pointsRecord a measurement
timeseries.writeBatch(metric, points)POST /timeseries/{metric}/points/batchRecord several measurements
timeseries.query(metric, options)POST /timeseries/{metric}/queryRetrieve measurements
timeseries.latest(metric, options?)POST /timeseries/{metric}/latestGet the latest reading
timeseries.aggregate(metric, options)POST /timeseries/{metric}/aggregateCalculate aggregates
timeseries.stats(metric)GET /timeseries/{metric}/statsRetrieve metric statistics
ts
await ultrahost.timeseries.write("temperature", {
  value: 24.5,
  timestamp: new Date(),
  dimensions: {
    building: "A",
    sensor: "42"
  }
});

const history = await ultrahost.timeseries.query("temperature", {
  from: "2026-11-01",
  to: "2026-11-14",
  dimensions: { building: "A" },
  interval: "hour",
  aggregation: "avg"
});

React apps can read a series with useTimeseries(metric, query).