Skip to main content
POST
Bulk Upload Waste Water Treatments

Bulk Upload Waste Water Treatments

Upload daily waste water treatment measurements in bulk for a waste water facility. This endpoint automatically imputes missing values using interpolation and moving averages.
Important Constraints:
  • Maximum 31 days of data per request
  • The last entry must have complete data for all totalized fields
  • Missing values are automatically imputed
  • CH4 emissions cannot be negative

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: ff4adcc7-8172-45fe-9cf1-e90a6de53aa9
string
required
Your user UUIDExample: a1b2c3d4-e5f6-7890-abcd-ef1234567890

Body Parameters

string
required
UUID of the waste water facilityExample: "facility-uuid-here"
array
required
Array of daily measurement records (max 31 days)Each daily record contains:
  • name (string, required): Description of the data
  • measurement_date (date, required): Date of measurement (YYYY-MM-DD)
  • m3_water_in (float, optional): Input flow in m³
  • m3_water_out (float, optional): Output flow in m³
  • kg_bod_per_m3_wwt_line (float, optional): Input BOD in kg/m³
  • kg_n_per_m3_wwt_line (float, optional): Nitrogen in kg/m³ (treatment line)
  • kg_sludge (float, optional): Total evacuated sludge in kg
  • st (float, optional): Proportion of solids (0-1)
  • m3_biogas_engine (float, optional): Engine biogas in m³
  • m3_biogas_flare (float, optional): Flare biogas in m³
  • m3_biogas_boiler (float, optional): Boiler biogas in m³
  • methane (float, optional): Methane proportion (0-1)
  • kg_bod_per_kg_sludge_line (float, optional): BOD in sludge kg/kg
  • kg_bod_per_m3_wwd_line (float, optional): BOD in discharge kg/m³
  • kg_n_per_m3_wwd_line (float, optional): Nitrogen in discharge kg/m³
Last Entry Requirement: The last entry in your data array must have non-null values for:
  • m3_water_in
  • m3_water_out
  • kg_sludge
  • m3_biogas_engine
  • m3_biogas_flare
  • m3_biogas_boiler

Response

Returns an array of created waste water treatment records with calculated emissions.

Example

Data Imputation

The endpoint automatically fills missing values using these methods:

Interpolation

Missing values are interpolated linearly between known values for:
  • m3_water_in
  • m3_water_out
  • kg_sludge
  • m3_biogas_engine
  • m3_biogas_flare
  • m3_biogas_boiler

Moving Average

Missing values are filled with 6-period moving average (forward/backward fill) for:
  • kg_n_per_m3_wwt_line
  • kg_bod_per_m3_wwt_line
  • kg_bod_per_m3_wwd_line
  • st (solid proportion)
  • methane
  • kg_bod_per_kg_sludge_line
  • kg_n_per_m3_wwd_line
You can submit partial data for intermediate days. The endpoint will automatically fill gaps, but the last entry must have complete totalized values.

Common Errors

400 Bad Request - Facility Not Found

Cause: FACILITY_NOT_FOUND
Solution: Verify the facility ID exists.

400 Bad Request - Maximum Rows Exceeded

Cause: MAXIMUM_ROWS_EXCEEDED
Solution: Date range between min and max measurement_date must not exceed 31 days. Split into multiple requests if needed.

400 Bad Request - Null Values in Last Row

Cause: NULL_VALUES_IN_LAST_ROW
Solution: Ensure the last entry has non-null values for all totalized fields: m3_water_in, m3_water_out, kg_sludge, m3_biogas_engine, m3_biogas_flare, m3_biogas_boiler.

400 Bad Request - Negative Value

Cause: NEGATIVE_m3_water_in
Solution: All measurement values must be non-negative (≥ 0).

Best Practices

1. Submit Complete Final Entry

Always ensure the last entry has all required fields:

2. Handle Date Ranges

Split large date ranges into multiple requests:

3. Validate Before Upload

Check data quality before submitting:

Delete Treatment

Remove a treatment record

Facilities

List waste water facilities