Links

Create Device

Create a new device. If you set `ifNotExists` to `false` and the device already exists, the `deviceType` will be overwritten.
post
https://studio.edgeimpulse.com/v1
/api/{projectId}/devices/create
Create device

Create a new device. If you set ifNotExists to false and the device already exists, the deviceType will be overwritten.

Parameters
Path
projectId*
integer
Project ID
Body
Example
Schema
{
"deviceId": "ac:87:a3:0a:2d:1b",
"deviceType": "DISCO_L475VG_IOT01A",
"ifNotExists": true
}
Responses
200: OK
OK
cURL
Python
Node.js
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api/{projectId}/devices/create \
--header 'content-type: application/json' \
--header 'x-jwt-token: REPLACE_KEY_VALUE' \
--data '{"deviceId":"ac:87:a3:0a:2d:1b","deviceType":"DISCO_L475VG_IOT01A","ifNotExists":true}'
import http.client
conn = http.client.HTTPSConnection("studio.edgeimpulse.com")
payload = "{\"deviceId\":\"ac:87:a3:0a:2d:1b\",\"deviceType\":\"DISCO_L475VG_IOT01A\",\"ifNotExists\":true}"
headers = {
'content-type': "application/json",
'x-jwt-token': "REPLACE_KEY_VALUE"
}
conn.request("POST", "/v1/api/{projectId}/devices/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const request = require('request');
const options = {
method: 'POST',
url: 'https://studio.edgeimpulse.com/v1/api/{projectId}/devices/create',
headers: {'content-type': 'application/json', 'x-jwt-token': 'REPLACE_KEY_VALUE'},
body: {
deviceId: 'ac:87:a3:0a:2d:1b',
deviceType: 'DISCO_L475VG_IOT01A',
ifNotExists: true
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});