Create a time series
create_time_seriesCreate validated time series—rain gauge, hydrograph, or tide/stage—in a project; series type and units are checked before sending.
Instructions
Create a time series (rain gauge, hydrograph, tide/stage) in a project.
POSTs /projects//time-series/ with series_type and units as
top-level fields. series_type is checked against the four choices and
data against the {"rowData": [{timestamp, value}, ...]} shape before any
request is made — the API answers 500 (not 400) to a malformed row.
Returns a compact record — id, name, series_type, units, timezone,
row_count, http_status — not the echoed rows; fetch the full row with the
REST API (GET /projects//time-series//) if you need to round-trip it.
A rainfall polygon references its gauge by the series NAME, so create the
gauges with the exact names the rainfall GeoJSON's features carry.
The units must match the series_type (see units), and a hydrograph or
hyetograph must END at 0 unless hold_last_value is true. The result
carries Hydrata's own summary of the series (peak, volume or depth,
first and last stamp, trailing value): repeat those numbers to the user
(say_to_user does) rather than computing your own.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The rows: {"rowData": [{"timestamp": "1998-08-17T00:00:00", "value": 1.5}, ...]}. Timestamps ISO 8601 (a trailing Z is tolerated), values numeric. Validated here before anything is sent. | |
| name | Yes | Series name, kept VERBATIM — a rainfall polygon binds to its gauge by this exact name (its `data` property), so use the name the GeoJSON features carry | |
| units | No | Units of the values. REQUIRED for hyetograph ('mm/hr' or 'mm/h'), hydrograph ('m3/s', 'm^3/s' or 'cumec') and stage ('m'): the engine reads those units whatever the label says, so a mismatch is refused before anything is sent. Free for generic. | |
| method | No | One short phrase saying how you got these numbers (e.g. 'read off the council hydrograph PDF', 'scaled the 1% AEP peak'). Shown to the person who reviews the inputs. | |
| source | No | Where the data came from, e.g. a gauge id or agency (optional) | |
| timezone | No | IANA timezone of the timestamps (default 'UTC'), e.g. 'Australia/Sydney' | UTC |
| project_id | Yes | The project ID | |
| description | No | Free-text description (optional) | |
| series_type | No | One of hyetograph (rainfall depth/intensity — the default), hydrograph (flow, read by the Hydrographs panel and inflow boundaries), stage (water level, e.g. a tide) or generic. Sent as a top-level field. | hyetograph |
| location_name | No | Human-readable location of the gauge (optional) | |
| hold_last_value | No | Set true ONLY when the last value is meant to be held after the series ends. A hydrograph or hyetograph whose last value is not 0 is refused (TRAILING_VALUE_HELD) unless this is true: end the series with a 0 row instead, unless holding is really intended. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||