Skip to content
GUIDE0% read

Device API

Register

text
POST /api/v1/device/register

Used by a new ESP32 gateway to register with JKBMSR Cloud after Wi‑Fi is configured.

Typical body fields:

FieldNotes
deviceIdStable gateway identifier
hardwareIdBoard / chip identity
firmwareVersione.g. 0.1.4
claimCodeRequired on firmware 0.1.4+; stored hashed for owner claim

Returns device JWT / refresh material and initial config.

Login

text
POST /api/v1/device/login

Used by a registered ESP32 gateway to receive a fresh JWT (deviceId + deviceSecret).

Owner claim

text
POST /api/v1/user/devices/claim

Requires a customer Bearer token.

json
{
  "deviceId": "esp32-…",
  "claimCode": "ABCD-EFGH"
}
StatusMeaning
200Claimed (or already owned by this user)
400Missing claimCode / deviceSecret
401Unknown device, wrong code, or device not registered yet
403Email not verified (when verification is enabled)
409Already claimed by another account

Legacy: deviceSecret instead of claimCode only when the device has no claim-code hash (pre–claim-code registrations).

Dashboard Device History

text
GET /api/v1/dashboard/devices/:deviceId/telemetry/history
GET /api/v1/dashboard/devices/:deviceId/ota/history

Used by the authenticated dashboard to show recent telemetry trends and persistent OTA runtime events for a visible device.

One JKBMSR domain. Every guide, right where you need it.