Skip to content

Create new light

POST
/lights/
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)

tenant
string

Tenant to create light under

Light object

Media typeapplication/json
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
Allowed values: on off
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
Allowed values: enabled disabled

Created

Media typeapplication/json
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
Allowed values: on off
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
Allowed values: enabled disabled

Example

{
"lightState": "on",
"webServer": "enabled"
}

Invalid request body or company ID

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Unauthorized

Media typeapplication/json
string

Example generated

example

Inventory item not found

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Conflict with existing light

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Internal Server Error

Media typeapplication/json