Create new light
const url = 'https://api.occulights.com/api/v1/lights/';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"brightness":1,"hardwareVersion":"example","id":"example","inventoryId":"example","lightState":"on","macAddress":"example","name":"example","roomId":"example","sensorId":"example","webServer":"enabled"}'};
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/lights/ \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "brightness": 1, "hardwareVersion": "example", "id": "example", "inventoryId": "example", "lightState": "on", "macAddress": "example", "name": "example", "roomId": "example", "sensorId": "example", "webServer": "enabled" }'Creates a new light for a specific tenant (default: yours)
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Tenant to create light under
Request Body
Section titled “Request Body”Light object
object
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.
Inventory is not inside this tenant, so no foreign key here
These are mutually exclusive
These are only in use on standalone lights, otherwise they are decided by the sensor
Responses
Section titled “Responses”Created
object
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.
Inventory is not inside this tenant, so no foreign key here
These are mutually exclusive
These are only in use on standalone lights, otherwise they are decided by the sensor
Example
{ "lightState": "on", "webServer": "enabled"}Invalid request body or company ID
object
Example generated
{ "message": "example"}Unauthorized
Example generated
exampleInventory item not found
object
Example generated
{ "message": "example"}Conflict with existing light
object
Example generated
{ "message": "example"}Internal Server Error