{
  "openapi": "3.1.0",
  "info": {
    "title": "Frame control API",
    "version": "2.0.0-preview",
    "description": "22 by 6 split-flap display. Saved state and rendered acknowledgments are separate. Live display requires the foreground app."
  },
  "servers": [
    {
      "url": "https://frame-board.cutie-bot.workers.dev"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/v1/boards/{id}/state": {
      "get": {
        "summary": "Read authoritative display",
        "description": "",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/State"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "patch": {
        "summary": "Atomically change display",
        "description": "Submit content for a single-step scene, or scene.steps for a sequence. New content/scene replaces playback; omitted scene retains it. Theme-only changes preserve scene identity. Steps hold for durationSeconds (default 20) after transition, and the final step stays visible. Scenes play locally in the foreground; reconnect resumes the current step with its full hold interval and no repeated intro sound.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/State"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Patch"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Quoted revision, e.g. \"5\"."
          }
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/v1/boards/{id}/status": {
      "get": {
        "summary": "Read delivery status",
        "description": "Per-device received/rendered revisions and timestamps are historical device reports, not proof of HDMI visibility. Socket presence can lag network failure detection.",
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/v1/boards/{id}/stream": {
      "get": {
        "summary": "Device WebSocket",
        "description": "Device token required. Server sends {type:snapshot,session,state}. Client acknowledges {type:received|rendered,session,revision}. rendered follows receipt and settling. String ping returns pong. Reconnect gets a complete snapshot.",
        "responses": {
          "101": {
            "description": "WebSocket upgraded"
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/boards/{id}/tokens": {
      "get": {
        "summary": "List token metadata; owner only",
        "description": "",
        "responses": {
          "200": {
            "description": "TokenList",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenList"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "post": {
        "summary": "Issue integration token; owner only",
        "description": "",
        "responses": {
          "201": {
            "description": "IssuedToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IssuedToken"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "label"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/v1/boards/{id}/tokens/{tokenId}": {
      "delete": {
        "summary": "Revoke credential and active connections; owner only",
        "description": "",
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Revoked"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tokenId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/v1/pairings": {
      "post": {
        "summary": "Start ten-minute pairing",
        "description": "",
        "responses": {
          "201": {
            "description": "Pairing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pairing"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "challenge": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "challenge"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/pairings/{code}/approve": {
      "post": {
        "summary": "Approve pairing; owner only",
        "description": "",
        "responses": {
          "200": {
            "description": "Approved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approved"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/pairings/{code}/exchange": {
      "post": {
        "summary": "Exchange approved device challenge",
        "description": "",
        "responses": {
          "201": {
            "description": "DeviceCredential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceCredential"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "202": {
            "description": "Pending",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pending"
                }
              }
            }
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "challenge": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                },
                "required": [
                  "challenge"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/boards/{id}/playback-settings": {
      "parameters": [],
      "get": {
        "summary": "Read owner-only synchronized playback rollout",
        "description": "Persisted setting, initially false. Affects subsequent content writes only; does not change revision or active scene. Device and integration credentials forbidden.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackSettings"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      },
      "patch": {
        "summary": "Change owner-only synchronized playback rollout",
        "description": "Persisted setting, initially false. Affects subsequent content writes only; does not change revision or active scene. Device and integration credentials forbidden.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaybackSettings"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Idempotency conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaybackSettings"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Quoted revision, e.g. \"5\"."
          }
        ],
        "security": [
          {
            "bearer": []
          },
          {
            "session": []
          }
        ]
      }
    },
    "/v1/auth/start": {
      "post": {
        "summary": "Request a browser-bound email sign-in code",
        "description": "Consumer preview. Available only when consumer rollout is enabled.",
        "security": [],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginChallenge"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginStart"
              }
            }
          }
        }
      }
    },
    "/v1/auth/verify": {
      "post": {
        "summary": "Consume the code and issue a revocable browser session",
        "description": "Consumer preview. Available only when consumer rollout is enabled.",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedIn"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginVerification"
              }
            }
          }
        }
      }
    },
    "/v1/auth/logout": {
      "post": {
        "summary": "Revoke the current session",
        "description": "Consumer preview. Available only when consumer rollout is enabled.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedOut"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/logout-all": {
      "post": {
        "summary": "Revoke all account sessions",
        "description": "Consumer preview. Available only when consumer rollout is enabled.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedOut"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "summary": "Read account and owned boards",
        "description": "Consumer preview. Available only when consumer rollout is enabled.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountOverview"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete account and queue durable board erasure",
        "description": "Requires a same-origin request, an authenticated session created within ten minutes, and confirmation DELETE. Revokes all sessions, removes account access and queues retryable board erasure. Offline displays may retain cached content until reconnect. Does not initiate a refund.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "202": {
            "description": "Account access removed; durable cleanup accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedAccount"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "confirmation"
                ],
                "properties": {
                  "confirmation": {
                    "const": "DELETE"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/boards": {
      "post": {
        "summary": "Provision a purchased household board",
        "description": "Consumer preview. Available only when consumer rollout is enabled.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedBoard"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedBoard"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBoard"
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9_-]{16,80}$"
            }
          }
        ]
      }
    },
    "/v1/device-pairings": {
      "post": {
        "summary": "Start unassigned consumer display pairing",
        "description": "Consumer preview; available only when consumer rollout is enabled. A display keeps its random challenge private. Exchanges may be retried until expiry and return the same credential; revocation cannot be undone by retrying. Eight active displays per board.",
        "responses": {
          "201": {
            "description": "Pairing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnassignedPairing"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Pairing already bound, revoked, or display quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "challenge": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": [
                  "challenge",
                  "label"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/device-pairings/{code}/approve": {
      "post": {
        "summary": "Bind a display to an account-owned board",
        "description": "Consumer preview; available only when consumer rollout is enabled. Approval binds an unassigned code immutably to a board belonging to the signed-in, entitled account. Requires a matching Origin header.",
        "responses": {
          "200": {
            "description": "Approved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Approved"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Pairing already bound, revoked, or display quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Purchase required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "boardId"
                ],
                "properties": {
                  "boardId": {
                    "type": "string",
                    "pattern": "^board_[a-f0-9]{32}$"
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "session": []
          }
        ]
      }
    },
    "/v1/device-pairings/{code}/exchange": {
      "post": {
        "summary": "Exchange approved device challenge",
        "description": "Consumer preview; available only when consumer rollout is enabled. A display keeps its random challenge private. Exchanges may be retried until expiry and return the same credential; revocation cannot be undone by retrying. Eight active displays per board.",
        "responses": {
          "201": {
            "description": "DeviceCredential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceCredential"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Pairing already bound, revoked, or display quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Revision conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 32 KiB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "202": {
            "description": "Pending",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pending"
                }
              }
            }
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "challenge": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  }
                },
                "required": [
                  "challenge"
                ]
              }
            }
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v1/billing/offer": {
      "get": {
        "summary": "Read current household offer",
        "description": "Consumer rollout only. Checkout and restore remain disabled until merchant configuration is verified. A return URL never grants access; verified current provider state controls entitlement.",
        "security": [],
        "responses": {
          "200": {
            "description": "PurchaseOffer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOffer"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Billing unavailable or reconciliation busy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/checkout": {
      "post": {
        "summary": "Open Stripe-hosted household checkout",
        "description": "Consumer rollout only. Checkout and restore remain disabled until merchant configuration is verified. A return URL never grants access; verified current provider state controls entitlement.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "CheckoutURL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutURL"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Billing unavailable or reconciliation busy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/restore": {
      "post": {
        "summary": "Recheck purchases owned by this account",
        "description": "Consumer rollout only. Checkout and restore remain disabled until merchant configuration is verified. A return URL never grants access; verified current provider state controls entitlement.",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "PurchaseRestore",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseRestore"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Billing unavailable or reconciliation busy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/stripe-webhook": {
      "post": {
        "summary": "Receive signed Stripe snapshot events",
        "description": "Signature verified over the exact raw request body with a five-minute timestamp tolerance. Subscribe to checkout.session.completed, checkout.session.async_payment_succeeded, checkout.session.async_payment_failed, checkout.session.expired, charge.refunded, and charge.dispute.* snapshot events. Match the configured Stripe API version and environment.",
        "security": [],
        "responses": {
          "200": {
            "description": "PaymentReceived",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentReceived"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Billing unavailable or reconciliation busy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Stripe-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-frame_session",
        "description": "Secure HttpOnly SameSite=Lax browser session. Mutations require exact same-origin Origin header."
      }
    },
    "schemas": {
      "Cell": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "blank"
              }
            },
            "required": [
              "type"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "glyph"
              },
              "value": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1
              }
            },
            "required": [
              "type",
              "value"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "color"
              },
              "value": {
                "type": "string",
                "pattern": "^#[0-9a-fA-F]{6}$"
              }
            },
            "required": [
              "type",
              "value"
            ]
          }
        ]
      },
      "Content": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "text"
              },
              "text": {
                "type": "string",
                "maxLength": 1024
              },
              "align": {
                "enum": [
                  "left",
                  "center",
                  "right"
                ],
                "default": "center"
              }
            },
            "required": [
              "type",
              "text"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "cells"
              },
              "cells": {
                "type": "array",
                "minItems": 6,
                "maxItems": 6,
                "items": {
                  "type": "array",
                  "minItems": 22,
                  "maxItems": 22,
                  "items": {
                    "$ref": "#/components/schemas/Cell"
                  }
                }
              }
            },
            "required": [
              "type",
              "cells"
            ]
          }
        ]
      },
      "State": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "content": {
            "$ref": "#/components/schemas/Content"
          },
          "theme": {
            "enum": [
              "classic",
              "modern",
              "green",
              "mustard"
            ]
          },
          "transition": {
            "enum": [
              "flip",
              "instant"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "cells": {
            "type": "array",
            "minItems": 6,
            "maxItems": 6,
            "items": {
              "type": "array",
              "minItems": 22,
              "maxItems": 22,
              "items": {
                "$ref": "#/components/schemas/Cell"
              }
            }
          },
          "scene": {
            "$ref": "#/components/schemas/Scene"
          }
        },
        "required": [
          "content",
          "theme",
          "transition",
          "revision",
          "updatedAt",
          "cells"
        ]
      },
      "Patch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "content": {
            "$ref": "#/components/schemas/Content"
          },
          "theme": {
            "enum": [
              "classic",
              "modern",
              "green",
              "mustard",
              "studio"
            ],
            "description": "studio is a legacy input alias for mustard; canonical responses use mustard."
          },
          "transition": {
            "enum": [
              "flip",
              "instant"
            ]
          },
          "scene": {
            "$ref": "#/components/schemas/SceneInput"
          }
        },
        "minProperties": 1,
        "not": {
          "required": [
            "content",
            "scene"
          ]
        }
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "DeviceStatus": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "received": {
            "type": "integer",
            "minimum": -1
          },
          "rendered": {
            "type": "integer",
            "minimum": -1
          },
          "receivedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "renderedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastSeenAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "connected": {
            "type": "boolean"
          },
          "playback": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Playback"
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "capabilities": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Capabilities"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "received",
          "rendered",
          "receivedAt",
          "renderedAt",
          "lastSeenAt",
          "connected"
        ]
      },
      "Status": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "desiredRevision": {
            "type": "integer",
            "minimum": 0
          },
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeviceStatus"
            }
          }
        },
        "required": [
          "desiredRevision",
          "devices"
        ]
      },
      "Token": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "integration",
              "device"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "revoked": {
            "enum": [
              0,
              1
            ]
          }
        },
        "required": [
          "id",
          "label",
          "kind",
          "createdAt",
          "revoked"
        ]
      },
      "IssuedToken": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "integration",
              "device"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "kind",
          "createdAt",
          "token"
        ]
      },
      "DeviceCredential": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "integration",
              "device"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "token": {
            "type": "string"
          },
          "boardId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "kind",
          "createdAt",
          "token",
          "boardId"
        ]
      },
      "Pairing": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[A-F0-9]{8}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "boardId": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "expiresAt",
          "boardId"
        ]
      },
      "TokenList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "tokens": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Token"
            }
          }
        },
        "required": [
          "tokens"
        ]
      },
      "Approved": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "approved": {
            "const": true
          }
        },
        "required": [
          "approved"
        ]
      },
      "Revoked": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "revoked": {
            "const": true
          }
        },
        "required": [
          "revoked"
        ]
      },
      "Pending": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "const": "pending"
          }
        },
        "required": [
          "status"
        ]
      },
      "Snapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "const": "snapshot"
          },
          "session": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/State"
          }
        },
        "required": [
          "type",
          "session",
          "state"
        ]
      },
      "Acknowledgment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "enum": [
              "received",
              "rendered"
            ]
          },
          "session": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "type",
          "session",
          "revision"
        ]
      },
      "SceneStepInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "$ref": "#/components/schemas/Content"
          },
          "durationSeconds": {
            "type": "number",
            "minimum": 1,
            "maximum": 3600,
            "default": 20,
            "description": "Seconds held after the transition settles."
          },
          "transition": {
            "enum": [
              "flip",
              "instant"
            ]
          },
          "effect": {
            "enum": [
              "none",
              "swipe",
              "wave",
              "ripple"
            ],
            "default": "none",
            "description": "Optional tile interstitial, replacing transition for this step. Reduce Motion skips it. Hold time begins after it settles."
          }
        }
      },
      "SceneInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "steps"
        ],
        "properties": {
          "steps": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/SceneStepInput"
            }
          }
        }
      },
      "SceneStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content",
          "cells",
          "durationSeconds",
          "transition"
        ],
        "properties": {
          "content": {
            "$ref": "#/components/schemas/Content"
          },
          "durationSeconds": {
            "type": "number",
            "minimum": 1,
            "maximum": 3600,
            "default": 20,
            "description": "Seconds held after the transition settles."
          },
          "transition": {
            "enum": [
              "flip",
              "instant"
            ]
          },
          "cells": {
            "type": "array",
            "minItems": 6,
            "maxItems": 6,
            "items": {
              "type": "array",
              "minItems": 22,
              "maxItems": 22,
              "items": {
                "$ref": "#/components/schemas/Cell"
              }
            }
          },
          "effect": {
            "enum": [
              "none",
              "swipe",
              "wave",
              "ripple"
            ],
            "default": "none",
            "description": "Optional tile interstitial, replacing transition for this step. Reduce Motion skips it. Hold time begins after it settles."
          }
        }
      },
      "Scene": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "steps"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "steps": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/SceneStep"
            }
          },
          "playback": {
            "$ref": "#/components/schemas/Timeline"
          }
        }
      },
      "Playback": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision",
          "sceneId",
          "stepIndex",
          "stepCount",
          "complete",
          "updatedAt"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "sceneId": {
            "type": "string"
          },
          "stepIndex": {
            "type": "integer",
            "minimum": 0,
            "maximum": 19
          },
          "stepCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "complete": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": "string"
          },
          "playbackId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "clockUncertaintyMs": {
            "type": "number",
            "minimum": 0,
            "maximum": 5000
          },
          "synchronizedAt": {
            "type": "number"
          },
          "animationStartedAt": {
            "type": "number"
          },
          "scheduledAt": {
            "type": "number"
          },
          "animationKind": {
            "enum": [
              "transition",
              "catch-up",
              "refresh",
              "instant"
            ]
          }
        }
      },
      "PlaybackAcknowledgment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "revision",
          "session",
          "sceneId",
          "stepIndex",
          "complete"
        ],
        "properties": {
          "type": {
            "const": "playback"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "session": {
            "type": "string"
          },
          "sceneId": {
            "type": "string"
          },
          "stepIndex": {
            "type": "integer",
            "minimum": 0,
            "maximum": 19
          },
          "complete": {
            "type": "boolean"
          },
          "playbackId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "clockUncertaintyMs": {
            "type": "number",
            "minimum": 0,
            "maximum": 5000
          },
          "synchronizedAt": {
            "type": "number"
          },
          "animationStartedAt": {
            "type": "number"
          },
          "scheduledAt": {
            "type": "number"
          },
          "animationKind": {
            "enum": [
              "transition",
              "catch-up",
              "refresh",
              "instant"
            ]
          }
        }
      },
      "PlaybackSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "synchronized"
        ],
        "properties": {
          "synchronized": {
            "type": "boolean"
          }
        }
      },
      "TimelineStep": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "startOffsetMs",
          "transitionMs",
          "holdMs"
        ],
        "properties": {
          "startOffsetMs": {
            "type": "number",
            "minimum": 0
          },
          "transitionMs": {
            "type": "number",
            "minimum": 0
          },
          "holdMs": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "Timeline": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "mode",
          "version",
          "id",
          "startsAt",
          "steps"
        ],
        "properties": {
          "mode": {
            "const": "synchronized"
          },
          "version": {
            "const": 1
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "steps": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/TimelineStep"
            }
          }
        }
      },
      "Capabilities": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "platform",
          "label",
          "timingVersion"
        ],
        "properties": {
          "platform": {
            "enum": [
              "tvOS",
              "iOS"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "timingVersion": {
            "const": 1
          }
        }
      },
      "Hello": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "session",
          "platform",
          "label",
          "timingVersion"
        ],
        "properties": {
          "type": {
            "const": "hello"
          },
          "session": {
            "type": "string"
          },
          "platform": {
            "enum": [
              "tvOS",
              "iOS"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "timingVersion": {
            "const": 1
          }
        }
      },
      "TimeRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "session",
          "nonce"
        ],
        "properties": {
          "type": {
            "const": "time"
          },
          "session": {
            "type": "string"
          },
          "nonce": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9-]{1,64}$"
          }
        }
      },
      "TimeResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "session",
          "nonce",
          "serverReceivedAt",
          "serverSentAt"
        ],
        "properties": {
          "type": {
            "const": "time"
          },
          "session": {
            "type": "string"
          },
          "nonce": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9-]{1,64}$"
          },
          "serverReceivedAt": {
            "type": "number"
          },
          "serverSentAt": {
            "type": "number"
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^account_[a-f0-9]{32}$"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "entitlement": {
            "enum": [
              "none",
              "active",
              "revoked"
            ]
          }
        },
        "required": [
          "id",
          "email",
          "entitlement"
        ],
        "additionalProperties": false
      },
      "CustomerBoard": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "provisioning",
              "active",
              "deleted"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "status"
        ],
        "additionalProperties": false
      },
      "AccountOverview": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "boards": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerBoard"
            }
          }
        },
        "required": [
          "account",
          "boards"
        ],
        "additionalProperties": false
      },
      "LoginStart": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "LoginChallenge": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string",
            "pattern": "^login_[a-f0-9]{32}$"
          },
          "expiresIn": {
            "const": 600
          }
        },
        "required": [
          "challengeId",
          "expiresIn"
        ],
        "additionalProperties": false
      },
      "LoginVerification": {
        "type": "object",
        "properties": {
          "challengeId": {
            "type": "string",
            "pattern": "^login_[a-f0-9]{32}$"
          },
          "code": {
            "type": "string",
            "pattern": "^[A-Z2-9]{8}$"
          }
        },
        "required": [
          "challengeId",
          "code"
        ],
        "additionalProperties": false
      },
      "SignedIn": {
        "type": "object",
        "properties": {
          "account": {
            "$ref": "#/components/schemas/Account"
          }
        },
        "required": [
          "account"
        ],
        "additionalProperties": false
      },
      "SignedOut": {
        "type": "object",
        "properties": {
          "signedOut": {
            "const": true
          }
        },
        "required": [
          "signedOut"
        ],
        "additionalProperties": false
      },
      "CreateBoard": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "CreatedBoard": {
        "type": "object",
        "properties": {
          "board": {
            "$ref": "#/components/schemas/CustomerBoard"
          }
        },
        "required": [
          "board"
        ],
        "additionalProperties": false
      },
      "UnassignedPairing": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[A-F0-9]{8}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "code",
          "expiresAt"
        ]
      },
      "DeletedAccount": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deleted"
        ],
        "properties": {
          "deleted": {
            "const": true
          }
        }
      },
      "PurchaseOffer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "amount",
          "currency",
          "purchaseType"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "amount": {
            "type": "integer",
            "minimum": 1
          },
          "currency": {
            "type": "string",
            "pattern": "^[a-z]{3}$"
          },
          "purchaseType": {
            "const": "one_time"
          }
        }
      },
      "CheckoutURL": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "pattern": "^https://checkout\\.stripe\\.com/"
          }
        }
      },
      "PurchaseRestore": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "entitlement"
        ],
        "properties": {
          "entitlement": {
            "enum": [
              "none",
              "active",
              "revoked"
            ]
          }
        }
      },
      "PaymentReceived": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "received"
        ],
        "properties": {
          "received": {
            "const": true
          }
        }
      }
    }
  }
}
