register device using the API

I’m trying to register a device to openbalena using the API but i can’t make it work, i would appreciate any help.

when i execute

curl -X POST -k --cacert ca.crt -H “Content-Type: application/json” -H “Authorization: Bearer xxxxx” --data “{“application”: “test”}” “https://api.myhost.com/v5/device

I get “Unknown device type undefined” error.

it seems theres no clear docs on how to do this

this is the way to do it
–data “{“belongs_to__application”: “1”, “device_type”: “raspberrypi3”}” “https://api.myhost.com/v5/device

Hey Jose, I’m glad you figured it out, but yes, some of the data was missing in your original request. Let us know if you get stuck anywhere else.