Skip to main content
All examples call the production API:
with standard headers:
On the status endpoints, a field at its zero value is missing from the response. battery_level: 0 and ble_connected: false do not appear in the JSON at all. Read an absent field as its zero value, not as “unknown”, and do not mark these fields required in a generated client.Affected: GET /device/status, GET /device/stroker/status, GET /device/stroker/calibration, GET /device/hsc/status, GET /device/debug/info, GET /device/debug/logging.The settings endpoints behave differently: there an absent field means the device did not report it, and an explicit false is a real value. Every field is present on GET /device/info, GET /device/screen, GET /device/hdc/status, GET /device/hps/status, GET /device/hlc/status.

Device Information (Read)

Static information about the connected Melody device. These change only after a firmware update.

Device Status (Read)

Dynamic operational data from the Melody device.

Device Settings (Read/Write)

Configurable parameters that control connectivity and naming. GET /device/settings returns the whole set. POST /device/settings is a partial update: send only the fields you are changing and the rest keep their current value. false and "" are values, not omissions — {"wifi_enabled": false} turns WiFi off, while a body without wifi_enabled leaves it alone. null means the same as leaving the field out — to clear a string, send "". A field the request does not recognise is rejected with 400, so a misspelled name never passes as “leave this one alone”. When updating settings, make sure your UI clearly reflects any changes that could disconnect the current control channel (for example, disabling WiFi while using WiFi).

Service Commands (Write)

Service commands trigger specific system-level actions on the device. Send them via POST /device/maintenance/command with a JSON body containing command and, where applicable, additional parameters.
Important: Calibration and OTA may move the stroker or restart the device. Always require explicit user confirmation before triggering these commands.
Two actions that are sometimes expected here are handled elsewhere: request an OTP with POST /device/otp/generate (see OTP via WebSocket for the WebSocket alternative), and power the device down through the BLE Device Status characteristic 0x1003 → 0x0007. Example — navigate to WiFi screen:

Current Screen (Read)

Read the screen currently shown on the device display.
Response:
Available screen IDs:
IDs 1 (Intro), 4 (Playback), 16 (Battery Warning), and 17 (Overheat Warning) are intentionally omitted — these screens are shown automatically by the device and cannot be navigated to directly.

Firmware Update State

Firmware update state is read from firmware_status in the Device Information response (one of up-to-date, update-available, update-required). Use it to show an update banner in your UI.

Debug Information (Read)

Debug data is exposed for diagnostics and should not normally be shown to end users.
It is especially useful during development, QA, or support tooling.
Returned by GET /device/debug/info:

Debug Logging (Write)

You can instruct a connected device to start emitting real-time log messages over WebSocket. Melody captures and stores them for you — see Debug Logging.

Usage Notes

  • Put START_CALIBRATION and START_OTA behind a confirmation dialog — both move the stroker or restart the device.
  • Changing wifi_enabled or ble_enabled can drop the very connection carrying the request.
  • Debug logging lives in memory and is lost when the device restarts, so turn it on only while you need it.
For endpoint URLs, request and response schemas, and error codes, see the Melody API Reference.