Skip to main content
PATCH
Update Waste Water Treatment
Edit a waste water treatment (WWT) record. Only the fields you send change; the rest keep their stored values. Dcycle then recalculates the CH4 and N2O emissions of the period asynchronously: the record answers status: "loading" until the new emissions are stored (uploaded), or error if the calculation fails.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Path Parameters

string
required
UUID of the waste water treatment record. It can belong to your organization or to a subsidiary you can write to.Example: 550e8400-e29b-41d4-a716-446655440000

Body Parameters

Every field is optional and takes the same values as in the create. Only kg_r_wwt_line, kg_r_sludge_line, file_url and file_id accept null.
string
Name or reference of the measurement. Returned as invoice_id.
date
Start of the measured period (YYYY-MM-DD). The period, with the stored date you do not send, must not end before it starts.
date
End of the measured period (YYYY-MM-DD)
number
Influent water volume (m³), 0 or greater. Like every numeric field below.
number
Effluent water volume (m³)
number
Sludge produced (kg)
number
BOD concentration of the influent, WWT line (kg BOD/m³)
number
BOD content of the sludge, sludge line (kg BOD/kg sludge)
number
BOD concentration of the effluent, WWD line (kg BOD/m³)
number
Nitrogen concentration of the influent, WWT line (kg N/m³)
number
Nitrogen concentration of the effluent, WWD line (kg N/m³)
number | null
CH4 recovered in the WWT line (kg)
number | null
CH4 recovered in the sludge line (kg)
string | null
Supporting document: a URL, or the document itself as a base64 data URI (stored by Dcycle). A different value replaces the stored document and its name; null or "" removes it.
string | null
UUID of an uploaded file of My files to attach instead: the record stores its URL and name. null removes the attachment. Not together with a data URI in file_url.

Response

Returns 200 OK with the record in the shape of GET /v1/waste-water-treatments/{wwt_id}/detail, with status: "loading". Fetch the detail later to read the recalculated co2e.

Example

cURL

Common Errors

404 Not Found

Cause: The record does not exist, or it belongs to an organization you cannot write to. Also a file_id that is not an uploaded file you may attach to the record.

422 Validation Error

Cause: A negative number, null on a field that takes none, end_date before start_date (code INVALID_DATE_RANGE when one of them is the stored date), or file_id together with a data URI in file_url.

Get Waste Water Treatment

Read a record and its calculated emissions

Delete Waste Water Treatments

Delete records by id with their emissions