Networks
Networks group nodes; each market is one. Their status, now and over time.
| GET | /networks | List Networks |
| GET | /networks/{network_id} | Get Network |
| GET | /networks/{network_id}/status | Network Status |
| GET | /networks/{network_id}/status/history | Network Status History |
| GET | /networks/status | All Network Status |
| GET | /networks/status/system | System Status |
List Networks
/api/v2/networksThe 13 networks, with how big each one is.
Query parameters
sortrequirede.g. sensor_countdirrequirede.g. descqoptionale.g. pjmlimitoptionale.g. 100offsetoptionale.g. 0
And makes two more unnecessary, because they are a filter on the thing being listed rather than a property of a network: /api/networks/{id}/nodes -> /api/v2/nodes?network_id={id} /api/networks/{id}/sensors -> /api/v2/sensors?network_id={id}
Both of those already take the filter, both page and sort properly, and both return the richer item their own domain defines — so a network's sensors are the same sensor shape /sensors returns, not a thinner copy.
Sort: relevance, name, node_count, sensor_count, created_at, updated_at, id. Default name asc, or relevance desc with ?q=.
node_count and sensor_count are what /networks/{id}/nodes and
/networks/{id}/sensors cost two requests each to learn — twenty-six requests
to render one thirteen-row table. Measured at 242ms for all 13.
query reaches websearch_to_tsquery as a bound parameter. Data class: reference topology, no readings.
Worth knowing
One shape for listing and searching. ?q= is a filter on this shape, not
a separate endpoint that renames every field and returns a bare array. On
13 networks the paging hardly matters; the naming does, because otherwise
a caller cannot hand a search result to code that reads a listing
result.
?sort=relevance without ?q= is refused rather than answered with every network ranked 0.
Errors
| 400 | invalid_param | sort or dir is not one of the advertised values |
| 400 | invalid_param | sort=relevance with no ?q= |
| 400 | limit_exceeded | limit above 1000, or q longer than 200 characters |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role). The
- Cache
- static tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/networks?sort=sensor_count&dir=desc" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": {
"source": "network", "class": "reference",
"count": 2, "limit": 2, "offset": 0, "total": 13,
"sortable": ["relevance","name","node_count","sensor_count", ...]
},
"items": [
{
"id": "f1fd9f51-b56e-4cd7-8808-5e929af7d3ad",
"name": "pjm",
"description": "work-in-progress",
"node_count": 17572,
"sensor_count": 90218,
"relevance": 0,
"created_at": "2025-11-26T17:33:44.056333Z",
"updated_at": "2026-01-24T13:21:43.191182Z"
}
]
}Get Network
/api/v2/networks/{network_id}One network.
Path parameters
network_idrequirede.g. 024fe0c3-8d49-4624-855e-27e4882f90df
Same shape as an item from the listing, read through the same scan list, so a caller can hand either to the same code. The statement binds one parameter and references no others — a gap in the parameter numbering is an error Postgres reports rather than ignores.
Worth knowing
Carries node_count and sensor_count.
404 carries a machine code and the request id, so a client branches on it rather than matching prose.
Errors
| 400 | invalid_param | network_id is not a UUID |
| 404 | not_found | no network with this id |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- static tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/networks/024fe0c3-8d49-4624-855e-27e4882f90df" \
-H "Authorization: $GRIDBASE_API_KEY"Network Status
/api/v2/networks/{network_id}/statusOne network's latest sensor-freshness snapshot.
Path parameters
network_idrequirede.g. 024fe0c3-8d49-4624-855e-27e4882f90df
Snapshots are written by grid-workers every half hour and retained seven days.
Data class: computed from a snapshot table, not read live off the sensors.
snapshot.
Worth knowing
uncategorized_sensors is the point of this route. Fresh, stale and
unknown do not sum to the total, and without a fourth bucket nothing says
so. On production today:
caiso 39,791 total 7,455 fresh 17,956 stale 3,622 unknown -> 10,758 unaccounted
pjm 90,218 total 83,260 fresh 16 stale 3,926 unknown -> 3,016 unaccounted
miso 16,047 total 4,992 fresh 0 stale 10,889 unknown -> 166 unaccounted
14,246 sensors system-wide are in none of the three named buckets — 27% of
CAISO's fleet. A caller building a status page from fresh_pct and
stale_pct and inferring the rest is unknown draws a chart that does not
add up, with no field to explain the gap. This reports the residual, and
meta.warnings says when it is non-zero.
What those sensors are is not knowable from this API: the classifier runs in grid-workers. That they exist is.
All four percentages are returned, so a caller never divides by
total_sensors itself and never has to guard a network with no sensors
against a division by zero. All four are null rather than 0 when there
are no sensors: 0% fresh of nothing is not a fact about freshness, and a
client charting it draws a failing network rather than an empty one.
The timestamp has one name, at, on this route and the other two that
read the same table.
404 says which fact it is: a network that has never been snapshotted and an id that is not a network get different bodies.
Errors
| 400 | invalid_param | network_id is not a UUID |
| 404 | not_found | no network with this id |
| 404 | not_found | the network exists but has no status snapshot |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- slow tier — a minute of staleness cannot change a half-hourly
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/networks/024fe0c3-8d49-4624-855e-27e4882f90df/status" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": {
"source": "network_sensor_status", "class": "computed",
"as_of": "2026-11-07T17:30:00.793458Z",
"warnings": ["uncategorized_sensors is non-zero: ..."]
},
"item": {
"network": { "id": "024fe0c3-...", "name": "caiso" },
"at": "2026-11-07T17:30:00.793458Z",
"total_sensors": 39791,
"fresh_sensors": 7455,
"stale_sensors": 17956,
"unknown_sensors": 3622,
"uncategorized_sensors": 10758,
"fresh_pct": 18.7, "stale_pct": 45.1,
"unknown_pct": 9.1, "uncategorized_pct": 27,
"oldest_data_ts": "2026-11-01T06:00:00Z",
"newest_data_ts": "2026-11-13T07:00:00Z"
}
}Network Status History
/api/v2/networks/{network_id}/status/historyOne network's freshness trend, for a chart.
Path parameters
network_idrequirede.g. 024fe0c3-8d49-4624-855e-27e4882f90df
Query parameters
limitrequirede.g. 48offsetoptionale.g. 0diroptionale.g. desc
Paging: default 48 (a day of half-hourly snapshots), max 336 (seven days,
which is the retention). ?dir=asc|desc, default desc.
meta.coverage is the span the page actually carries, which with ?dir=desc
runs backwards from the newest snapshot.
Each item is the same shape the other three status routes return.
Worth knowing
It is ?dir=, as on every other route here — not order on this one
alone.
One statement, not two. The direction is a CASE in the ordering, so there is one query and one plan rather than an ascending and a descending query whose rows then have to be copied field by field into a common type.
The item matches the other status routes. It carries network_id and
network_name and calls the snapshot timestamp at, the same as /status
and /{id}/status — three routes reading one table should not be three
shapes with two names for one column.
limit refuses above 336 rather than clamping, so a caller asking for
two weeks is told the retention is one, instead of receiving one week and
believing it is two.
Carries uncategorized_sensors and all four percentages.
Errors
| 400 | invalid_param | network_id is not a UUID |
| 400 | invalid_param | dir is not asc or desc |
| 400 | limit_exceeded | limit above 336 |
| 404 | not_found | no network with this id |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- slow tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/networks/024fe0c3-8d49-4624-855e-27e4882f90df/status/history?limit=48" \
-H "Authorization: $GRIDBASE_API_KEY"All Network Status
/api/v2/networks/statusEvery network's latest snapshot — the status-page query.
Same item shape as /networks/{id}/status, from the same statement with the single-network filter left off, so the two routes cannot disagree about one network's figures.
meta.warnings names the network with the largest uncategorized residual.
Worth knowing
meta.as_of states how fresh the snapshots are, which a count alone does
not.
Carries uncategorized_sensors and all four percentages — see Network
Status for why that matters.
Errors
| none beyond auth; this route takes no parameters |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- slow tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/networks/status" \
-H "Authorization: $GRIDBASE_API_KEY"System Status
/api/v2/networks/status/systemThe fleet total, summed over every network's latest snapshot.
meta.total is how many networks were summed, and network is absent
rather than null — the total spans every network, so the field would have to
name one.
Worth knowing
Carries uncategorized_sensors: 14,246 sensors are counted in
total_sensors and in none of fresh, stale or unknown. Publishing only
fresh_pct and stale_pct against the total invites a caller to infer the
rest, and that inference is wrong by 8.2 points.
Survives an empty table. SUM over no rows is NULL, not 0, so it is read
as a nullable and reported as an honest zero with meta.total: 0 and a
warning — a fleet of nothing should not read as a healthy fleet.
Errors
| none beyond auth; this route takes no parameters |
- Security
- a read behind the v2 capability gate (`v2` + `read`, no role).
- Cache
- slow tier.
curl "https://utility-api-86672132515.us-east1.run.app/api/v2/networks/status/system" \
-H "Authorization: $GRIDBASE_API_KEY"{
"meta": {
"source": "network_sensor_status", "class": "computed",
"as_of": "2026-11-07T17:30:00.793458Z",
"total": 12
},
"item": {
"at": "2026-11-07T17:30:00.793458Z",
"total_sensors": 172691,
"fresh_sensors": 113218,
"stale_sensors": 18038,
"unknown_sensors": 27189,
"uncategorized_sensors": 14246,
"fresh_pct": 65.6, "stale_pct": 10.4,
"unknown_pct": 15.7, "uncategorized_pct": 8.2
}
}