Customer API · v1
Automate your fleet.
Use organization-bound, expiring API keys to discover devices, read telemetry and events, queue commands, and manage firmware.
1. Create a scoped key
In the Nivalo Console, open Settings → API Access → Create Key. The secret is shown once. Store it in your password manager or deployment secret store—never in source control, firmware, logs, or a browser bundle.
Choose only the required scopes: devices:read, telemetry:read, events:read, commands:read, commands:write, firmware:read, or firmware:write.
2. Test authentication
curl --fail-with-body \
--header "Authorization: Bearer $NIVALO_API_KEY" \
https://api.nivalo.io/v1/me
X-API-Key is also accepted, but bearer authentication is the recommended default for server-side integrations.
3. List devices with cursor pagination
curl --fail-with-body \
--header "Authorization: Bearer $NIVALO_API_KEY" \
"https://api.nivalo.io/v1/devices?pageSize=100&sort=name&direction=asc"
{
"items": [],
"nextCursor": "v1.opaque-continuation-state",
"hasMore": false
}
When hasMore is true, send nextCursor back as the cursor query parameter without decoding or modifying it. Cursors are bound to the organization, resource, sort, direction, search, and filters.
4. Queue a command
curl --fail-with-body \
--request POST \
--header "Authorization: Bearer $NIVALO_API_KEY" \
--header "Content-Type: application/json" \
--data '{"command":"setLed","argumentsJson":"{\"state\":true}"}' \
"https://api.nivalo.io/v1/devices/$DEVICE_ID/commands"
Arguments are a JSON object without null, at most 768 bytes. The command must be a function the device currently reports, and the device's product must define that function with an argument schema the arguments satisfy; otherwise the request is refused with a stable code (for example not-reported, no-validator or arguments). Commands expire after 300 seconds unless you ask for less. Command creation returns durable state. Poll the device's commands endpoint or use the console to follow the queued, published, accepted and running states and the terminal succeeded, failed, indeterminate (the outcome is unknown and the device may have acted; never resend blindly) or cancelled (never sent).
Endpoint map
| Endpoint | Typical scope |
|---|---|
GET /me | Authenticated organization identity |
GET /devicesGET /devices/{deviceId} | devices:read |
GET /devices/{deviceId}/telemetry | telemetry:read |
GET /devices/{deviceId}/events | events:read |
GET /devices/{deviceId}/commands | commands:read |
POST /devices/{deviceId}/commands | commands:write |
GET /firmware/artifacts | firmware:read |
POST /firmware/artifactsPOST /devices/{deviceId}/firmware/jobs | firmware:write |
Client-library entry points
The HTTP API is standards-based and can be called from any server-side HTTP client. Device firmware should use the maintained ESP32 NivaloDevice SDK, while custom device or gateway implementations should validate against the exact protocol specs and schemas published with this site.