Improve this doc
Detailed information for resources

Available fields

id
belongs_to__application
actor
api_heartbeat_state
belongs_to__user
is_running__release
should_be_running__release
is_managed_by__service_instance
should_be_managed_by__supervisor_release
is_managed_by__device
device_name
uuid
is_on__commit
note
local_id
status
is_online
is_active
last_connectivity_event
is_connected_to_vpn
is_of__device_type
last_vpn_event
ip_address
mac_address
vpn_address
public_address
os_version
os_variant
supervisor_version
is_managed_by__service_instance
provisioning_progress
provisioning_state
download_progress
is_web_accessible
longitude
latitude
location
custom_longitude
custom_latitude
logs_channel
is_locked_until__date
is_accessible_by_support_until__date
memory_usage
memory_total
storage_block_device
storage_usage
storage_total
cpu_temp
cpu_usage
cpu_id
is_undervolted
created_at

Examples

Get all devices

curl -X GET \
"https://api.balena-cloud.com/v6/device" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 

Get all devices by application

curl -X GET \
"https://api.balena-cloud.com/v6/device?\$filter=belongs_to__application%20eq%20'<APP_ID>'" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 

Get device by ID

curl -X GET \
"https://api.balena-cloud.com/v6/device(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 

Get device by UUID

curl -X GET \
"https://api.balena-cloud.com/v6/device?\$filter=uuid%20eq%20'<UUID>'" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 

Rename device

curl -X PATCH \
"https://api.balena-cloud.com/v6/device(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "device_name": "<NEW NAME>"
}'

Delete device

curl -X DELETE \
"https://api.balena-cloud.com/v6/device(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 

Add note to a device

curl -X PATCH \
"https://api.balena-cloud.com/v6/device(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "note": "<NEW NOTE>"
}'

Move device to another application

curl -X PATCH \
"https://api.balena-cloud.com/v6/device(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "belongs_to__application": "<APP ID>"
}'

Get the release device is pinned to

Note: should_be_running__release will be unset or null if the device isn't pinned to any release. For an unpinned device, the device.is_on__commit field may be used to obtain the device's current state, while the application.commit field represents the device's target state.

curl -X GET \
"https://api.balena-cloud.com/v6/device(<ID>)?\$select=should_be_running__release" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 

Get current release running on device

The is_on__commit field contains the hash of the release currently deployed to the device.

curl -X GET \
"https://api.balena-cloud.com/v6/device(<ID>)?\$select=is_on__commit" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" 

Pin device to a specific release

curl -X PATCH \
"https://api.balena-cloud.com/v6/device(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "should_be_running__release": "<RELEASE ID>"
}'

Deactivate an offline device (CHARGEABLE)

curl -X PATCH \
"https://api.balena-cloud.com/v6/device(<ID>)" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "is_active": false
}'