Skip to main content

Edge Device Logs API

Ingest and query logs from edge devices like POS terminals, IoT sensors, and distributed systems.

Ingest Logs

POST /v1/edge/logs

Send logs from edge devices. Supports batch ingestion.

Request

curl -X POST https://api.simplr-ai.com/v1/edge/logs \
-H "X-API-Key: sk_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"logs": [
{
"device_id": "pos-001",
"level": "info",
"message": "Transaction completed",
"category": "transaction",
"data": {
"transaction_id": "txn_123",
"amount": 49.99
}
}
]
}'

Log Object

FieldTypeRequiredDescription
device_idstringYesUnique device identifier
levelstringYesLog level: debug, info, warn, error, fatal
messagestringYesLog message
timestampstring/numberNoISO date or Unix timestamp (defaults to now)
categorystringNoLog category
environmentstringNoEnvironment name
errorobjectNoError details for error/fatal logs
error.typestringNoError type/class
error.stackstringNoStack trace
error.codestringNoError code
dataobjectNoCustom JSON data
tagsstring[]NoTags for filtering
trace_idstringNoDistributed trace ID
span_idstringNoSpan ID

Response

{
"success": true,
"message": "Logs received",
"content": {
"received": 1,
"processed": 1
}
}

Register Device

POST /v1/edge/devices/register

Register a new edge device.

Request

curl -X POST https://api.simplr-ai.com/v1/edge/devices/register \
-H "X-API-Key: sk_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"device_id": "pos-001",
"device_type": "pos",
"name": "Register 1",
"firmware_version": "2.1.0",
"location": {
"name": "Downtown Store",
"address": "123 Main St"
},
"tags": ["retail", "high-volume"]
}'

Device Types

  • pos - Point of Sale terminal
  • kiosk - Self-service kiosk
  • iot - IoT sensor/device
  • mobile - Mobile device
  • desktop - Desktop application
  • server - Edge server
  • gateway - Network gateway
  • other - Other device type

Device Heartbeat

POST /v1/edge/devices/:device_id/heartbeat

Send a heartbeat to indicate device is online.

curl -X POST https://api.simplr-ai.com/v1/edge/devices/pos-001/heartbeat \
-H "X-API-Key: sk_live_xxxxx"

Query Logs

GET /v1/edge/logs

Query logs with filters. Requires portal authentication.

Query Parameters

ParameterTypeDescription
org_idstringOrganization ID (required)
pagenumberPage number (default: 1)
limitnumberResults per page (default: 50)
start_datestringFilter from date (ISO 8601)
end_datestringFilter to date (ISO 8601)
device_idstringFilter by device
levelstringFilter by level (comma-separated)
categorystringFilter by category
environmentstringFilter by environment
error_fingerprintstringFilter by error group

Response

{
"success": true,
"content": {
"logs": [...],
"pagination": {
"page": 1,
"limit": 50,
"total": 1234,
"pages": 25
}
}
}

Search Logs

GET /v1/edge/logs/search

Full-text search across log messages.

Query Parameters

ParameterTypeDescription
org_idstringOrganization ID (required)
qstringSearch query (required)
pagenumberPage number
limitnumberResults per page
start_datestringFilter from date
end_datestringFilter to date

Get Error Groups

GET /v1/edge/errors

Get Sentry-style error groups with fingerprinting.

Response

{
"success": true,
"content": [
{
"fingerprint": "abc123",
"error_type": "TimeoutError",
"message": "Payment gateway timeout",
"count": 47,
"affected_devices": 3,
"first_seen": "2024-01-15T10:00:00Z",
"last_seen": "2024-01-15T14:30:00Z",
"environments": ["production"]
}
]
}

Get Overview

GET /v1/edge/overview

Dashboard statistics for edge logging.

Response

{
"success": true,
"content": {
"logs": {
"total": 50000,
"by_level": [
{ "level": "info", "count": 45000 },
{ "level": "error", "count": 500 }
]
},
"devices": {
"total": 25,
"active": 22,
"with_errors": 3
},
"errors": {
"total": 500,
"unique_types": 12,
"error_rate": 1.0
},
"trends": {
"logs_24h": 5000,
"logs_24h_change": 12.5
}
}
}

GET /v1/edge/trends

Log volume trends over time.

Query Parameters

ParameterTypeDescription
org_idstringOrganization ID (required)
start_datestringStart date
end_datestringEnd date
granularitystringhour or day (default: day)

Pricing

Edge logs use volume-based pricing:

Monthly VolumeCredits per 1,000 logs
0 - 10,0001.0
10,001 - 100,0000.8
100,001 - 1,000,0000.5
1,000,000+0.3