Sites
A physical location with coordinates that contains assets and rolls up their capacity.
A site is a place: a wind farm, a solar park, an island with two turbines on it. It has coordinates, it contains assets through the built-in part attribute assets, and stats.total_capacity_kw is always the sum of those assets' capacities.
Fields
| Field | Type | Notes |
|---|---|---|
name | string | Required. Unique within the workspace. Envelope field. |
values.latitude, values.longitude | number | Required. |
values.description | string | Optional. |
values.assets | list | Optional on create. Each entry is an asset record body: name plus values with type, capacity_kw, and optional description, latitude, longitude. |
Responses add the envelope (id, object: "sites", timestamps, stats.total_capacity_kw) and return values.assets as whole asset records, each with parent_id pointing back at the site. An asset created without coordinates reports the site's.
Create
Include the assets inline and they are created atomically with the site:
r = requests.post(f"{BASE}/objects/sites", headers=HEADERS, json={
"name": "Utsira",
"values": {
"description": "Small island wind site",
"latitude": 59.3068,
"longitude": 4.8896,
"assets": [
{"name": "Enercon E-40 x2", "values": {"type": "wind_turbine", "capacity_kw": 1200}},
],
},
})
r.raise_for_status()
site = r.json()The Quickstart shows the full response. A site with no assets is fine too; add them later with POST /objects/assets and parent_id.
List a site's assets
The site record carries its assets inlined in values.assets, capped. For the full list, use the attribute's own route:
r = requests.get(f"{BASE}/objects/sites/{site['id']}/assets", headers=HEADERS)
r.raise_for_status()
for a in r.json()["items"]:
print(a["id"], a["name"])Each entry carries id, name, object, a representative latitude/longitude, and link counts. Fetch an asset by id for its full record.
Update
PATCH /objects/sites/{record_id} changes name and, under values, description and the coordinates in the usual partial way. values.assets behaves differently:
assets in a PATCH is additive
Each entry in values.assets on a PATCH creates a new asset on the site. It does not replace the existing list and cannot edit an existing asset. To change or remove an asset, use PATCH/DELETE /objects/assets/{record_id}.
# Adds a battery alongside the existing turbines
requests.patch(f"{BASE}/objects/sites/{site['id']}", headers=HEADERS, json={
"values": {"assets": [{"name": "Battery 1", "values": {"type": "battery", "capacity_kw": 500}}]},
}).raise_for_status()Delete
DELETE /objects/sites/{record_id} deletes the site, every asset it contains, and every timeseries attached to the site or its assets. References to the site from custom records are left pointing at a deleted record (name: null).
Timeseries on sites
Sites are where most measured data lands: production, availability, curtailment. See Upload / read timeseries. Data that describes a single turbine rather than the whole site belongs on the asset instead.