Skip to content

Spoiler Interface API

Spoiler Interface is an IoT platform built around a JSON HTTP API. Use it to register and manage devices (sensors, switches, GPS trackers, battery monitors, weather stations, workstations, network monitors and your own dynamic interfaces), push readings, read history, configure alarms and notifications, stream live data over MQTT, and manage your account.

  • Getting started


    Authentication modes, the response envelope, sign-up and login.

    Usage and responses · Login

  • Devices


    Add devices, push updates and read history for every device type.

    Sensor · Ping · Dynamic

  • Live data


    Device-linked MQTT topics, publishing and the WebSocket live stream.

    MQTT

  • Alarms & notifications


    Threshold alarms and email / WhatsApp / SMS alerts per device.

    Alarms · Notifications

  • Reports & sharing


    PDF reports, shareable report links and time-limited device sharing.

    Reports · Sharing

  • Endpoint index


    Every endpoint on one page, with method, path and auth.

    Table of Contents

API servers

Server Base URL
Spoiler Interface (hosted) https://spoilerinterface.com/interface
Local / self-hosted (behind nginx) http://localhost/interface

Every endpoint in this documentation is relative to the base URL, e.g. https://spoilerinterface.com/interface/test.

Quick start

  1. Sign up and verify your email address. Accounts must be verified before they can log in.
  2. Log in to get an api_key:

    POST /login
    {"username": "user@example.com", "password": "<password>"}
    
    {"api_key": "3b9e1f0c7a5d4e2f8a6b0c1d"}
    
  3. Call any endpoint with ?api_key=..., for example GET https://spoilerinterface.com/interface/sensor/list?api_key=3b9e1f0c7a5d4e2f8a6b0c1d.

  4. Add a device (e.g. POST /add/sensor). Your device then pushes readings with its own id and token. It doesn't need your api_key.

All date and time values are epoch seconds (UTC). Devices belong to the account that created them.