Defining Time Series
This page describes how to create a time series with the PowerTSM HTTP API, starting with the minimum set of required properties and continuing with an advanced definition. It also covers updating and deleting an existing time series.
Minimum Definition
Section titled “Minimum Definition”At least the following properties are required to create a time series:
namecyclicfunctioninterval
Request
POST /repositories/{repository}/timeSeriesRequest Body
{ "name": "TSM_Example_TimeSeries", "cyclic": true, "function": 1, "interval": { "type": 3, "multiplier": 15 }}The numeric values for function and interval.type correspond to entries in the enumerations endpoints. Use GET /functionTypes and GET /time/intervalTypes to retrieve the available values and their names.
Advanced Definition
Section titled “Advanced Definition”The following properties are available when creating a time series:
| Property | Type | Description |
|---|---|---|
name |
string | Unique name of the time series within the repository |
description |
string | Optional human-readable description |
cyclic |
boolean | Whether the time series stores cyclic data |
function |
number | Function type (see GET /functionTypes) |
interval |
object | Interval definition with type and multiplier |
unit |
object | Unit reference with identifier and optional storageInformation |
intervalTransformationMethod |
number | How data is aggregated when read at a different interval (see GET /time/intervals/intervalTransformationMethods) |
timeZone |
string | Time zone identifier (e.g., "W. Europe Standard Time") |
startOfTime |
string | ISO 8601 date-time defining the start of the time axis |
preserveDuplicatedValues |
boolean | Whether to keep duplicate values |
preserveHistoricData |
boolean | Enables historization — see Enabling Historization |
preserveAuditLog |
boolean | Enables audit log tracking |
quotation |
boolean | Enables quotation (versioning) support |
quotationDefaultBehavior |
number | Default read behavior for quotations (see GET /quotationBehaviors) |
compressionMode |
number | Data compression mode (see GET /compressionModes) |
compressionMultiplier |
integer | Multiplier for the compression mode |
formula |
object | Formula definitions as a dictionary of { "ISO8601-timestamp": "formula string" } |
Request
POST /repositories/{repository}/timeSeriesRequest Body
{ "name": "TSM_Example_TimeSeries", "description": "Hourly energy consumption in Watts", "cyclic": true, "function": 2, "interval": { "type": 3, "multiplier": 1 }, "unit": { "identifier": "W", "storageInformation": { "repositoryName": "TSM_Example_Repository" } }, "intervalTransformationMethod": 1, "timeZone": "W. Europe Standard Time", "startOfTime": "2010-10-01T06:00:00+02:00", "preserveDuplicatedValues": true, "preserveHistoricData": true, "preserveAuditLog": true, "quotation": true, "quotationDefaultBehavior": 1, "compressionMode": 0}A 201 Created response is returned on success, with the created time series object in the body.
Updating a Time Series
Section titled “Updating a Time Series”To update an existing time series, send a PUT request with the full time series definition:
PUT /repositories/{repository}/timeSeries/{timeSeries}In the endpoint PUT /repositories/{repository}/timeSeries/{timeSeries}, the {timeSeries} path segment accepts either the time series name or an ID prefixed with id: (e.g., id:42).
The request body has the same structure as the POST body.
Deleting a Time Series
Section titled “Deleting a Time Series”DELETE /repositories/{repository}/timeSeries/{timeSeries}To also delete all stored data, include the cascade query parameter:
DELETE /repositories/{repository}/timeSeries/{timeSeries}?cascade=true