PT EN

Leituras

URL base: $CONSUMER_API

Listar leituras

Registos

GET /readings

Pages the meter readings of one linked account, each with its meter serial. account_id is required (400 without it) and the caller needs read access to the account, otherwise 403. Pagination uses limit and after.

Parâmetros

tenant_idstring · consulta · obrigatório

Tenant (utility workspace) that owns the account; when omitted it is worked out from the caller's account memberships.

account_idstring · consulta · obrigatório

Required identifier of the linked account whose readings are listed.

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

meter_idstring · consulta · opcional

Returns only readings of this meter.

statusstring · consulta · opcional

Returns only readings in this status: submitted, validating, accepted, review_required, rejected or superseded; any other value returns 400.

um de submitted, validating, accepted, review_required, rejected, superseded

methodstring · consulta · opcional

Returns only readings taken by this method: manual, consumer, remote, imported or estimated; any other value returns 400.

um de manual, consumer, remote, imported, estimated

Devolve

200 Readings in the selected account after membership authorization

curl -X GET "$CONSUMER_API/readings" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200

Readings in the selected account after membership authorization

Enviar uma leitura

Registos

POST /readings

Submits a self-read meter value for an active meter on a linked account where the caller has the reading create permission. meter_id, value, a unit that matches the meter's unit, measured_at, client_reading_id (up to 120 characters) and idempotency_key (up to 160 characters) are required, with up to 20 evidence ids. The reading is checked for plausibility and stays submitted (or review_required) for the utility to accept; reusing an idempotency key with different content returns 409, and the call answers 202.

Corpo application/json

tenant_idstring · obrigatório
account_idstring · obrigatório
meter_idstring · obrigatório
valuestring · obrigatório
unitstring · obrigatório
measured_atstring (date-time) · obrigatório
client_reading_idstring · obrigatório
idempotency_keystring · obrigatório
evidence_idsarray of string · opcional

Devolve

202 Consumer reading recorded for validation or review

curl -X POST "$CONSUMER_API/readings" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "account_id": "act_2JFioNDgIfvkgflk8RtcqhBaARP",
  "meter_id": "mtr_21F02THKOD7uMpvUalZKsBv64nN",
  "value": "value",
  "unit": "unit",
  "measured_at": "2026-11-19T09:30:00Z",
  "client_reading_id": "cli_20odFUijr6eh1g69pygb9smdNCU",
  "idempotency_key": "idempotency key",
  "evidence_ids": [
    "evi_2N98GhhgsvHGkNNqQ3LICnXai7r"
  ]
}'
Resposta 202

Consumer reading recorded for validation or review