Create new sensor
POST
/sensors/
const url = 'https://api.occulights.com/api/v1/sensors/';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"inventoryId":"example","name":"example","roomId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.occulights.com/api/v1/sensors/ \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "inventoryId": "example", "name": "example", "roomId": "example" }'Create a new sensor for a specific tenant (default: yours)
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”tenant
string
Tenant to create sensor under
Request Body
Section titled “Request Body”New Sensor object
Media typeapplication/json
object
inventoryId
string
name
string
roomId
string
Example generated
{ "inventoryId": "example", "name": "example", "roomId": "example"}Responses
Section titled “Responses”Created
Media typeapplication/json
object
brightness
integer
debounceDelay
integer
holdTime
integer
id
string
inventoryId
Inventory is not inside this tenant, so no foreign key here
string
lightState
string
lights
Array<object>
object
brightness
integer
hardwareVersion
PCB hardware revision (e.g. “1.0.0”, “1.0.1”). Different revisions require different firmware builds, so this determines which firmware catalog a standalone light’s OTA updates are resolved against.
string
id
string
inventoryId
Inventory is not inside this tenant, so no foreign key here
string
lightState
string
macAddress
string
name
string
roomId
These are mutually exclusive
string
sensorId
string
webServer
These are only in use on standalone lights, otherwise they are decided by the sensor
string
macAddress
string
name
string
roomId
string
webServer
string
Example
{ "lightState": "on", "lights": [ { "lightState": "on", "webServer": "enabled" } ], "webServer": "enabled"}Bad Request
Media typeapplication/json
object
message
string
Example generated
{ "message": "example"}Unauthorized
Media typeapplication/json
string
Example generated
exampleNot Found
Media typeapplication/json
object
message
string
Example generated
{ "message": "example"}Conflict
Media typeapplication/json
object
message
string
Example generated
{ "message": "example"}Internal Server Error
Media typeapplication/json