Skip to content

Getting Started

Base URL

http://<host>:9001

Authentication

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/apikeys endpoint uses JWT cookie auth (back-end), not the API key auth used by /api/devices.

Request Format

  • POST requests require Content-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:

ParameterTypeDefaultDescription
pagenumber1Page number
limitnumber10Items per page
namestringFilter by name (case-insensitive partial match)
datestringFilter by creation date (YYYY-MM-DD)