Dashboard and work queue (/v1/dashboard, /v1/me/work-queue)
These two routes feed the home screen of the web console. The dashboard shows plant counts, capacity, regions on a map, plants still being set up, and "needs attention" badges. The work queue lists what the caller has to act on in the active org.
:::note Status
Verified against packages/api/src/handlers/dashboard.ts,
packages/core/src/plants/summary.ts (getDashboard), packages/core/src/plants/projections.ts
(plantFleetFacets, ADR 0024),
packages/core/src/work-queue/providers.ts and DashboardResponse /
WorkQueueResponse in packages/core/src/schemas.ts. The web team observed
GET /v1/me/work-queue answering 401 without a token on dev on 2026-11-02, so it is
routed there. No signed-in response has been captured yet, so every example is
illustrative and derived from the schema.
The work-queue count, like the access-request badge, comes from a counter that only the
stream-router updates (KI-43). On a stage deployed without
busEnabled, the count can stay at 0 or go stale.
:::
Both routes need a Cognito access token (Authorization: Bearer <token>) and the
X-Org-Id header. Neither route accepts query parameters, and any parameter you send
returns 400 VALIDATION_FAILED. Both are read-only, so they take no Idempotency-Key
or If-Match. Their figures come from counters, so they are eventually consistent:
a newly created plant can take a few seconds to show up.
GET /v1/dashboard — Console dashboard (C21)
- Authorization: an ACTIVE membership in
X-Org-Idandplants≥VIEW. - DynamoDB: the org's facet counters (one
Queryfor unscoped callers, or aBatchGetof the caller's region counters for scoped callers),SETUP#markers joined to plant META (for a scoped caller: the org's newest 200 markers, joined in BatchGets of 100 and filtered to the caller's scope), tag labels forrefs, and the work-queue providers forattention. In the Crown HQ fleet view the counters and markers come from the fleet partitionFLEET#ALLinstead.
Response 200
| Field | Type | Notes |
|---|---|---|
approximate | true | Always true, because the figures come from counters |
scoped | boolean | false only for platform staff and for ALL scope in an OPERATOR org |
plantCount | integer | Only when scoped is false |
capacityKwp | number | Sum of pvCapacityKwp. Only when scoped is false |
expectedAnnualYieldKwh | number | Only when scoped is false |
regions[] | DashboardRegion | regionTagId, label, plantCount, optional centroid {latitude, longitude}, and orgId (the org that owns the region tag) in the fleet view only. Unscoped callers get every region with a counter whose tag still resolves; since 2026-12-01 (BE-13) a region whose tag was deleted or has no known owning org is left out, so every regions[].regionTagId is in refs.tags and no label is a raw id. Scoped callers get only their REGION scope targets, and an empty list for any other scope kind |
setupIncomplete | {items[≤5], total} | The 5 newest ACTIVE plants that have no registered device (plantId, code?, name, createdAt, pvCapacityKwp?, and operatorOrgId in the fleet view only). Sent to unscoped callers and, since 2026-11-17, to scoped members of an OPERATOR org, limited to their scope (see Setup incomplete). Not sent to CUSTOMER or PARTNER orgs |
attention | object | Always present, but may be {}. accessRequests {count, oldestAt?} appears whenever team ≥ MANAGE (count may be 0). overdueWorkOrders and pendingApprovals are reserved: they appear once those features ship, and are never sent today |
refs | Refs | Tag labels for the regions |
centroid is the average position of the region's plants that have coordinates. It is
left out when none of them do. If a region's tag has been deleted, label falls back to
the tag id.
Successful response, illustrative:
{
"approximate": true,
"scoped": false,
"plantCount": 128,
"capacityKwp": 1420.5,
"expectedAnnualYieldKwh": 2130000,
"regions": [
{ "regionTagId": "01J9ZA0000000000000000000R", "label": "Sindh", "plantCount": 64,
"centroid": { "latitude": 24.9, "longitude": 67.1 } }
],
"setupIncomplete": {
"items": [{ "plantId": "01J9ZB0000000000000000000P", "code": "PL-000123", "name": "Clifton Rooftop",
"createdAt": "2026-10-12T09:30:00.000Z", "pvCapacityKwp": 12 }],
"total": 1
},
"attention": { "accessRequests": { "count": 3, "oldestAt": "2026-10-10T08:00:00.000Z" } },
"refs": { "tags": { "01J9ZA0000000000000000000R": { "label": "Sindh" } } }
}
Crown HQ fleet view (ADR 0024)
:::note Status Committed 2026-11-11, not deployed and not yet executed against any stage. Fixes bug report B-2 ("0 plants · 0 kWp · 0 regions" in HQ). Needs the one-off backfill in Operations after deploy. :::
When X-Org-Id is the PLATFORM org (Crown HQ) and the caller is an ACTIVE member with the
built-in Super Admin or Administrator role and scope ALL (the same rule as
platform-wide search, ADR 0015), the dashboard counts every
org's plants, personal orgs (Independent End Users) included:
plantCount,capacityKwp(sum of each ACTIVE plant'spvCapacityKwp),expectedAnnualYieldKwh,regionsandsetupIncompleteare read from the fleet partitionFLEET#ALL(COUNT#plants#…counters andSETUP#<plantId>markers), which the plants stream projector and the plant write transactions keep next to each org's own.- Each region row carries
orgId, and itslabelis read from that org's tags. Each setup-incomplete item carriesoperatorOrgId, so the console can open the plant in its org. - Plants of a suspended org are still counted (owner decision 2026-11-11).
attentionis unchanged: it is the caller's own org.
A custom PLATFORM role (an "Admin with assigned permissions") does not get the fleet view: it sees the HQ org's own figures, which are always zero because no plant belongs to HQ. Pick a Business in the org switcher to see that Business's dashboard.
The fleet figures can differ from the TCP fleet messages (get_fleet_overview,
get_plant_health): TCP counts plants by their in-service devices, while this route counts
ACTIVE plant records whether or not a device is bound.
Fleet-view response, illustrative (derived from the schema, not captured):
{
"approximate": true,
"scoped": false,
"plantCount": 9,
"capacityKwp": 96.5,
"expectedAnnualYieldKwh": 120000,
"regions": [
{ "regionTagId": "01J9ZA0000000000000000000R", "label": "Sindh", "plantCount": 4,
"orgId": "01J9ZC0000000000000000000B", "centroid": { "latitude": 24.9, "longitude": 67.1 } }
],
"setupIncomplete": {
"items": [{ "plantId": "01J9ZB0000000000000000000P", "code": "PL-000123", "name": "Clifton Rooftop",
"createdAt": "2026-10-12T09:30:00.000Z", "operatorOrgId": "01J9ZC0000000000000000000B" }],
"total": 1
},
"attention": {},
"refs": { "orgs": {}, "tags": { "01J9ZA0000000000000000000R": { "label": "Sindh" } } }
}
A scoped caller (for example with REGION scope) gets {"approximate": true, "scoped": true, "regions": [...], "setupIncomplete": {...}, "attention": {...}, "refs": {...}},
with no totals. setupIncomplete is there only when the org is an OPERATOR org.
Setup incomplete
:::note Status
Scoped callers get setupIncomplete since 2026-11-17 (web console request B-6). Unit-tested;
not deployed and not executed against any stage yet.
:::
What "setup incomplete" means. An ACTIVE plant that has never had a device registered
to it. A plant created on the web gets a SETUP#<plantId> marker in its operator org. The
first serial binding to the plant removes it, whether the binding is made over HTTP (device
claim) or arrives from the TCP side. It is not about telemetry: a plant whose device is
bound but has never reported is not setup-incomplete here (the TCP get_plant_health
status: "setup" uses that other meaning, "no device ever reported"). Removing every device
later does not put the marker back. Archiving removes it and restoring puts it back. Plants
created by the mobile app never get one.
Scoped callers. A member whose scope is TAG, REGION, CUSTOMER or PLANTS (an
Installer's assigned plants included) sees only the plants that scope covers, the same rule
as the scoped plant list: the plant's operator is this org, and it carries one
of the scope's tags, has one of its region tags, belongs to one of its customers, or is in its
plant list. The org's 200 newest markers are checked, so for an org with more than 200
setup-incomplete plants total is a lower bound (the response is approximate: true).
items are the 5 newest covered plants. CUSTOMER and PARTNER orgs get no setupIncomplete,
because the markers are kept in the operator org.
Scoped response, illustrative (derived from the schema, not captured):
{
"approximate": true,
"scoped": true,
"regions": [],
"setupIncomplete": {
"items": [{ "plantId": "01J9ZB0000000000000000000P", "code": "PL-000123", "name": "Clifton Rooftop",
"createdAt": "2026-10-12T09:30:00.000Z", "pvCapacityKwp": 12 }],
"total": 1
},
"attention": {},
"refs": { "orgs": {}, "tags": {} }
}
Errors
| Status | code | When | FE action |
|---|---|---|---|
| 400 | ORG_CONTEXT_REQUIRED | No X-Org-Id | Send the selected org |
| 400 | VALIDATION_FAILED | Any query parameter | Remove it |
| 401 | — (gateway) | Missing or expired token | Refresh the token or sign in again |
| 403 | FORBIDDEN | Not an ACTIVE member of the org, or plants < VIEW | Hide the dashboard and don't retry |
| 404 | NOT_FOUND | Platform staff with no membership of their own in X-Org-Id who are NOT eligible for the platform fallback (platform membership not ACTIVE/ALL-scoped, or the org is non-ACTIVE or PLATFORM). An eligible platform member is evaluated at the platform role's own levels instead | Re-fetch the org switcher |
| 500 / 503 | INTERNAL / DEPENDENCY_UNAVAILABLE | Server or DynamoDB error | Retry with backoff |
Edge cases
- Crown HQ before the fleet backfill has run shows only plants created or changed since
the ADR 0024 deploy. After
rebuild:projections -- --all-orgs --executeit shows the whole fleet. - A new org returns
plantCount: 0,capacityKwp: 0,regions: [],setupIncomplete: {items: [], total: 0}.attentionis{}for callers belowteamMANAGE; an Administrator (or anyone withteamMANAGE) getsattention: {accessRequests: {count: 0}}. - Counters lag behind writes. After creating or archiving a plant, the counts may be briefly out of date. Don't re-fetch in a tight loop.
- Archived plants leave both
setupIncomplete.itemsandsetupIncomplete.total. Archiving removes the plant's setup-incomplete marker; restoring puts it back, so a restored plant that is still incomplete reappears in both. - Treat a missing field as "not available". Don't show
0whenplantCountis absent because the caller is scoped.
Not the same as the TCP setup status
Since the Fleet Health request (2026-12-01, BR-2), setupIncomplete.total is not used for the Fleet Health "Setup Required" row. TCP marks a plant setup when it has no member device or no member device has ever reported. It also leaves revoked or deactivated devices out of the member count. "Ever reported" is telemetry, and this service never reads telemetry. So the two counts can differ, and setupIncomplete can be the smaller one. Fleet Health reads every row, Setup Required included, from plantCounts.byStatus on the TCP alerts_summary message (see the TCP Server device alerts docs). setupIncomplete keeps its meaning: the newest ACTIVE plants that still need a device bound.
Which plants the counts include (BE-14, 2026-12-01)
The console showed, for the same caller at the same moment: /v1/dashboard 52 plants / 705.6 kWp, TCP
get_fleet_overview 158.2 kWp, TCP get_plant_rankings plantsRanked: 63. They count different things:
| Source | Plants counted | Capacity |
|---|---|---|
GET /v1/dashboard (this service), fleet view (Crown HQ Super Admin / Administrator) | every ACTIVE plant record of every org (FLEET#ALL counters, ADR 0024) — ARCHIVED, DELETING and legacy plants are not counted | sum of those plants' configured pvCapacityKwp |
GET /v1/dashboard, one org | that org's ACTIVE plants as operator (ORG#<o> counters); a scoped caller gets no totals | same, for those plants |
TCP list_plants / rankings / fleet overview | plants the caller's access ticket reaches (operator, customer, installer and plant grants) and, for rankings / fleet capacity, plants with reporting devices | TCP's own capacity rules (see the TCP Server docs) |
So the HTTP and TCP figures are not expected to be equal: HTTP counts configured plant records, TCP counts reach
and telemetry. On dev the HTTP fleet counters are stale: FLEET#ALL is maintained by the stream-router, which
is not deployed on dev (KI-43), so plants created or archived since the last rebuild are
missing. A human re-converges them with npm run rebuild:projections -- --all-orgs (dry-run first; it rewrites the
fleet partition only when every org was read without a failure). Duplicate serials (BE-14's second half) belong to
cse-tcp-be.
GET /v1/me/work-queue — The caller's work queue (C22)
- Authorization: any ACTIVE member of
X-Org-Id. Each kind of item also has its own permission check. - Only
ACCESS_REQUESTSexists today. It needsteam≥MANAGEand counts the PENDING access requests.OVERDUE_WORK_ORDERS,PENDING_APPROVALSandREPORT_APPROVALSare reserved enum values, sent once their features ship (FIRMWARE_STAGEDwas removed by ADR 0012). The client should ignore kinds it does not know.
Response 200
{ "items": WorkQueueItem[] }. Kinds with a zero count, and kinds whose feature has not
shipped, are left out, so items can be empty.
| Field | Type | Notes |
|---|---|---|
kind | enum | See above |
count | integer ≥ 1 | |
oldestAt | ISO timestamp | Best effort, so it can be absent |
scopeLabel | string | Optional |
target | {module, filter?} | Where the console should navigate, e.g. {"module": "team", "filter": {"tab": "access-requests", "status": "PENDING"}} |
Successful response, illustrative:
{
"items": [
{ "kind": "ACCESS_REQUESTS", "count": 3, "oldestAt": "2026-10-10T08:00:00.000Z",
"target": { "module": "team", "filter": { "tab": "access-requests", "status": "PENDING" } } }
]
}
Errors
Same as the dashboard, except that 403 FORBIDDEN only means the caller is not an
ACTIVE member of the org. There is no plants check.
Edge cases
- A Viewer always gets
{"items": []}, which is not an error. - The count comes from the same counter as the access-request badge, so the two always show the same number, and both can lag briefly.