1. Get authenticated
All API traffic goes to a single endpoint:- Link a device to your organization via
POST /device/otp/confirm/v2(Developer Key in theX-Org-Keyheader) to get its Device Key. - Exchange your Developer Key for a session token at
POST /api/sessions/v2. - Send every device request with both headers:
401 Unauthorized.
2. Connect your device
Connect the device to WiFi so it can reach the Melody server — the API in this guide talks to the device through the server, so the device has to be online.GET /device/session answers 200 once
it is, and 404 while it is not.
BLE is a separate, local path: an app next to the device can drive it directly over GATT, without
the server and without this API. The position and timing semantics are the same, but the wire
format is not — see the BLE Services Reference.
3. Send your first haptic command
POST /device/hdc/command moves the stroker to a target position over a given time.
position— target position,0to10000(0.01% of the calibrated range per step)time— how long the move takes, in milliseconds
Example request
4. Pick a playback protocol
Direct control is one of four ways to drive the device. Choose the one that matches your source material:
HPS needs at least two points before the stroker moves. HSC is available over WiFi only.
5. Next steps
Melody Overview & Setup
Device modes, position and velocity ranges, and how the playback protocols differ across transports.
BLE API Integration
The GATT services and characteristics the device exposes over Bluetooth Low Energy.
WiFi Device Integration
Read device info and status, and send commands over the WiFi API.
API Reference
Every endpoint, schema, and parameter.