Getting started with the API
The Occulights API gives you the same data as the Occulights platform: rooms, Occu-Hub sensors, Occu-Lights, live presence and history, indoor climate and integrations. Use it to show room status in your own app, send occupancy data to Power BI or a workplace platform, or switch an Occu-Light from a system you already run.
Base URL
Section titled “Base URL”https://api.occulights.com/api/v1All requests use HTTPS. Times are in RFC 3339 format, for example 2026-10-15T09:00:00Z.
Get a token
Section titled “Get a token”- Sign in to the Occulights platform at app.occulights.com.
- Go to Tokens (app.occulights.com/admin/tokens) and click +. Give the token a name, the email of the person responsible for it, and the date it stops working (Valid Until).
- Copy the token and store it as a secret – in a password manager or your system’s secret store, never in source code.
Send the token in the Authorization header of every request:
Authorization: Bearer <your token>Your first request
Section titled “Your first request”List the rooms in your organisation:
curl https://api.occulights.com/api/v1/rooms/ \ -H "Authorization: Bearer $OCCULIGHTS_TOKEN"const res = await fetch('https://api.occulights.com/api/v1/rooms/', { headers: { Authorization: `Bearer ${process.env.OCCULIGHTS_TOKEN}` },});const rooms = await res.json();import os, httpx
rooms = httpx.get( "https://api.occulights.com/api/v1/rooms/", headers={"Authorization": f"Bearer {os.environ['OCCULIGHTS_TOKEN']}"}, http2=True,).json()Common tasks
Section titled “Common tasks”| I want to… | Endpoint |
|---|---|
| See if rooms are free or occupied right now | GET /presence/?id=… for several sensors, or GET /presence/{id} for one |
| Get presence history for reports | GET /presence/{id}/history with since and until |
| Get changes pushed to you as they happen | Real-time events over WebSocket |
| Catch up on every change since a point in time | GET /events/presence/{cursor} – keep the last cursor and ask for what came after it |
| Get temperature and humidity | GET /events/environment/{cursor} |
| Set an Occu-Light from your own system | PUT /presence/{id} with occupied or vacant |
| Mark a room as booked | PUT /presence/{id}/booked |
| Create many rooms at once | POST /rooms/import |
Responses and errors
Section titled “Responses and errors”Successful requests return JSON with status 200 (or 201 when something was created). Errors return a JSON body
with a message:
| Status | Meaning |
|---|---|
400 |
The request is not valid – check the parameters and body |
401 |
The token is missing, wrong or expired |
404 |
The room, sensor or Occu-Light does not exist in your organisation |
409 |
It already exists |
500 |
Something went wrong on our side – try again, then contact support |
Reference
Section titled “Reference”API referenceEvery endpoint, its parameters, request body and responses, with code examples.
Questions about the API? E-mail support@occulights.com.