Meters API
List and create meters; read, update, and delete a meter by id.
Meters API
Overview
The Meters API provides CRUD operations for meter resources. Use the base route to list and create meters, and the id route to read, update, or delete a specific meter. All operations are scoped by an account_id UUID.
Base path: /api/v1/meters
Authentication
All endpoints require authentication. Include a valid Bearer token in the Authorization header: Authorization: Bearer <access_token>.
Response Envelope
{
"success": true,
"message": "optional human readable message",
"data": {},
"count": 1,
"error": "error text"
}
Account scoping
- List/read/delete: supply
account_idas a query parameter - Create/update: include
account_idin the request body
Endpoints
List meters
GET /api/v1/meters
Query parameters:
account_id(uuid, required)page,limit(pagination)query(text search)sortBy,sortOrder
Response 200 — data is an array of meters with count for pagination.
Create meter
POST /api/v1/meters
Body (JSON):
account_id(uuid, required)name(string, required)serial_number(string, required)meter_type(enum: ELECTRICITY, GAS, WATER, SOLAR, GENSET, HVAC, EV, CARBON)communication_type(enum: NONE, LORAWAN, MODBUS, MQTT, HTTP, DLMS, VIRTUAL)
Additional optional fields:
building_block_id(integer|null) — reference to a building blockgateway_id(integer|null) — reference to an attached gatewaytariff_id(integer|null) — reference to the assigned tarifflast_reading_value(number) — latest reading value (updated internally when readings are added)last_reading_at(ISO 8601 datetime string) — timestamp of the latest readinglocation(string) — human-readable location descriptionbilling_direction(enum: ACCREC | ACCPAY | null) — billing direction;ACCRECfor tenant invoicing,ACCPAYfor utility supply costs
Response 201 — created meter object in data.
Errors
400 Bad Request— invalid body401 Unauthorized
Get meter
GET /api/v1/meters/:id
Path parameters:
id(integer)
Query parameters:
account_id(uuid, required)
Response 200 — meter object in data.
Errors
400 Bad Request— invalid id or missingaccount_id401 Unauthorized403 Forbidden— meter does not belong to the requested organization
Update meter
PUT /api/v1/meters/:id
Path parameters:
id(integer)
Body (JSON):
account_id(uuid, required)- Mutable meter fields (e.g.,
name)
Body (JSON) — all mutable fields are optional except account_id:
account_id(uuid, required)name(string)description(string)reading_interval(integer) — preferred read interval in secondsgateway_id(integer|null) — reference to an attached gatewaybuilding_block_id(integer|null) — reference to a building blocktariff_id(integer|null) — assigned tariff referencelast_reading_value(number) — latest reading valuelast_reading_at(ISO 8601 datetime string) — timestamp for the latest readinglocation(string) — human-readable location descriptionbilling_direction(enum: ACCREC | ACCPAY | null) — billing direction
Note: serial_number, meter_type, and communication_type are not mutable via this endpoint.
Response 200 — updated meter object in data.
Errors
400 Bad Request— invalid body or id401 Unauthorized403 Forbidden— meter does not belong to the requested organization
Delete meter
DELETE /api/v1/meters/:id
Path parameters:
id(integer)
Query parameters:
account_id(uuid, required)
Response 204 / success envelope with no content.
Errors
400 Bad Request— invalid id or missingaccount_id401 Unauthorized403 Forbidden— meter does not belong to the requested organization
Notes
- Sorting and pagination follow the shared list conventions used across the API.
- Field names and enum values should match those returned by the API schema.
Enums
meter_type— permitted values:ELECTRICITYGASWATERSOLARGENSETHVACEVCARBON
communication_type— permitted values:NONELORAWANMODBUSMQTTHTTPDLMSVIRTUAL
billing_direction— permitted values:ACCREC— accounts receivable (tenant invoicing)ACCPAY— accounts payable (utility supply costs)