PT EN

Activos da rede

URL base: $BUSINESS_API

O objecto

idstring · obrigatório
tenant_idstring · obrigatório
codestring · obrigatório
namestring · obrigatório
asset_typestring · obrigatório

um de source, treatment_plant, reservoir, pump_station, pipe, valve, hydrant, dma, junction, customer_tap

service_area_idstring · opcional
statusstring · obrigatório

um de operational, maintenance, offline, decommissioned

capacitynumber · opcional
latitudenumber · opcional
longitudenumber · opcional
elevationnumber · opcional
installation_datestring (date-time) · opcional
propertiesobject · opcional
node_typestring · opcional

um de source_river, source_borehole, treatment_plant, reservoir, dma_inlet, junction, customer_tap

storage_capacity_m3integer (int64) · opcional
dma_idstring · opcional
device_idstring · opcional
meter_idstring · opcional
meter_serialstring · opcional

Serial number of the referenced meter. Omitted when unknown.

meter_holder_namestring · opcional

Display name of the customer who holds the account the meter is installed on. Omitted when unknown.

created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório
O objecto
{
  "id": "net_2VvwojxMyhpssxfSu15amL5GsjX",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "code": "COD-2026-000142",
  "name": "Ana Matsinhe",
  "asset_type": "source",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "status": "operational",
  "capacity": 1,
  "latitude": -25.9653,
  "longitude": 32.5892,
  "elevation": 1,
  "installation_date": "2026-11-19T09:30:00Z",
  "properties": {},
  "node_type": "source_river",
  "storage_capacity_m3": 1,
  "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
  "device_id": "dev_2E2J9iiRr2o7PWMrj8wJrQyb9sK",
  "meter_id": "mtr_21F02THKOD7uMpvUalZKsBv64nN",
  "meter_serial": "meter serial",
  "meter_holder_name": "Ana Matsinhe",
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}

Listar activos da rede

Registos

GET /assets

Returns the tenant's water network assets with cursor pagination (limit defaults to 20, at most 100). Filter by asset_type, status or service_area_id, and use q to match a substring of the asset name or code. Requires network:read.

Parâmetros

limitinteger · consulta · opcional

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

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Network assets

Mostrar atributos
dataarray of NetworkAsset · obrigatório
Mostrar atributos filhos
idstring · obrigatório
tenant_idstring · obrigatório
codestring · obrigatório
namestring · obrigatório
asset_typestring · obrigatório

um de source, treatment_plant, reservoir, pump_station, pipe, valve, hydrant, dma, junction, customer_tap

service_area_idstring · opcional
statusstring · obrigatório

um de operational, maintenance, offline, decommissioned

capacitynumber · opcional
latitudenumber · opcional
longitudenumber · opcional
elevationnumber · opcional
installation_datestring (date-time) · opcional
propertiesobject · opcional
node_typestring · opcional

um de source_river, source_borehole, treatment_plant, reservoir, dma_inlet, junction, customer_tap

storage_capacity_m3integer (int64) · opcional
dma_idstring · opcional
device_idstring · opcional
meter_idstring · opcional
meter_serialstring · opcional

Serial number of the referenced meter. Omitted when unknown.

meter_holder_namestring · opcional

Display name of the customer who holds the account the meter is installed on. Omitted when unknown.

created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório
has_moreboolean · obrigatório
next_cursorstring · opcional
total_countinteger · opcional

Permissões network:read · Funções: admin, analyst, field_reader, field_supervisor, operations, owner, viewer

curl -X GET "$BUSINESS_API/assets" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "net_2VvwojxMyhpssxfSu15amL5GsjX",
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "code": "COD-2026-000142",
      "name": "Ana Matsinhe",
      "asset_type": "source",
      "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
      "status": "operational",
      "capacity": 1,
      "latitude": -25.9653,
      "longitude": 32.5892,
      "elevation": 1,
      "installation_date": "2026-11-19T09:30:00Z",
      "properties": {},
      "node_type": "source_river",
      "storage_capacity_m3": 1,
      "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
      "device_id": "dev_2E2J9iiRr2o7PWMrj8wJrQyb9sK",
      "meter_id": "mtr_21F02THKOD7uMpvUalZKsBv64nN",
      "meter_serial": "meter serial",
      "meter_holder_name": "Ana Matsinhe",
      "created_at": "2026-11-19T09:30:00Z",
      "updated_at": "2026-11-19T09:30:00Z"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor",
  "total_count": 125000
}

Registar um activo da rede

Registos

POST /assets

Registers a network asset such as a reservoir, pump station, pipe, valve or hydrant. code, name and asset_type are required, and status defaults to operational. The code must be unique within the tenant: a duplicate answers 409. Requires network:write and returns 201 with the stored asset.

Corpo application/json

codestring · obrigatório
namestring · obrigatório
asset_typestring · obrigatório

um de source, treatment_plant, reservoir, pump_station, pipe, valve, hydrant, dma, junction, customer_tap

service_area_idstring · opcional
statusstring · opcional

um de operational, maintenance, offline, decommissioned

capacitynumber · opcional
latitudenumber · opcional
longitudenumber · opcional
elevationnumber · opcional
installation_datestring (date-time) · opcional
propertiesobject · opcional

Devolve

201 Network asset registered

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
codestring · obrigatório
namestring · obrigatório
asset_typestring · obrigatório

um de source, treatment_plant, reservoir, pump_station, pipe, valve, hydrant, dma, junction, customer_tap

service_area_idstring · opcional
statusstring · obrigatório

um de operational, maintenance, offline, decommissioned

capacitynumber · opcional
latitudenumber · opcional
longitudenumber · opcional
elevationnumber · opcional
installation_datestring (date-time) · opcional
propertiesobject · opcional
node_typestring · opcional

um de source_river, source_borehole, treatment_plant, reservoir, dma_inlet, junction, customer_tap

storage_capacity_m3integer (int64) · opcional
dma_idstring · opcional
device_idstring · opcional
meter_idstring · opcional
meter_serialstring · opcional

Serial number of the referenced meter. Omitted when unknown.

meter_holder_namestring · opcional

Display name of the customer who holds the account the meter is installed on. Omitted when unknown.

created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Permissões network:write · Funções: admin, operations, owner

curl -X POST "$BUSINESS_API/assets" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "code": "COD-2026-000142",
  "name": "Ana Matsinhe",
  "asset_type": "source",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "status": "operational",
  "capacity": 1,
  "latitude": -25.9653,
  "longitude": 32.5892,
  "elevation": 1,
  "installation_date": "2026-11-19T09:30:00Z",
  "properties": {}
}'
Resposta 201
{
  "id": "net_2VvwojxMyhpssxfSu15amL5GsjX",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "code": "COD-2026-000142",
  "name": "Ana Matsinhe",
  "asset_type": "source",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "status": "operational",
  "capacity": 1,
  "latitude": -25.9653,
  "longitude": 32.5892,
  "elevation": 1,
  "installation_date": "2026-11-19T09:30:00Z",
  "properties": {},
  "node_type": "source_river",
  "storage_capacity_m3": 1,
  "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
  "device_id": "dev_2E2J9iiRr2o7PWMrj8wJrQyb9sK",
  "meter_id": "mtr_21F02THKOD7uMpvUalZKsBv64nN",
  "meter_serial": "meter serial",
  "meter_holder_name": "Ana Matsinhe",
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}

Obter um activo da rede

Registos

GET /assets/{id}

Returns one network asset with its type, status, service area, capacity, coordinates, elevation, installation date and free-form properties. Answers 404 when the asset is not in the caller's tenant. Requires network:read.

Parâmetros

idstring · caminho · obrigatório

Identifier of the network asset (prefix ast_).

Devolve

200 Network asset details

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
codestring · obrigatório
namestring · obrigatório
asset_typestring · obrigatório

um de source, treatment_plant, reservoir, pump_station, pipe, valve, hydrant, dma, junction, customer_tap

service_area_idstring · opcional
statusstring · obrigatório

um de operational, maintenance, offline, decommissioned

capacitynumber · opcional
latitudenumber · opcional
longitudenumber · opcional
elevationnumber · opcional
installation_datestring (date-time) · opcional
propertiesobject · opcional
node_typestring · opcional

um de source_river, source_borehole, treatment_plant, reservoir, dma_inlet, junction, customer_tap

storage_capacity_m3integer (int64) · opcional
dma_idstring · opcional
device_idstring · opcional
meter_idstring · opcional
meter_serialstring · opcional

Serial number of the referenced meter. Omitted when unknown.

meter_holder_namestring · opcional

Display name of the customer who holds the account the meter is installed on. Omitted when unknown.

created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Permissões network:read · Funções: admin, analyst, field_reader, field_supervisor, operations, owner, viewer

curl -X GET "$BUSINESS_API/assets/{id}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "net_2VvwojxMyhpssxfSu15amL5GsjX",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "code": "COD-2026-000142",
  "name": "Ana Matsinhe",
  "asset_type": "source",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "status": "operational",
  "capacity": 1,
  "latitude": -25.9653,
  "longitude": 32.5892,
  "elevation": 1,
  "installation_date": "2026-11-19T09:30:00Z",
  "properties": {},
  "node_type": "source_river",
  "storage_capacity_m3": 1,
  "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
  "device_id": "dev_2E2J9iiRr2o7PWMrj8wJrQyb9sK",
  "meter_id": "mtr_21F02THKOD7uMpvUalZKsBv64nN",
  "meter_serial": "meter serial",
  "meter_holder_name": "Ana Matsinhe",
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}

Actualizar um activo da rede

Registos

PUT /assets/{id}

Changes only the fields you send: name, status, capacity, latitude, longitude, elevation, installation_date and properties. Empty strings and zero numbers are treated as not sent, so this call cannot clear a field or set a coordinate to exactly 0, and properties is replaced as a whole when present. Code, type and service area cannot be changed here. Requires network:write; 404 when the asset is not in the tenant.

Parâmetros

idstring · caminho · obrigatório

Identifier of the network asset to update (prefix ast_).

Corpo application/json

namestring · opcional
statusstring · opcional

um de operational, maintenance, offline, decommissioned

capacitynumber · opcional
latitudenumber · opcional
longitudenumber · opcional
elevationnumber · opcional
installation_datestring (date-time) · opcional
propertiesobject · opcional

Devolve

200 Network asset updated

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
codestring · obrigatório
namestring · obrigatório
asset_typestring · obrigatório

um de source, treatment_plant, reservoir, pump_station, pipe, valve, hydrant, dma, junction, customer_tap

service_area_idstring · opcional
statusstring · obrigatório

um de operational, maintenance, offline, decommissioned

capacitynumber · opcional
latitudenumber · opcional
longitudenumber · opcional
elevationnumber · opcional
installation_datestring (date-time) · opcional
propertiesobject · opcional
node_typestring · opcional

um de source_river, source_borehole, treatment_plant, reservoir, dma_inlet, junction, customer_tap

storage_capacity_m3integer (int64) · opcional
dma_idstring · opcional
device_idstring · opcional
meter_idstring · opcional
meter_serialstring · opcional

Serial number of the referenced meter. Omitted when unknown.

meter_holder_namestring · opcional

Display name of the customer who holds the account the meter is installed on. Omitted when unknown.

created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Permissões network:write · Funções: admin, operations, owner

curl -X PUT "$BUSINESS_API/assets/{id}" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ana Matsinhe",
  "status": "operational",
  "capacity": 1,
  "latitude": -25.9653,
  "longitude": 32.5892,
  "elevation": 1,
  "installation_date": "2026-11-19T09:30:00Z",
  "properties": {}
}'
Resposta 200
{
  "id": "net_2VvwojxMyhpssxfSu15amL5GsjX",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "code": "COD-2026-000142",
  "name": "Ana Matsinhe",
  "asset_type": "source",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "status": "operational",
  "capacity": 1,
  "latitude": -25.9653,
  "longitude": 32.5892,
  "elevation": 1,
  "installation_date": "2026-11-19T09:30:00Z",
  "properties": {},
  "node_type": "source_river",
  "storage_capacity_m3": 1,
  "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
  "device_id": "dev_2E2J9iiRr2o7PWMrj8wJrQyb9sK",
  "meter_id": "mtr_21F02THKOD7uMpvUalZKsBv64nN",
  "meter_serial": "meter serial",
  "meter_holder_name": "Ana Matsinhe",
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}