# smashgraph > Live dashboards with no signup. Get a secret write URL, POST a dashboard as JSON, then POST small updates that append points or set values. Anyone with the matching view URL sees it render and update live in a browser. All paths below are relative to the host that served this file. Dashboards are public to anyone with the view URL. Never push secrets, credentials or personal data. State lives in memory only: dashboards expire (default 2 hours after the last push) and a server restart wipes them, so a client should be ready to resend its full dashboard. ## Quick start 1. `GET /new` returns `{view_url, json_url, write_url, key, example}`. Nothing is stored yet. Keep `write_url` secret; give `view_url` to the human. 2. `POST` a full dashboard (JSON body, `Content-Type: application/json`) to `write_url`. This creates or replaces the dashboard. 3. `POST` update pushes to the same `write_url` to append points or set stat values. 4. `GET json_url` returns `{payload, updated_at, expires_at}` with the current state, or 404 `{"status": "waiting"}` if nothing has been pushed yet. It supports `ETag` / `If-None-Match`. Minimal full push: ```json {"v": 1, "charts": [{"id": "hello", "type": "stat", "title": "Hello", "value": 42}]} ``` ## Full push Has `charts`. Replaces everything, history included. - `v`: must be `1` - `title` (optional, ≤80 chars): shown small at the top of the page and in the tab - `palette` (optional): `pastel` (default), `primary`, `earth` or `riso` - `expires_in` (optional): seconds, 60–86400, default 7200, counted from the last push - `charts`: 1–20 charts Every chart has `id` (unique, 1–40 chars from `A-Z a-z 0-9 _ -`) and `type`, and optionally `grid: {x, y, w, h}` on a 12-column grid (x 0–11, w 1–12, x + w ≤ 12, no overlaps; give every chart a grid or none). Line, bar and stat charts also take `title` (≤60) and `unit` (≤10, e.g. `%`, `ms`). - `line` / `bar`: `labels` (x values, ≤1000), `series: [{name, data, color?, role?}]` (1–10 series, each `data` has exactly one value per label, `null` is a gap), `x_type` (`category` default, `number`, or `time` with Unix seconds or ISO 8601 strings), `max_points` (≤1000, oldest points dropped on append), `y_min`, `y_max`, `log_y`, `legend`, `x_label` (≤30, what x counts, e.g. `epoch`; shown under the axis and in tooltips), `gaps` (`connect` default draws straight through nulls; `break` draws a faint dashed bridge so missing data reads as missing) - Series `role` (optional): `band` on exactly two series of a line chart (low, then high) draws one shaded range with one legend entry, e.g. p10/p90 or min/max; `ref` draws a thin dashed line for a target or baseline. A band takes the first plain series' colour unless given one; a ref is muted unless given one - `stat`: `value` (number), `decimals` (0–6), `color` (a small colour key beside the title, to match a series elsewhere), `status` (`ok`, `warn` or `bad`: tints the tile and adds an OK / Warning / Problem badge; leave it out for a plain tile), `subtitle` (≤60, context under the value, e.g. `target 0.8`), `trend_of` (a sparkline beside the value from a line or bar chart in the same dashboard: its `id`, or `id:series name`; first series by default) - `heading`: `title` (required, ≤80), `text` (≤200). Large lettering naming a section. No data, and it can only be changed by a full push Colours are `red orange yellow green teal blue purple pink gray` (resolved by the palette) or `#rrggbb`. Numbers must be finite; NaN and Infinity are rejected, use `null` for gaps. Example: ```json { "v": 1, "title": "Training run", "charts": [ {"id": "epoch", "type": "stat", "title": "Epoch", "value": 3, "grid": {"x": 0, "y": 0, "w": 3, "h": 2}}, {"id": "gpu", "type": "stat", "title": "GPU", "value": 87.4, "unit": "%", "decimals": 0, "grid": {"x": 3, "y": 0, "w": 3, "h": 2}}, {"id": "loss", "type": "line", "title": "Loss", "log_y": true, "x_type": "time", "max_points": 500, "labels": [1732270000, 1732270060, 1732270120], "series": [{"name": "train", "data": [2.1, 1.4, 0.9], "color": "blue"}, {"name": "val", "data": [2.3, 1.7, null], "color": "orange"}], "grid": {"x": 0, "y": 2, "w": 12, "h": 4}} ] } ``` ## Update push Has `append` and/or `set`, never `charts`. All or nothing: if any part is invalid, nothing is applied. - `append`: line/bar chart id → one point or a list of points. A point is `{x, y}` where `y` maps series name → number or null; series left out get null. `x` may be omitted only on `time` charts (the server uses its receive time). - `set`: stat chart id → new value. ```json { "v": 1, "append": {"loss": [{"x": 1732270180, "y": {"train": 0.8, "val": 1.1}}, {"y": {"train": 0.7}}]}, "set": {"epoch": 4, "gpu": 91.2} } ``` ## Responses - 200: accepted, body has `view_url`, `json_url`, `updated_at`, `expires_at` - 400: malformed write key. Get one from `GET /new` - 409: update to a dashboard the server doesn't have (expired or restarted). Resend the full push, then continue updating - 413: body over 256 KB - 422: invalid payload. Errors look like `{"error": "invalid dashboard", "details": [{"path": "charts[1].series[0].data[5]", "message": "must be a number, got \"42%\""}]}`. Fix exactly what each detail says and retry - 429: more than one push per second per dashboard, or more than 60 new dashboards per hour per IP. Wait for `Retry-After`. If you produce data faster than once a second, batch points into one `append` - 503: the server is full ## Viewing The view URL polls every 2 seconds. Viewers can switch palette and light/dark mode; `?palette=riso` and `?theme=dark` on a view URL do the same without saving. ## Reference - [JSON Schema for both push shapes](/schema.json): generated from the server's own validation models - [README](https://github.com/wildfire111/smashgraph#readme): running your own server, configuration, examples