Flowion Docs

ChargingStations

Provisioning, credentials, and lifecycle for real OCPP 1.6J charging stations.

7 endpoints

Fetches a single charging_station's detail, including its boot report and registration status.

get/v1/charging-stations/{charging_station_id}Requires a bearer token

Parameters

NameInTypeDescription
charging_station_id*pathstring<uuid>ChargingStation id

Responses

StatusBodyDescription
200ChargerSummaryThe charging_station
401ErrorBodyMissing, invalid, or expired bearer token
404ErrorBodyNo charging_station with this id exists, or the caller cannot access it

Deprovisions a charging_station — a **soft** delete; idempotent.

delete/v1/charging-stations/{charging_station_id}Requires a bearer token

(see migrations/0020_chargers_disabled_at.sql and the api-gateway roadmap's Phase 4): the row, and everything hanging off it (EVSEs, connectors, transaction history), stays intact and visible through this API. What actually changes is that the charging_station's credential stops verifying (db::charging_stations::verify_password), so it can no longer open a *new* connection to ocpp-gateway — an already-open connection is not forcibly closed by this alone. Idempotent: deprovisioning an already-deprovisioned charging_station is not an error and keeps its original disabled_at. Requires the caller to be an Owner or Admin — the same provisioning bucket as create::create_charger.

Parameters

NameInTypeDescription
charging_station_id*pathstring<uuid>ChargingStation id

Responses

StatusBodyDescription
200ChargerSummaryThe deprovisioned charging_station
401ErrorBodyMissing, invalid, or expired bearer token
403ErrorBodyThe caller is a member but not an Owner or Admin
404ErrorBodyNo charging_station with this id exists, or the caller cannot access it

Lists a charging_station's boot history, most recent first.

get/v1/charging-stations/{charging_station_id}/boot-reportsRequires a bearer token

Parameters

NameInTypeDescription
charging_station_id*pathstring<uuid>ChargingStation id
pagequeryinteger<int32>1-indexed page number. Defaults to 1.
per_pagequeryinteger<int32>Boot reports per page, capped at 100. Defaults to 20.

Responses

StatusBodyDescription
200ListBootReportsResponseA page of the charging_station's BootNotification history, most recent first. Repeated entries minutes apart are a reboot loop; an entry whose firmware_version differs from its predecessor is a firmware change.
401ErrorBodyMissing, invalid, or expired bearer token
403ErrorBodyThe caller is a member of the charging_station's organization but below the required role
404ErrorBodyNo charging_station with this id exists, or you cannot access its environment

Rotates a charging_station's authorization key, returning the fresh one-time key. The previous key stops verifying immediately.

post/v1/charging-stations/{charging_station_id}/credentialRequires a bearer token

Requires the caller to be an Owner or Admin — "manage charging_station credentials" is explicitly Owner/Admin in docs/architecture/tenancy.md's proposed permission table.

Parameters

NameInTypeDescription
charging_station_id*pathstring<uuid>ChargingStation id

Responses

StatusBodyDescription
200RotateCredentialResponseThe charging_station's freshly generated one-time authorization key
401ErrorBodyMissing, invalid, or expired bearer token
403ErrorBodyThe caller is a member but not an Owner or Admin
404ErrorBodyNo charging_station with this id exists, or the caller cannot access it

Reports where a station's registration stands: current status, current step, when each completed step completed, attempt count, and the most recent failure with what the station said.

get/v1/charging-stations/{charging_station_id}/registrationRequires a bearer token

Parameters

NameInTypeDescription
charging_station_id*pathstring<uuid>ChargingStation id

Responses

StatusBodyDescription
200RegistrationResponseThe station's registration standing
401ErrorBodyMissing, invalid, or expired bearer token
404ErrorBodyNo charging_station with this id exists, or you cannot access its environment

Lists an environment's charging_stations, paginated, each with its live connection `status` and `last_seen` timestamp. Pass `status` to restrict the page (and `total`) to one bucket — `online`, `offline`, `faulted`, or `never_connected` — computed in SQL, the same rollup `GET /environments/{environment_id}/fleet-health` counts. Pass `q` to further restrict the page (and `total`) to charging_stations whose `charge_point_id` case-insensitively contains it (composes with `status` — both narrow the same listing).

get/v1/environments/{environment_id}/charging-stationsRequires a bearer token

Parameters

NameInTypeDescription
environment_id*pathstring<uuid>Environment id
pagequeryinteger<int32>1-indexed page number. Defaults to 1.
per_pagequeryinteger<int32>ChargingStations per page, capped at 100. Defaults to 20.
statusquery"online" | "offline" | "faulted" | "never_connected"Restrict the listing to one status bucket (online, offline, faulted, never_connected) instead of every charging_station. Omitted returns every charging_station in the environment, same as before this parameter existed. Inlined rather than $ref'd: IntoParams does not pull a parameter's enum into components.schemas the way a response body's ToSchema does, so a bare reference here emits a $ref to a component that is never written — which cargo test and clippy both pass, and only openapi-typescript fails on, when apps/web regenerates its client. Same reason charging_limits.rs inlines its own query enum.
qquerystringFree-text filter over charge_point_id, matched case-insensitively as a substring — q=100 matches a charging_station whose id is CP-100-A. Composes with status (both narrow the same listing) and with pagination (page/per_page/total describe the filtered set). Omitted, empty, or whitespace-only behaves as no filter at all, same as before this parameter existed.

Responses

StatusBodyDescription
200ListChargersResponseA page of the environment's charging_stations
401ErrorBodyMissing, invalid, or expired bearer token
404ErrorBodyNo environment with this id exists, or the caller cannot access it

Provisions a new charging_station in the environment, returning its one-time authorization key.

post/v1/environments/{environment_id}/charging-stationsRequires a bearer token

Requires the caller to be an Owner or Admin of the environment's organization — provisioning a charging_station is the same bucket as environment management in docs/architecture/tenancy.md's proposed permission table.

Parameters

NameInTypeDescription
environment_id*pathstring<uuid>Environment id

Request bodyCreateChargerRequest

FieldTypeDescription
charge_point_id*string

Responses

StatusBodyDescription
201CreateChargerResponseThe newly created charging_station, plus its one-time authorization key
401ErrorBodyMissing, invalid, or expired bearer token
403ErrorBodyThe caller is a member but not an Owner or Admin
404ErrorBodyNo environment with this id exists, or the caller cannot access it
409ErrorBodyA charging_station with this charge point id already exists