Skip to navigation

Initialise a meter

Creates a meter with its fields and meter value calculations in one call. meter.meter_values and meter.meter_properties list every field to attach, by id or reference: an existing one, or one defined in meter_values or meter_properties. Everything is created in one go, or nothing is. The meter and every value, property and calculation the request defines must be new: an existing one is refused, naming it. A refusal names the offending field by its path, e.g. meter.meter_values[1].reference; an unknown or missing field is named by its name only. When calling with an API key, send an Idempotency-Key header to retry safely: a repeated request with the same key returns the original response and creates nothing new. Requires the METER.CREATE permission. Each list you send also requires its own create permission: meter_values requires METER_VALUE.CREATE; meter_properties requires METER_PROPERTY.CREATE; meter_value_calculations requires METER_VALUE_CALCULATION.CREATE.

Authentication

X-API-KEYstring
API Key authentication via header
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

versionstringRequiredDefaults to 1
version

Headers

x-platform-idstringOptional
Platform ID.

Request

This endpoint expects an object.
meterobjectOptional

The meter to create; its reference must be new. meter.meter_values and meter.meter_properties list every field to attach, each by id or reference with required (default false): a field defined in this request, or an existing one.

meter_propertieslist of objects or nullOptional

The meter properties to create, each also listed in meter.meter_properties. Their references must be new: attach an existing property under meter.meter_properties instead. Each gets the status of the meter unless set.

meter_valueslist of objects or nullOptional

The meter values to create, each also listed in meter.meter_values. Their references must be new: attach an existing value under meter.meter_values instead. Each gets the status of the meter unless set.

meter_value_calculationslist of objects or nullOptional

The meter value calculations to create, each over a field the meter lists; their references must be new.

Response

OK
meterobject or nullOptional
The meter, with every field attached to it.
meter_valueslist of objects or nullOptionalRead-only

The meter values of the request: the new ones defined in meter_values in request order, then the existing ones attached via meter.meter_values.

meter_propertieslist of objects or nullOptionalRead-only

The meter properties of the request: the new ones defined in meter_properties in request order, then the existing ones attached via meter.meter_properties.

meter_value_calculationslist of objects or nullOptionalRead-only
The meter value calculations of the request, in request order.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
500
Internal Server Error