Create Waste Water Facility
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
type: '<string>',
country: '<string>',
address: '<string>',
wwt_line_id: '<string>',
sludge_line_id: '<string>',
wwd_line_id: '<string>',
methane_burned: true,
categories: {},
status: '<string>'
})
};
fetch('https://api.dcycle.io/v1/facilities/waste_water', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/facilities/waste_water"
payload = {
"name": "<string>",
"type": "<string>",
"country": "<string>",
"address": "<string>",
"wwt_line_id": "<string>",
"sludge_line_id": "<string>",
"wwd_line_id": "<string>",
"methane_burned": True,
"categories": {},
"status": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v1/facilities/waste_water \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"name": "<string>",
"type": "<string>",
"country": "<string>",
"address": "<string>",
"wwt_line_id": "<string>",
"sludge_line_id": "<string>",
"wwd_line_id": "<string>",
"methane_burned": true,
"categories": {},
"status": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"country": "<string>",
"address": {},
"facility_purpose_type": "<string>",
"wwt_line_id": "<string>",
"sludge_line_id": "<string>",
"wwd_line_id": "<string>",
"methane_burned": {},
"created_at": {}
}Create Waste Water Facility
Create a waste water treatment facility with treatment line configuration
POST
/
v1
/
facilities
/
waste_water
Create Waste Water Facility
const options = {
method: 'POST',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
type: '<string>',
country: '<string>',
address: '<string>',
wwt_line_id: '<string>',
sludge_line_id: '<string>',
wwd_line_id: '<string>',
methane_burned: true,
categories: {},
status: '<string>'
})
};
fetch('https://api.dcycle.io/v1/facilities/waste_water', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/facilities/waste_water"
payload = {
"name": "<string>",
"type": "<string>",
"country": "<string>",
"address": "<string>",
"wwt_line_id": "<string>",
"sludge_line_id": "<string>",
"wwd_line_id": "<string>",
"methane_burned": True,
"categories": {},
"status": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v1/facilities/waste_water \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"name": "<string>",
"type": "<string>",
"country": "<string>",
"address": "<string>",
"wwt_line_id": "<string>",
"sludge_line_id": "<string>",
"wwd_line_id": "<string>",
"methane_burned": true,
"categories": {},
"status": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"type": "<string>",
"country": "<string>",
"address": {},
"facility_purpose_type": "<string>",
"wwt_line_id": "<string>",
"sludge_line_id": "<string>",
"wwd_line_id": "<string>",
"methane_burned": {},
"created_at": {}
}← Facilities API
Create a new waste water treatment (WWT) facility in your organization. Unlike standard facilities, WWT facilities require configuration of three treatment lines:
Deprecated. Use
POST /v2/facilities with a
waste_water block: up to 1,000 facilities per request, idempotent, and the treatment lines checked against the
catalog. This endpoint keeps working; its responses carry Deprecation and Link: </v2/facilities>; rel="successor-version" headers. Its responses also carry Sunset: Fri, 30 Apr 2027 00:00:00 GMT: the endpoint is
retired on April 30, 2027 (see the changelog).- WWT line — waste water treatment process
- Sludge line — sludge treatment process
- WWD line — waste water discharge process
Request
Headers
Body Parameters
Whether methane from the treatment process is captured and burned (flared). If
true, CH4 emissions are reduced.Response
Returns201 Created with the created waste water facility.
Example
curl -X POST "https://api.dcycle.io/v1/facilities/waste_water" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"name": "Barcelona WWTP",
"type": "waste_water",
"country": "ES",
"address": "Passeig de la Zona Franca 101, Barcelona",
"wwt_line_id": "wwt-line-uuid",
"sludge_line_id": "sludge-line-uuid",
"wwd_line_id": "wwd-line-uuid",
"methane_burned": true,
"categories": ["water"]
}'
import requests
import os
response = requests.post(
"https://api.dcycle.io/v1/facilities/waste_water",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
"Content-Type": "application/json",
},
json={
"name": "Barcelona WWTP",
"type": "waste_water",
"country": "ES",
"address": "Passeig de la Zona Franca 101, Barcelona",
"wwt_line_id": "wwt-line-uuid",
"sludge_line_id": "sludge-line-uuid",
"wwd_line_id": "wwd-line-uuid",
"methane_burned": True,
"categories": ["water"],
},
)
facility = response.json()
print(f"Created WWT facility: {facility['id']} — {facility['name']}")
const axios = require('axios');
const { data: facility } = await axios.post(
'https://api.dcycle.io/v1/facilities/waste_water',
{
name: 'Barcelona WWTP',
type: 'waste_water',
country: 'ES',
address: 'Passeig de la Zona Franca 101, Barcelona',
wwt_line_id: 'wwt-line-uuid',
sludge_line_id: 'sludge-line-uuid',
wwd_line_id: 'wwd-line-uuid',
methane_burned: true,
categories: ['water'],
},
{
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
'Content-Type': 'application/json',
},
}
);
console.log(`Created: ${facility.id} — ${facility.name}`);
Successful Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Barcelona WWTP",
"type": "waste_water",
"country": "ES",
"address": "Passeig de la Zona Franca 101, Barcelona",
"status": "active",
"facility_purpose_type": "waste_water",
"wwt_line_id": "wwt-line-uuid",
"sludge_line_id": "sludge-line-uuid",
"wwd_line_id": "wwd-line-uuid",
"methane_burned": true,
"co2e": null,
"co2e_biomass": null,
"created_at": "2024-11-24T10:30:00Z"
}
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
403 Forbidden
Cause: The authenticated user is not a member of the organization{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
422 Unprocessable Entity
Cause: Missing required fields or invalid treatment line UUIDs{
"detail": [
{
"loc": ["body", "wwt_line_id"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Related Endpoints
Create Facility
Create a standard facility
List Facilities
Retrieve all facilities
Waste Water Treatments
List waste water treatment records
Was this page helpful?