{
  "openapi": "3.1.0",
  "info": {
    "title": "LightSmart Developer API",
    "version": "1.1.0",
    "description": "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."
  },
  "servers": [
    {
      "url": "https://smart.c2345.com/api/v1"
    }
  ],
  "security": [
    {
      "DeveloperKey": []
    }
  ],
  "paths": {
    "/devices": {
      "get": {
        "operationId": "listDevices",
        "summary": "List your bound devices and API capabilities",
        "responses": {
          "200": {
            "description": "Bound devices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "devices"
                  ],
                  "properties": {
                    "devices": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Device"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Minimum suggested delay in seconds; capacity can remain full until cleanup."
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/devices/{deviceID}/actions": {
      "post": {
        "operationId": "sendContent",
        "summary": "Queue supported content for one of your devices",
        "parameters": [
          {
            "name": "deviceID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Action"
              },
              "examples": {
                "color": {
                  "value": {
                    "kind": "color",
                    "color": {
                      "red": 1,
                      "green": 0,
                      "blue": 0
                    },
                    "brightness": 0.35
                  }
                },
                "text": {
                  "value": {
                    "kind": "text",
                    "text": "Done",
                    "color": {
                      "red": 0,
                      "green": 1,
                      "blue": 0.8
                    },
                    "requestID": "my-event-001",
                    "ttlSeconds": 60
                  }
                },
                "effect": {
                  "value": {
                    "kind": "effect",
                    "effectID": "aurora",
                    "speed": 1
                  }
                },
                "pattern": {
                  "value": {
                    "kind": "pattern",
                    "patternID": "us-flag"
                  }
                },
                "pixels": {
                  "value": {
                    "kind": "pixels",
                    "columns": 20,
                    "rows": 20,
                    "pixels": [
                      16711680,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0,
                      0
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued, not yet executed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "200": {
            "description": "Idempotent replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Unavailable or conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Content too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unsupported content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Minimum suggested delay in seconds; capacity can remain full until cleanup."
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/devices/{deviceID}/images": {
      "post": {
        "operationId": "uploadImage",
        "summary": "Upload a PNG, JPEG or animated GIF to your compatible physical device",
        "description": "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. 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. 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.",
        "parameters": [
          {
            "name": "deviceID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$"
            }
          },
          {
            "name": "brightness",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0.01,
              "maximum": 1,
              "default": 0.35
            }
          },
          {
            "name": "speed",
            "in": "query",
            "schema": {
              "type": "number",
              "minimum": 0.125,
              "maximum": 3,
              "default": 1
            }
          },
          {
            "name": "ttlSeconds",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 10,
              "maximum": 300,
              "default": 60,
              "description": "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."
            }
          },
          {
            "name": "requestID",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$",
              "description": "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."
            }
          },
          {
            "name": "fit",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "contain",
                "cover"
              ],
              "default": "contain"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Raw bytes, not multipart/form-data or JSON. At most 262144 bytes. Do not compress the HTTP request body.",
          "content": {
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              },
              "x-maxBytes": 262144
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              },
              "x-maxBytes": 262144
            },
            "image/gif": {
              "schema": {
                "type": "string",
                "format": "binary"
              },
              "x-maxBytes": 262144
            }
          }
        },
        "responses": {
          "202": {
            "description": "Normalized and queued, not yet executed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "200": {
            "description": "Same account, target, file hash and options: idempotent replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Unavailable or conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Content too large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported media type",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unsupported content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Minimum suggested delay in seconds; capacity can remain full until cleanup."
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/actions/{actionID}": {
      "get": {
        "operationId": "getReceipt",
        "summary": "Read your action receipt",
        "parameters": [
          {
            "name": "actionID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current execution receipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "401": {
            "description": "Invalid key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate or capacity limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Minimum suggested delay in seconds; capacity can remain full until cleanup."
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "DeveloperKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Create in App → Settings → Open API. Never send in a URL."
      }
    },
    "schemas": {
      "RGB": {
        "type": "object",
        "required": [
          "red",
          "green",
          "blue"
        ],
        "additionalProperties": false,
        "properties": {
          "red": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "green": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "blue": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "ColorAction": {
        "type": "object",
        "required": [
          "kind",
          "color"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "const": "color"
          },
          "brightness": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1,
            "default": 0.35
          },
          "speed": {
            "type": "number",
            "minimum": 0.125,
            "maximum": 3,
            "default": 1
          },
          "ttlSeconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 300,
            "default": 60,
            "description": "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": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$",
            "description": "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."
          },
          "color": {
            "$ref": "#/components/schemas/RGB"
          }
        },
        "description": "color is required; red, green and blue are each 0–1."
      },
      "TextAction": {
        "type": "object",
        "required": [
          "kind",
          "text"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "const": "text"
          },
          "brightness": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1,
            "default": 0.35
          },
          "speed": {
            "type": "number",
            "minimum": 0.125,
            "maximum": 3,
            "default": 1
          },
          "ttlSeconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 300,
            "default": 60,
            "description": "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": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$",
            "description": "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."
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 240,
            "description": "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."
          },
          "color": {
            "$ref": "#/components/schemas/RGB"
          }
        },
        "description": "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."
      },
      "EffectAction": {
        "type": "object",
        "required": [
          "kind",
          "effectID"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "const": "effect"
          },
          "brightness": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1,
            "default": 0.35
          },
          "speed": {
            "type": "number",
            "minimum": 0.125,
            "maximum": 3,
            "default": 1
          },
          "ttlSeconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 300,
            "default": 60,
            "description": "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": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$",
            "description": "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."
          },
          "effectID": {
            "type": "string",
            "enum": [
              "aurora",
              "golden",
              "ocean",
              "fireflies",
              "snowfall",
              "sunset",
              "rainbow",
              "breathe",
              "chase",
              "wave",
              "meteor",
              "fireworks",
              "flame",
              "twinkle",
              "confetti",
              "ripple",
              "gradient",
              "candy",
              "christmas",
              "valentine",
              "halloween",
              "lanterns",
              "stars",
              "equalizer",
              "comet"
            ]
          }
        },
        "description": "effectID is required; choose from the list below."
      },
      "PatternAction": {
        "type": "object",
        "required": [
          "kind",
          "patternID"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "const": "pattern"
          },
          "brightness": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1,
            "default": 0.35
          },
          "speed": {
            "type": "number",
            "minimum": 0.125,
            "maximum": 3,
            "default": 1
          },
          "ttlSeconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 300,
            "default": 60,
            "description": "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": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$",
            "description": "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."
          },
          "patternID": {
            "type": "string",
            "enum": [
              "us-flag",
              "cn-flag",
              "tree",
              "snowflake",
              "gift",
              "pumpkin",
              "ghost",
              "lantern",
              "fireworks",
              "heart",
              "cake",
              "egg",
              "clover",
              "turkey",
              "moon",
              "dinosaur",
              "love-you",
              "santa-reindeer",
              "christmas-parade",
              "dance-sway",
              "dance-step"
            ]
          }
        },
        "description": "patternID is required; choose from the list below."
      },
      "PixelsAction": {
        "type": "object",
        "required": [
          "kind",
          "columns",
          "rows",
          "pixels"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "const": "pixels"
          },
          "brightness": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1,
            "default": 0.35
          },
          "speed": {
            "type": "number",
            "minimum": 0.125,
            "maximum": 3,
            "default": 1
          },
          "ttlSeconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 300,
            "default": 60,
            "description": "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": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$",
            "description": "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."
          },
          "columns": {
            "type": "integer",
            "minimum": 1,
            "maximum": 128
          },
          "rows": {
            "type": "integer",
            "minimum": 1,
            "maximum": 128
          },
          "pixels": {
            "type": "array",
            "minItems": 1,
            "maxItems": 4096,
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 16777215
            }
          }
        },
        "description": "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."
      },
      "BrightnessAction": {
        "type": "object",
        "required": [
          "kind",
          "brightness"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "const": "brightness"
          },
          "brightness": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1,
            "default": 0.35
          },
          "speed": {
            "type": "number",
            "minimum": 0.125,
            "maximum": 3,
            "default": 1
          },
          "ttlSeconds": {
            "type": "integer",
            "minimum": 10,
            "maximum": 300,
            "default": 60,
            "description": "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": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$",
            "description": "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."
          }
        },
        "description": "Virtual preview only; check api.kinds."
      },
      "Action": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ColorAction"
          },
          {
            "$ref": "#/components/schemas/TextAction"
          },
          {
            "$ref": "#/components/schemas/EffectAction"
          },
          {
            "$ref": "#/components/schemas/PatternAction"
          },
          {
            "$ref": "#/components/schemas/PixelsAction"
          },
          {
            "$ref": "#/components/schemas/BrightnessAction"
          }
        ],
        "discriminator": {
          "propertyName": "kind"
        }
      },
      "ImageUploadCapability": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "image/png",
                "image/jpeg",
                "image/gif"
              ]
            }
          },
          "maxBytes": {
            "type": "integer"
          },
          "maxDimension": {
            "type": "integer"
          },
          "gifMaxDimension": {
            "type": "integer"
          },
          "maxFrames": {
            "type": "integer"
          },
          "maxDurationMs": {
            "type": "integer"
          }
        }
      },
      "DeviceAPI": {
        "type": "object",
        "required": [
          "kinds",
          "maxTTLSeconds",
          "transport"
        ],
        "properties": {
          "kinds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "color",
                "text",
                "effect",
                "pattern",
                "pixels",
                "brightness"
              ]
            }
          },
          "maxTTLSeconds": {
            "type": "integer"
          },
          "transport": {
            "type": "string",
            "enum": [
              "device",
              "app"
            ]
          },
          "online": {
            "type": "boolean"
          },
          "busy": {
            "type": "boolean"
          },
          "imageUpload": {
            "$ref": "#/components/schemas/ImageUploadCapability"
          },
          "columns": {
            "type": [
              "integer",
              "null"
            ]
          },
          "rows": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "Device": {
        "type": "object",
        "required": [
          "id",
          "name",
          "kind",
          "model",
          "productID",
          "virtual",
          "capabilities",
          "api"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "productID": {
            "type": "string"
          },
          "virtual": {
            "type": "boolean"
          },
          "capabilities": {
            "type": [
              "object",
              "null"
            ],
            "description": "Product features; api.kinds determines accepted API content."
          },
          "api": {
            "$ref": "#/components/schemas/DeviceAPI"
          }
        }
      },
      "Receipt": {
        "type": "object",
        "required": [
          "actionID",
          "status"
        ],
        "properties": {
          "actionID": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$"
          },
          "deviceID": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "device_applied",
              "failed",
              "superseded",
              "expired",
              "cancelled",
              "unknown",
              "preview_applied",
              "device_unavailable"
            ]
          },
          "expiresAt": {
            "type": "number",
            "description": "Delivery deadline as Unix seconds."
          },
          "acceptedTTLSeconds": {
            "type": "integer",
            "description": "Present for newly queued physical actions."
          },
          "channels": {
            "type": "object",
            "properties": {
              "app": {
                "type": "string"
              },
              "light": {
                "type": "string"
              },
              "phonePush": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
