<aside> <img src="/icons/light-bulb_red.svg" alt="/icons/light-bulb_red.svg" width="40px" /> Welcome to the Lumi Labs API Reference Guide! This comprehensive resource provides you with the tools and information you need to seamlessly integrate with our smart lighting ecosystem. This guide covers API endpoints, request/response formats, authentication mechanisms, error handling, and best practices to help you unlock the full potential of Lumi Labs.
</aside>
Getting Started
Obtain API Key:
Authentication:
Authorization
header of all requests using the following format:Authorization: Bearer YOUR_API_KEY
Base URL:
https://api.lumilabs.com/v1
API Endpoints
GET /lights
: Get a list of all registered lights.
GET /lights/{lightId}
: Get information about a specific light.
PUT /lights/{lightId}/state
: Update the state of a light (on/off, brightness, color, etc.).
JSON
{ "on": true, "brightness": 50, "color": { "hue": 240, "saturation": 80, "brightness": 100 } }
Use code with caution.
content_copy
POST /lights/{lightId}/effects
: Apply a lighting effect to a specific light (e.g., pulse, strobe).
GET /groups
: Get a list of all light groups.GET /groups/{groupId}
: Get information about a specific group.POST /groups
: Create a new group.PUT /groups/{groupId}
: Update a group.DELETE /groups/{groupId}
: Delete a group.PUT /groups/{groupId}/action
: Update the state of all lights in a group.GET /scenes
: Get a list of all created scenes.GET /scenes/{sceneId}
: Get information about a specific scene.POST /scenes
: Create a new scene.PUT /scenes/{sceneId}
: Update a scene.DELETE /scenes/{sceneId}
: Delete a scene.POST /scenes/{sceneId}/activate
: Activate a scene.GET /lights/{lightId}/energy
: Get energy usage statistics for a specific light.GET /groups/{groupId}/energy
: Get energy usage statistics for a group of lights.Error Handling
The Lumi Labs API uses standard HTTP status codes to indicate success or failure of a request. Here are some common error codes:
400 Bad Request
: The request is malformed or missing required parameters.401 Unauthorized
: The API key is invalid or missing.403 Forbidden
: You do not have permission to perform the requested action.404 Not Found
: The requested resource could not be found.500 Internal Server Error
: An unexpected error occurred on the server.Rate Limiting
To ensure the stability and availability of the API, we have implemented rate limiting. Each API key is allowed to make 100 requests per minute. If you exceed this limit, your requests will be temporarily throttled with a 429 Too Many Requests
status code.
Best Practices