Connections

Base URL: $CONSUMER_API

List consumer water service connections

Logs

GET /connections

Each connection carries meter_id and meter_serial, the installed meter's serial number.

Parameters

limitinteger · query · optional

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

afterstring · query · optional

Opaque cursor returned by the previous page.

Returns

200 Connections for the consumer

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

Connections for the consumer

Apply for a new water service connection

Logs

POST /connections

The authenticated consumer must hold connection.manage for an account in the selected tenant. The service resolves the customer from that membership and property; a submitted customer_id does not grant or select access.

Body application/json

property_idstring · required
customer_idstring · optional

Ignored for consumer requests; customer is resolved from the caller's account membership.

categorystring · optional

one of residential, commercial, industrial, institutional, government

diameter_mminteger · optional
pipe_diameter_mminteger · optional
pipe_materialstring · optional
pressure_zone_idstring · optional
gps_coordinatesstring · optional
addressstring · optional
notesstring · optional

Returns

201 Connection application submitted

Errors 400 · 403 · 404

curl -X POST "$CONSUMER_API/connections" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "property_id": "prp_2ZbuIh1k2RvWMVPQCJD2yPrsOJ3",
  "customer_id": "cus_2UuXtOGTHWKlvkoF5so5Joi3Hck",
  "category": "residential",
  "diameter_mm": 1,
  "pipe_diameter_mm": 1,
  "pipe_material": "pipe material",
  "pressure_zone_id": "pre_2Ww5XCYxHs6jv2K53SI3fu47RkI",
  "gps_coordinates": "gps coordinates",
  "address": "Av. Julius Nyerere 1420, Maputo",
  "notes": "Leitura confirmada no local."
}'
Response 201

Connection application submitted

Get consumer connection

Logs

GET /connections/{id}

Get connection details within the consumer's linked account scope

Returns one service connection, such as a new water connection application, when it belongs to an account in the caller's linked account scope. The tenant is taken from X-Tenant-ID or the token when set, otherwise all of the caller's tenants are searched; anything outside the scope returns 404.

Parameters

idstring · path · required

Identifier of the connection to return.

Returns

200 Connection visible to the authenticated consumer

Errors 404

curl -X GET "$CONSUMER_API/connections/{id}" \
  -H "Authorization: Bearer sk_test_..."
Response 200

Connection visible to the authenticated consumer