Skip to content

Upload device log entries (device)

POST
/device/logs
curl --request POST \
--url https://localhost:8080/api/v1/device/logs \
--header 'Content-Type: application/json' \
--header 'X-Device-ID: example' \
--header 'X-Device-Key: example' \
--data '{ "dropped": 0, "entries": [ { "boot_count": 12, "level": "debug", "message": "reconnect failed: timeout", "tag": "wifi", "ts": 1793700000, "uptime_ms": 183000 } ] }'

Stores up to 50 important log entries (warnings, errors, boot, WiFi, OTA events) from the calling device. Limited to 20 uploads per device per hour.

X-Device-ID
required
string

Public device id (dev_…)

X-Device-Key
required
string

Secret device key (sk_…)

Log batch

Media typeapplication/json
object
dropped

Dropped counts entries the device discarded because its buffer was full.

integer
Example
0
entries
Array<object>
<= 50 items
object
boot_count
required
integer
Example
12
level
required
string
Allowed values: debug info warn error
Example
warn
message
required
string
<= 256 characters
Example
reconnect failed: timeout
tag
string
<= 32 characters
Example
wifi
ts

Ts is the device’s Unix time in seconds, omitted until its clock is synced.

integer
Example
1793700000
uptime_ms
required
integer
Example
183000

Created

Media typeapplication/json
object
data
object
accepted
integer
Example
{
"data": {
"accepted": 12
}
}

Unauthorized

Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
Allowed values: body query path
name
string
instance
string
status
integer
title
string
type
string
Example
{
"detail": "One or more request values are invalid.",
"errors": [
{
"code": "required",
"detail": "name is required",
"in": "body",
"name": "name"
}
],
"instance": "/api/v1/devices",
"status": 422,
"title": "Request validation failed",
"type": "https://docs.air-iq.net/reference/errors/#validation-error"
}

Request Entity Too Large

Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
Allowed values: body query path
name
string
instance
string
status
integer
title
string
type
string
Example
{
"detail": "One or more request values are invalid.",
"errors": [
{
"code": "required",
"detail": "name is required",
"in": "body",
"name": "name"
}
],
"instance": "/api/v1/devices",
"status": 422,
"title": "Request validation failed",
"type": "https://docs.air-iq.net/reference/errors/#validation-error"
}

Unsupported Media Type

Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
Allowed values: body query path
name
string
instance
string
status
integer
title
string
type
string
Example
{
"detail": "One or more request values are invalid.",
"errors": [
{
"code": "required",
"detail": "name is required",
"in": "body",
"name": "name"
}
],
"instance": "/api/v1/devices",
"status": 422,
"title": "Request validation failed",
"type": "https://docs.air-iq.net/reference/errors/#validation-error"
}

Unprocessable Entity

Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
Allowed values: body query path
name
string
instance
string
status
integer
title
string
type
string
Example
{
"detail": "One or more request values are invalid.",
"errors": [
{
"code": "required",
"detail": "name is required",
"in": "body",
"name": "name"
}
],
"instance": "/api/v1/devices",
"status": 422,
"title": "Request validation failed",
"type": "https://docs.air-iq.net/reference/errors/#validation-error"
}

Too Many Requests

Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
Allowed values: body query path
name
string
instance
string
status
integer
title
string
type
string
Example
{
"detail": "One or more request values are invalid.",
"errors": [
{
"code": "required",
"detail": "name is required",
"in": "body",
"name": "name"
}
],
"instance": "/api/v1/devices",
"status": 422,
"title": "Request validation failed",
"type": "https://docs.air-iq.net/reference/errors/#validation-error"
}

Internal Server Error

Media typeapplication/json
object
detail
string
errors
Array<object>
object
code
string
detail
string
in
string
Allowed values: body query path
name
string
instance
string
status
integer
title
string
type
string
Example
{
"detail": "One or more request values are invalid.",
"errors": [
{
"code": "required",
"detail": "name is required",
"in": "body",
"name": "name"
}
],
"instance": "/api/v1/devices",
"status": 422,
"title": "Request validation failed",
"type": "https://docs.air-iq.net/reference/errors/#validation-error"
}