Skip to content

Create Device

POST
/api/devices
curl --request POST \
--url 'https://example.com/api/devices?organization_id=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "attributes": {}, "description": "example", "device_id": "example", "firmware_version": "example", "hardware_version": "example", "mac_address": "example", "name": "example", "serial_number": "example", "tags": { "additionalProperty": "example" } }'

Register a new device

organization_id
required
Organization Id
string format: uuid
Media type application/json
DeviceCreate

Device creation/registration schema

object
attributes
Any of:
object
key
additional properties
any
description
Any of:
string
device_id
required
Device Id
string
>= 1 characters <= 255 characters
firmware_version
Any of:
string
hardware_version
Any of:
string
mac_address
Any of:
string
name
Any of:
string
<= 255 characters
serial_number
Any of:
string
tags
Any of:
object
key
additional properties
string
Example generated
{
"attributes": {},
"description": "example",
"device_id": "example",
"firmware_version": "example",
"hardware_version": "example",
"mac_address": "example",
"name": "example",
"serial_number": "example",
"tags": {
"additionalProperty": "example"
}
}

Successful Response

Media type application/json
DeviceResponse

Device response schema

object
attributes
Any of:
object
key
additional properties
any
cpu_usage
required
Any of:
number
crash_count
required
Crash Count
integer
created_at
required
Created At
string format: date-time
description
Any of:
string
device_id
required
Device Id
string
disk_usage
required
Any of:
number
distro_version
Any of:
string
firmware_version
required
Any of:
string
hardware_version
required
Any of:
string
hostname
Any of:
string
id
required
Id
string format: uuid
is_active
required
Is Active
boolean
kernel
Any of:
string
last_boot
required
Any of:
string format: date-time
last_ip
required
Any of:
string
last_seen
required
Any of:
string format: date-time
mac_address
required
Any of:
string
memory_usage
required
Any of:
number
name
Any of:
string
<= 255 characters
organization_id
required
Organization Id
string format: uuid
os
Any of:
string
reboot_count
required
Reboot Count
integer
registered_at
required
Registered At
string format: date-time
serial_number
required
Any of:
string
status
required
DeviceStatus

Device status

string
Allowed values: online offline degraded updating error unknown
tags
Any of:
object
key
additional properties
string
temperature
required
Any of:
number
tunnel_id
Any of:
string
tunnel_last_seen
Any of:
string format: date-time
tunnel_online
Tunnel Online
boolean
tunnel_status
Tunnel Status
string
default: unknown
uptime_seconds
required
Any of:
number
Example
{
"status": "online",
"tunnel_online": false,
"tunnel_status": "unknown"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}