Metriqo API Documentation
The Metriqo REST API lets you programmatically ingest telemetry from IoT devices, query historical metrics, manage your device registry, and configure alert rules. All endpoints use JSON over HTTPS.
Authentication
All API requests must include a valid Bearer token in the Authorization header. Tokens are issued per-organization and can be generated from the dashboard settings page.
Base URL
All endpoints are relative to the following base URL:
Error Handling
The API returns standard HTTP status codes. Error responses include a JSON body with a machine-readable error code and a human-readable message.
| Status | Meaning |
|---|---|
| 200 | Request succeeded |
| 201 | Resource created |
| 400 | Bad request (malformed payload) |
| 401 | Unauthorized (missing or invalid token) |
| 404 | Resource not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Endpoints
Ingest telemetry data from one or more devices. Each payload contains a device identifier, a timestamp, and a map of metric key-value pairs. Metriqo accepts batched submissions of up to 100 data points per request.
Request Headers
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Request Body
| Field | Type | Description |
|---|---|---|
device_id | string | Unique device identifier required |
timestamp | string (ISO 8601) | Measurement timestamp. Defaults to server time if omitted. |
metrics | object | Key-value pairs of metric names and numeric values required |
Example Request
Example Response
Error Response (401)
Retrieve a paginated list of devices registered to your organization, including their last seen timestamps and current status.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
per_page | integer | Results per page, max 100 (default: 25) |
status | string | Filter by status: online, offline, inactive |
Example Request
Example Response
Query historical metric data for a specific device over a time range. Returns time-series data points sorted by timestamp in ascending order.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
device_id | string | Target device identifier required |
metric | string | Metric name (e.g. cpu_temp) required |
from | string (ISO 8601) | Start of time range required |
to | string (ISO 8601) | End of time range required |
interval | string | Aggregation interval: 1m, 5m, 1h, 1d |
Example Request
Example Response
Create a threshold-based alert rule for a device or group of devices. When the specified metric crosses the threshold, Metriqo sends a notification to the configured destination.
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Human-readable alert name required |
device_id | string | Target device (or "*" for all devices) required |
metric | string | Metric to monitor required |
condition | string | Comparison: gt, lt, gte, lte required |
threshold | number | Trigger value required |
notify | object | Notification target: {"type": "webhook", "url": "..."} required |
Example Request
Example Response
Rate Limits
API requests are rate-limited per organization. The current limits are:
| Endpoint | Limit |
|---|---|
POST /telemetry | 1,000 requests/min |
GET /devices | 300 requests/min |
GET /metrics | 300 requests/min |
POST /alerts | 60 requests/min |
When you exceed the limit, the API returns 429 Too Many Requests with a Retry-After header indicating how many seconds to wait.