---
title: "Report or fix fractional utilization values"
method: GET
path: "/api/admin/components/backfill-utilization"
tags: ["admin-components"]
---

# Report or fix fractional utilization values

`GET /api/admin/components/backfill-utilization`

## Request

- Base URL: `https://voltplan.app`
- URL: `https://voltplan.app/api/admin/components/backfill-utilization`
- Auth: HTTP bearer

One-shot correction for components whose `default_utilization_factor` or `duty_cycle` was stored as a fraction (`0 < v ≤ 1`) instead of a percentage; the corrected value is `Math.round(v * 100)`. Without `apply=1` this is a read-only dry run listing at most 200 candidates. **With `apply=1` this GET writes** (not idempotent): one PocketBase update per component; per-record failures are listed in `errors`.

## Query parameters

- `apply` '1'

## Response `200`

`AdminComponentBackfillDryRun` without `apply=1`, `AdminComponentBackfillApplied` with it.

- union: `AdminComponentBackfillApplied` with `apply=1`, `AdminComponentBackfillDryRun` otherwise.
  - AdminComponentBackfillDryRun: Report without writes.
    - `dryRun` unknown, required
    - `total` integer, required: Number of field changes found.
    - `candidates` AdminComponentBackfillCandidate[], required
      - `id` string, required
      - `name` string, required
      - `type` string, required: Component type: battery, charger, inverter, transformer, load, power, fuse, shunt, switch, disconnect, bridge or tool; `""` when unset.
      - `field` 'default_utilization_factor' | 'duty_cycle', required
      - `before` number, required
      - `after` integer, required: `Math.round(before * 100)`.
    - `truncated` boolean, required: `true` when more than 200 changes were found.
    - `note` string, required
  - AdminComponentBackfillApplied: Result of `apply=1`.
    - `dryRun` unknown, required
    - `updated` integer, required: Components updated.
    - `totalChanges` integer, required: Field changes attempted.
    - `errors` AdminComponentBackfillError[], required
      - `id` string, required
      - `error` string, required

## Other responses

- `403`: Admin access required. Returned for a missing, invalid or expired bearer token as well as for a valid token whose user lacks `is_admin=true`; admin endpoints never answer 401.
- `500`: PocketBase read failed.

---

[API](https://skmtc.dev/voltplan/apis/voltplan-api.md) · [All operations](https://skmtc.dev/voltplan/apis/voltplan-api/llms.txt) · [OpenAPI document](https://skmtc.dev/voltplan/apis/voltplan-api/revisions/575b86a7af92?raw)
