{
  "openapi": "3.1.0",
  "info": {
    "title": "Emda Remote API",
    "version": "1.0.0",
    "description": "Control Emda kiosks over the local network. Turn it on in the kiosk's Settings → Remote API. Docs: https://emda.io/docs/api"
  },
  "servers": [
    {
      "url": "http://{kiosk}:{port}",
      "description": "The kiosk's address on the local network (Settings → Remote API shows it)",
      "variables": {
        "kiosk": {
          "default": "192.168.1.23"
        },
        "port": {
          "default": "8081"
        }
      }
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/api/v1/ping": {
      "get": {
        "summary": "Check the token",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "ping"
      }
    },
    "/api/v1/status": {
      "get": {
        "summary": "Device and kiosk state",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "deviceId",
                    "appVersion",
                    "platform",
                    "mode"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "deviceId": {
                      "type": "string"
                    },
                    "appVersion": {
                      "type": "string"
                    },
                    "platform": {
                      "type": "string"
                    },
                    "internalIps": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "mode": {
                      "enum": [
                        "kiosk",
                        "screensaver",
                        "off",
                        "shabbat",
                        "offline",
                        "pin",
                        "settings",
                        "setup"
                      ]
                    },
                    "screen": {
                      "enum": [
                        "on",
                        "off",
                        "shabbat"
                      ]
                    },
                    "url": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "locked": {
                      "type": "boolean"
                    },
                    "entitlement": {
                      "type": "string"
                    },
                    "idleSeconds": {
                      "type": "integer"
                    },
                    "uptimeSeconds": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "getStatus"
      }
    },
    "/api/v1/screenshot": {
      "get": {
        "summary": "PNG of what the screen shows",
        "responses": {
          "200": {
            "description": "PNG image",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "getScreenshot"
      }
    },
    "/api/v1/config": {
      "get": {
        "summary": "Current settings (without the PIN hash, token, client certificate key and password)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "config"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "config": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "getConfig"
      },
      "post": {
        "summary": "Replace the settings, like an import",
        "description": "Send a setup code or a settings object. The kiosk's PIN, API token and client certificate are kept unless the new settings include them.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "code"
                    ],
                    "properties": {
                      "code": {
                        "type": "string",
                        "description": "emda:1:… setup code, settings JSON or a settings file URL"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "config"
                    ],
                    "properties": {
                      "config": {
                        "type": "object"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "setConfig"
      }
    },
    "/api/v1/navigate": {
      "post": {
        "summary": "Open a page (admin authority: site rules don’t apply)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "navigate"
      }
    },
    "/api/v1/home": {
      "post": {
        "summary": "Go to the home page",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "goHome"
      }
    },
    "/api/v1/reload": {
      "post": {
        "summary": "Reload the page",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "reload"
      }
    },
    "/api/v1/back": {
      "post": {
        "summary": "Go back",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "goBack"
      }
    },
    "/api/v1/forward": {
      "post": {
        "summary": "Go forward",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "goForward"
      }
    },
    "/api/v1/clear": {
      "post": {
        "summary": "Clear browsing data (at least one true)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "history": {
                    "type": "boolean"
                  },
                  "cache": {
                    "type": "boolean"
                  },
                  "cookies": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "clearData"
      }
    },
    "/api/v1/screensaver": {
      "post": {
        "summary": "Show or hide the screensaver",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "active"
                ],
                "properties": {
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "setScreensaver"
      }
    },
    "/api/v1/screen": {
      "post": {
        "summary": "Turn the screen off (black) or back on",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "on"
                ],
                "properties": {
                  "on": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "setScreen"
      }
    },
    "/api/v1/print": {
      "post": {
        "summary": "Print the current page, or another page, without a dialog",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "print"
      }
    },
    "/api/v1/message": {
      "post": {
        "summary": "Show a message over the page",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 600,
                    "default": 10
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "showMessage"
      }
    },
    "/api/v1/restart": {
      "post": {
        "summary": "Restart the app (on iPad: start the kiosk fresh)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "restart"
      }
    },
    "/api/v1/receipt": {
      "post": {
        "summary": "Print an HTML receipt, or a receipt page by address",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "html": {
                    "type": "string",
                    "description": "Drawn at paper width: 58 mm = 384 px, 80 mm = 576 px"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "cut": {
                    "type": "boolean"
                  },
                  "openDrawer": {
                    "type": "boolean"
                  }
                },
                "description": "Exactly one of html and url."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "500": {
            "$ref": "#/components/responses/E500"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "printReceipt"
      }
    },
    "/api/v1/drawer": {
      "post": {
        "summary": "Open the cash drawer on the receipt printer",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "openDrawer"
      }
    },
    "/api/v1/license": {
      "post": {
        "summary": "Install a licence key, or remove it (key: null)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key"
                ],
                "properties": {
                  "key": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "EMDA1.… licence key"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "license": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "setLicense"
      }
    },
    "/api/v1/content": {
      "get": {
        "summary": "The local content at emda://local/",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "content"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "content": {
                      "type": "object",
                      "required": [
                        "installed",
                        "files",
                        "bytes"
                      ],
                      "properties": {
                        "installed": {
                          "type": "boolean"
                        },
                        "files": {
                          "type": "integer"
                        },
                        "bytes": {
                          "type": "integer"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "source": {
                          "enum": [
                            "device",
                            "url",
                            "api"
                          ]
                        },
                        "error": {
                          "enum": [
                            "no-index",
                            "too-big",
                            "too-many-files",
                            "invalid-zip",
                            "download",
                            "unsafe-path"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "getContent"
      },
      "put": {
        "summary": "Replace the local content with a .zip (up to 1 GB)",
        "requestBody": {
          "required": true,
          "content": {
            "application/zip": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "content"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "content": {
                      "type": "object",
                      "required": [
                        "installed",
                        "files",
                        "bytes"
                      ],
                      "properties": {
                        "installed": {
                          "type": "boolean"
                        },
                        "files": {
                          "type": "integer"
                        },
                        "bytes": {
                          "type": "integer"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "source": {
                          "enum": [
                            "device",
                            "url",
                            "api"
                          ]
                        },
                        "error": {
                          "enum": [
                            "no-index",
                            "too-big",
                            "too-many-files",
                            "invalid-zip",
                            "download",
                            "unsafe-path"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "uploadContent"
      },
      "delete": {
        "summary": "Remove the local content",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "content"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "content": {
                      "type": "object",
                      "required": [
                        "installed",
                        "files",
                        "bytes"
                      ],
                      "properties": {
                        "installed": {
                          "type": "boolean"
                        },
                        "files": {
                          "type": "integer"
                        },
                        "bytes": {
                          "type": "integer"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "source": {
                          "enum": [
                            "device",
                            "url",
                            "api"
                          ]
                        },
                        "error": {
                          "enum": [
                            "no-index",
                            "too-big",
                            "too-many-files",
                            "invalid-zip",
                            "download",
                            "unsafe-path"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "removeContent"
      }
    },
    "/api/v1/content/update": {
      "post": {
        "summary": "Download the .zip address from Settings now",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "updated"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "updated": {
                      "type": "boolean"
                    },
                    "content": {
                      "type": "object",
                      "required": [
                        "installed",
                        "files",
                        "bytes"
                      ],
                      "properties": {
                        "installed": {
                          "type": "boolean"
                        },
                        "files": {
                          "type": "integer"
                        },
                        "bytes": {
                          "type": "integer"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "source": {
                          "enum": [
                            "device",
                            "url",
                            "api"
                          ]
                        },
                        "error": {
                          "enum": [
                            "no-index",
                            "too-big",
                            "too-many-files",
                            "invalid-zip",
                            "download",
                            "unsafe-path"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "402": {
            "$ref": "#/components/responses/E402"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "updateContent"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "The access token from Settings → Remote API"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "E400": {
        "description": "Bad request body (invalid-json, invalid-url, invalid-receipt, …)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E401": {
        "description": "Missing or wrong token (unauthorized)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E402": {
        "description": "The feature is set up but this device's licence doesn't include it (not-licensed)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E403": {
        "description": "The caller's address isn't allowed (forbidden)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E409": {
        "description": "Someone has Settings open (admin-open), or the feature is off (printing-disabled, receipt-disabled, no-zip-url)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E413": {
        "description": "Body over 1.2 MB (too-large)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E422": {
        "description": "The .zip was refused; the old content stays (no-index, unsafe-path, invalid-zip, too-big, too-many-files)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E500": {
        "description": "The kiosk couldn’t do it (print-failed, internal, …)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E502": {
        "description": "The printer or download didn't answer (printer-unreachable, printer-failed, download)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E503": {
        "description": "The Remote API is off, or the screen can’t be captured right now",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
