Skip to navigation

Add fields to a meter

Creates meter values and properties and attaches them, and existing ones, to a meter in one call. Fields the meter already has stay attached; listing one of them again is refused. 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. Only an ACTIVE or DRAFT meter takes new fields; to an ACTIVE meter only ACTIVE fields with required false are added. Everything is added in one go, or nothing is. A refusal names the offending field by its path, e.g. meter.meter_values[0].required. To change the meter itself, use PATCH /v1/meters/{resourceIdOrReference}. 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 adds nothing new. Requires the METER.UPDATE permission. Each list you send also requires its own create permission: meter_values requires METER_VALUE.CREATE; meter_properties requires METER_PROPERTY.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
resourceIdOrReferencestringRequiredDefaults to
The ID or reference of the resource.

Headers

x-platform-idstringOptional
Platform ID.

Request

This endpoint expects an object.
meterobjectOptional

The fields to attach to the meter, each by id or reference with required (default false): a field defined in this request, or an existing one. Fields already attached stay attached; listing one of them again is refused. To change the meter itself, use PATCH /v1/meters/{resourceIdOrReference}.

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.

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
404
Not Found Error
409
Conflict Error
500
Internal Server Error