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
Dry sludge produced (kg of dry matter)
number
Organic load of the influent, WWT line (kg/m³): BOD, or COD when the plant’s lines are dqo_industrial (see BOD or COD)
number
Organic load of the sludge, sludge line (kg per kg of dry sludge): BOD, or COD when the plant’s lines are dqo_industrial
number
Organic load of the effluent, WWD line (kg/m³): BOD, or COD when the plant’s lines are dqo_industrial
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). null counts as 0 (no methane recovered).
number | null
CH4 recovered in the sludge line (kg). null counts as 0 (no methane recovered).
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
Deprecated: send attachment_file_id. 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.
string | null
UUID of an uploaded file of your files to attach to the measurement as its supporting document, e.g. the plant’s operating report or a lab certificate; null removes the attachment and omitting it keeps it. Sent alone, only the attachment changes: the record keeps its status and is not recalculated. On a record whose attachment was stored in file_url, it also empties file_url, so the old document is not shown again. Not together with file_id or file_url (422). A file you cannot attach answers 404 NOT_FOUND naming File, and nothing changes.

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