Improve this doc
Detailed information for resources

balenaCloud API Resources

Note: We recently renamed applications to fleets and are in the process of updating our API resources. Application resources continue to function correctly and can be used to work with fleets. Find out more about the changes here.

Available fields

id
device
tag_key
value

Examples

Get all tags by device UUID

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

Create a new device tag

curl -X POST \
"https://api.balena-cloud.com/v6/device_tag" \
-H  "Content-Type: application/json"  \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "device": "<DEVICE ID>",
    "tag_key": "<KEY>",
    "value": "<VALUE>"
}'

Update a device tag

curl -X PATCH \
"https://api.balena-cloud.com/v6/device_tag?\$filter=(tag_key%20eq%20'<EXISTING-KEY>')%20and%20(device%20eq%20<DEVICE_ID>)" \
-H  "Content-Type: application/json"  \
-H "Authorization: Bearer <AUTH_TOKEN>" \
--data '{
    "value": "<NEW-VALUE>"
}'

Delete a device tag given its database ID

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