Skip to main content

Authentication

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 (Melody Key).

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 are short-lived (default 15 minutes, configurable per organization). Create a new one when it expires.