WaterlyWaterlyConnect Developer Hub
API Guidedata-model:read

Metrics API

Find measurement definitions such as flow, pressure, runtime, and residual. A metric belongs directly to a process or to a component within that process.

List metrics

Filter with either process_id or component_id. The two filters cannot be combined in one request.

GET/api/metrics/v1
curl --digest \
  --user "$WATERLY_API_USERNAME:$WATERLY_API_SECRET" \
  "https://connect.waterly.com/api/metrics/v1?component_id=82"
{
  "data": [{
    "kind": "metric", "id": 91, "name": "Chlorine Residual",
    "parent": { "kind": "component", "id": 82 },
    "order": 1,
    "attributes": { "data_type": "NUMERIC", "unit_id": 5, "internal_keyname": "chlorine_residual" }
  }],
  "links": { "self": "...", "next": null, "prev": null },
  "meta": { "limit": 50, "has_next": false, "has_prev": false }
}

List metrics through an organization

Use this equivalent organization-scoped route when your workflow begins with an explicit organization ID.

GET/api/organizations/v1/{organizationId}/metrics
curl --digest --user "$WATERLY_API_USERNAME:$WATERLY_API_SECRET" \
  "https://connect.waterly.com/api/organizations/v1/123/metrics?process_id=71"

Get one metric

GET/api/metrics/v1/{metricId}
curl --digest --user "$WATERLY_API_USERNAME:$WATERLY_API_SECRET" \
  "https://connect.waterly.com/api/metrics/v1/91"

Metrics are leaves in the data-model hierarchy, so their item response has a parent link but no children link. Read values with /api/metrics/v1/91/data-points.

Metric-specific attributes

Field Meaning
attributes.data_type The metric's configured value type.
attributes.unit_id Identifier of the configured unit, or null when the metric has no unit.
attributes.internal_keyname Waterly's stable internal label for the metric.