Getting Started
Base URL
http://<host>:9001Authentication
All requests must include an API key in the Authorization header using the Bearer scheme:
bash
Authorization: Bearer <your-api-key>API keys are stored in the iot_apikeys collection. An API key must have enabled: true to be valid.
How to get an API key
Create an API key through the platform's back-end API:
bash
POST /api/apikeys?id=new
Authorization: Bearer <your-jwt-cookie>
Content-Type: application/json
{
"name": "My API Key",
"description": "For HTTP device management"
}The response will contain the generated key value.
Note: The
/api/apikeysendpoint uses JWT cookie auth (back-end), not the API key auth used by/api/devices.
Request Format
POSTrequests requireContent-Type: application/json- Query parameters are used for pagination and filtering
- Object IDs are passed as 24-character hex strings
Response Format
Success
json
{
"success": true,
"data": { ... },
"total": 42,
"page": 1,
"limit": 10
}Error
json
{
"success": false,
"error": true
}Authentication Error
json
{
"error": true,
"message": [{"message": "Unauthorized"}]
}Pagination
List endpoints support pagination via query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
limit | number | 10 | Items per page |
name | string | — | Filter by name (case-insensitive partial match) |
date | string | — | Filter by creation date (YYYY-MM-DD) |