Skip to main content
Access to the Melody API is scoped to your organization. Every request that controls a device is authenticated with a short-lived session token derived from your organization Developer Key. The X-Org-Key header carries this key when you link a device.

Getting access

Your Organization ID and Developer Key are issued to you by Melody. Contact support to request them — organization and key management is handled by the Melody team.
Keep your Developer Key secret and server-side. Never embed it in browser or mobile clients — issue short-lived session tokens instead.

Flow

1

Link a device to your organization

The device displays a 6-digit OTP. Submit it with your Developer Key in the X-Org-Key header to link the device and receive its Device Key.
Response:
The Device Key is stable — the same device always yields the same key.
2

Create a session token

Exchange your Developer Key for a short-lived session token. Optionally scope it to specific devices with device_keys; omit the field to allow every device linked to your organization.
Response:
3

Control the device

Call any /device/* endpoint with the session token and the target Device Key.

Token summary

Session tokens last 48 hours by default; expires_in carries the lifetime in seconds. Melody can set a different lifetime for your key, from 1 minute to 7 days. Create a new token when the old one expires.