Skip to content

Bulk-import rooms

POST
/rooms/import
curl --request POST \
--url https://api.occulights.com/api/v1/rooms/import \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "rows": [ { "floorNo": 1, "lightMac": "example", "location": "example", "name": "example", "sensorMac": "example" } ] }'

Creates many rooms at once from pre-parsed CSV rows, optionally claiming a sensor already in inventory by MAC address into each. Each row succeeds or fails independently — one bad row doesn’t abort the rest. The mandatory room quota is checked once upfront against the whole batch, so an import can’t partially succeed past it.

Rows to import

Media typeapplication/json
object
rows
Array<object>
object
floorNo
integer
lightMac
string
location
string
name
string
sensorMac
string

Example generated

{
"rows": [
{
"floorNo": 1,
"lightMac": "example",
"location": "example",
"name": "example",
"sensorMac": "example"
}
]
}

OK

Media typeapplication/json
object
results
Array<object>
object
error
string
roomId
string
row
integer

Example generated

{
"results": [
{
"error": "example",
"roomId": "example",
"row": 1
}
]
}

Bad Request

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Unauthorized

Media typeapplication/json
string

Example generated

example

Conflict

Media typeapplication/json
object
message
string

Example generated

{
"message": "example"
}

Internal Server Error

Media typeapplication/json