An open API for your applications
We use standard HTTP APIs to reduce reliance on device-specific frameworks. Use familiar languages and tools to connect devices to automations, notifications, and interactive displays.
Download OpenAPI ↓- 1
Create a key
App → Settings → Open API.
- 2
List devices
Read the ID and supported content.
- 3
Send content
Send, then check the device receipt.
Quick start
Store your App key in LIGHTSMART_KEY. Use an id from the device list as DEVICE_ID and the returned actionID as ACTION_ID.
1. List devices
curl --fail-with-body "https://smart.c2345.com/api/v1/devices" \
-H "Authorization: Bearer $LIGHTSMART_KEY"2. Send text
curl --fail-with-body "https://smart.c2345.com/api/v1/devices/$DEVICE_ID/actions" \
-H "Authorization: Bearer $LIGHTSMART_KEY" \
-H "Content-Type: application/json" \
--data '{"kind":"text","text":"Done","color":{"red":0,"green":1,"blue":0.8},"requestID":"my-event-001","ttlSeconds":60}'3. Check the receipt
curl --fail-with-body "https://smart.c2345.com/api/v1/actions/$ACTION_ID" \
-H "Authorization: Bearer $LIGHTSMART_KEY"202 means queued. device_applied means the controller confirmed execution.
API reference
Endpoints and capabilities
| HTTP | Path |
|---|---|
| GET | /devices |
| POST | /devices/{deviceID}/actions |
| POST | /devices/{deviceID}/images |
| GET | /actions/{actionID} |
GET /devices lists devices bound to the key’s account. Use id, not a product number, serial number or MAC. api.kinds lists accepted content; api.online means a heartbeat within 10 seconds; api.busy means an active camera or microphone session.
api.transport=device delivers to a controller; LS-CT01 currently uses 20×20 pixels. api.transport=app is a virtual preview processed only in the App. Always check each device’s returned capabilities.
api.busy also includes firmware updates, which block external content.
Content and examples
color
color is required; red, green and blue are each 0–1.
{
"kind": "color",
"color": {
"red": 1,
"green": 0,
"blue": 0
},
"brightness": 0.35
}text
text: 1–240 nonblank characters. Optional color defaults to white. Short text is centered; wide text scrolls left. Chinese, English and Spanish are supported. Use pixels for characters outside the BMP.
{
"kind": "text",
"text": "Done",
"color": {
"red": 0,
"green": 1,
"blue": 0.8
},
"requestID": "my-event-001",
"ttlSeconds": 60
}effect
effectID is required; choose from the list below.
{
"kind": "effect",
"effectID": "aurora",
"speed": 1
}pattern
patternID is required; choose from the list below.
{
"kind": "pattern",
"patternID": "us-flag"
}pixels
columns and rows must match the device: 20×20 for LS-CT01. Send 400 integers from 0 to 16777215 (0xRRGGBB), row by row from the top left. The Python example generates a complete body.
# Python 3
import json
print(json.dumps({'kind':'pixels','columns':20,'rows':20,
'pixels':[0xff0000]+[0]*399}))Use the image upload endpoint below for original PNG, JPEG and GIF files. pixels remains available for sampled images.
effectID
auroragoldenoceanfirefliessnowfallsunsetrainbowbreathechasewavemeteorfireworksflametwinkleconfettiripplegradientcandychristmasvalentinehalloweenlanternsstarsequalizercometpatternID
us-flagcn-flagtreesnowflakegiftpumpkinghostlanternfireworksheartcakeeggcloverturkeymoondinosaurlove-yousanta-reindeerchristmas-paradedance-swaydance-stepUpload PNG, JPEG or GIF
First check that api.imageUpload is not null. Send raw file bytes, not JSON or a form. The server centers and samples to the device grid; GIF animation is preserved.
curl --fail-with-body "https://smart.c2345.com/api/v1/devices/$DEVICE_ID/images?fit=contain&brightness=0.35&requestID=photo-001" \
-H "Authorization: Bearer $LIGHTSMART_KEY" \
-H "Content-Type: image/png" \
--data-binary @photo.png| Parameter | Meaning |
|---|---|
| Content-Type | PNG: image/png; JPEG: image/jpeg; GIF: image/gif. |
| fit | contain (default): show the whole image with black borders. cover: center-crop to fill. |
| brightness / speed | Use the common parameters. speed changes GIF timing; static images stay unchanged. |
| ttlSeconds / requestID | Use the common parameters. The same ID, target, file and options return the same receipt; changes return 409. |
File ≤256 KiB. PNG/JPEG: longest edge 2048px, at most 4,194,304 pixels; JPEG supports RGB/grayscale. GIF: longest edge 512px, up to 60 frames, at most 4,194,304 cumulative canvas pixels and 60 seconds after speed adjustment (looped playback). No APNG, SVG, remote URLs or audiovisual streams. Per account: 12 image requests/minute within the 60-content quota. Global: 120 images/minute, 4 simultaneous processors. Before adding external API pixels, cache capacity including existing App media is checked: 8 MiB/account, 64 MiB globally.
Python 3
# Python 3
import json, os, uuid
from pathlib import Path
from urllib.parse import urlencode, quote
from urllib.request import Request, urlopen
file = Path("animation.gif")
mime = {".png": "image/png", ".jpg": "image/jpeg",
".jpeg": "image/jpeg", ".gif": "image/gif"}[file.suffix.lower()]
options = urlencode({"fit": "contain", "brightness": 0.35,
"requestID": uuid.uuid4().hex})
device = quote(os.environ["DEVICE_ID"], safe="")
request = Request("https://smart.c2345.com/api/v1/devices/" + device
+ "/images?" + options, data=file.read_bytes(),
headers={"Authorization": "Bearer " + os.environ["LIGHTSMART_KEY"],
"Content-Type": mime}, method="POST")
with urlopen(request, timeout=20) as response:
receipt = json.load(response)
print(receipt) # Check /actions/{actionID} for execution.
Originals are converted in a private temporary directory and deleted when processing ends. Interrupted files older than 15 minutes are removed by a task running every 5 minutes. Only converted light pixels are cached. 202 means queued; query the same receipt endpoint to confirm execution.
Common parameters and limits
| Parameter | Meaning |
|---|---|
| brightness | 0.01–1; default 0.35. A content modifier subject to device power protection. Physical devices do not accept standalone brightness content. |
| speed | 0.125–3; default 1. Changes effect playback and wide-text scrolling; static content is unchanged. |
| ttlSeconds | Integer 10–300; default 60. Physical delivery is capped at api.maxTTLSeconds, currently 60 seconds; see acceptedTTLSeconds. This is a delivery deadline, not display duration or automatic power-off. |
| requestID | Optional, 1–100 characters; starts with a letter or digit, followed by letters, digits, . _ : -. The same account, ID and complete body return the same receipt. A changed target or body returns 409. |
JSON ≤32 KiB. Per account: 60 content requests and 180 authenticated requests per minute; 16 pending, 128 retained records and 512 KiB of bodies. Global body quota: 32 MiB. Exceeding a quota returns 429.
Offline devices, live capture, output faults and pending user controls reject delivery. New external content may replace older external queued content. App controls take priority. Physical receipts and bodies are removed 24 hours after the deadline; virtual previews are removed at expiry.
Receipt states
| status | Meaning |
|---|---|
| queued | Accepted; waiting for device |
| device_applied | Execution confirmed by device |
| failed | Device execution failed |
| superseded | Replaced by a later control |
| expired | Delivery deadline passed |
| cancelled | Cancelled by key revocation or live capture |
| unknown | Device restarted; outcome unconfirmed |
| preview_applied | Virtual App preview updated only |
| device_unavailable | Virtual preview device unavailable |
Physical receipts report app=not_requested and phonePush=not_enabled. This API does not send phone push notifications.
Errors and retries
| HTTP | Meaning |
|---|---|
| 400 | Invalid JSON, type or parameter. Correct the request. |
| 401 | Missing, invalid or revoked key. |
| 403 | An App owner-only operation was requested. |
| 404 | Device or receipt missing, or owned by another account. |
| 409 | Offline, busy, control conflict or requestID conflict. Check state before retrying a new event. |
| 413 | Request or rendered content is too large. |
| 415 | Use application/json for content, or the matching image/png, image/jpeg or image/gif for uploads. |
| 422 | Unsupported content, grid, characters or malformed image. Check the device API capabilities. |
| 429 | Rate or capacity limit. Back off; retained records must expire to free capacity. |
| 500 / 503 | Temporary service failure. Use exponential backoff with the same requestID. |
{"error":"Device is offline"}202 is not an execution receipt. Poll GET /actions/{actionID} starting at 1-second intervals with backoff, then stop at a final state. 404 can also mean the receipt has been removed.
Keys and authorization
Sign in or bind an email in the App first. External tools use only a developer key, never email codes or owner credentials. Signing in on another phone does not reset an existing key.
A key can list your devices, send content and read your receipts. It cannot provision Wi-Fi, unbind devices, start a phone camera or microphone, or delete an account. Send it only in the Authorization header, never a URL.
Reset or revoke a key in the App. Reset immediately invalidates the old key. Revoke also cancels queued external content and keeps device bindings. Content already fetched or executed cannot be recalled. Account deletion is separate.
Only allowlisted fields and formats are accepted. Duplicate JSON keys or image options, excessive nesting, nonfinite numbers, compressed request bodies and oversized images are rejected. Decoding runs in a separate process with memory and time limits; devices never parse originals. Invalid credentials are rate-limited by source without blocking valid keys from that source.