Bulk-import rooms
POST
/rooms/import
const url = 'https://api.occulights.com/api/v1/rooms/import';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"rows":[{"floorNo":1,"lightMac":"example","location":"example","name":"example","sensorMac":"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/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.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”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" } ]}Responses
Section titled “Responses”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
exampleConflict
Media typeapplication/json
object
message
string
Example generated
{ "message": "example"}Internal Server Error
Media typeapplication/json