Push content to a push widget
For: an AI the user has given one push widget to (Codex, Claude, a scheduled script…).
Before you start
The user adds a Push widget in Numable and connects it from the widget's Edit page. They get a widget id, an access key (starts with nbp_) and a ready-to-paste note for you. One key can only push to that one widget; the user can create a new key or delete the widget at any time, and deleting it stops every key.
What the widget looks like is entirely up to what you push. It shows on the user's dashboard and can be placed on the home screen. Only the latest push is kept; the next one replaces it.
Create push widgets on a dashboard
With a dashboard's edit key (see "Edit a user's existing dashboard") you can add push widgets to that dashboard directly — the user doesn't have to connect each one:
- Add an item
{"ref": "push.push-22"}(sizespush-11·push-21·push-22·push-42·push-44) with noparams. With the CLI you may also write"name": "Weather"— it stays on your machine and isn't sent. - On success the response's
pushlists, per itemkey, each new widget's id and push key (shown only once). The CLI saves them to~/.numable/push-widgets.json(mode 600 — treat it like a password file), so you can push by name:npx numable@latest board push board.json # creates them; keys saved locally npx numable@latest widget push weather.json --name Weather npx numable@latest widget list # local list (keys hidden) npx numable@latest board widgets # push widgets on this dashboard: key, size, position, last push npx numable@latest board widget-key <item key> --revoke-others # lost a key: get a new one, revoke the old - MCP:
board_putreturnspushtoo;push_listlists the dashboard's push widgets,push_tokenrotates a key,push_deletedeletes an inbox. - At most 8 new ones per write and 50 push widgets per account. If the write is rejected, none are created.
- Removing a push widget from the dashboard keeps its content (the dashboard can be rolled back); it's cleaned up after 90 days with no pushes and no reads. Use
push_deleteto delete it now. - You only see push widgets on this dashboard; whether the user also put one on their home screen is not visible to you.
Three ways in (same result)
- CLI
export NUMABLE_PUSH_BOX=<id> export NUMABLE_PUSH_TOKEN=<key> npx numable@latest widget spec # size code, canvas size and rules npx numable@latest widget templates # scenario templates, general layouts and the data they need npx numable@latest widget templates creator # one template's task, field meanings and an example npx numable@latest widget validate doc.json --preview out.png # local check + a preview image npx numable@latest widget push doc.json - Remote MCP:
https://api.numable.app/mcp, headerAuthorization: Bearer <key>. It is the same address as for editing dashboards; the key decides what you get — a push widget access key (nbp_…) only sees the push widget tools. Tools:widget_spec·widget_templates·widget_validate·widget_push. - HTTP:
GET https://inbox.numable.app/v1/w/<id>/specfor the size;POST https://inbox.numable.app/v1/w/<id>to push (?dry=1only validates). SendAuthorization: Bearer <key>.GET /v1/templatesneeds no key.
Document format
{
"version": 2,
"layout": 22,
"canvas": { "source": "tpl:change" },
"data": { "title": "NVDA", "price": "187.20", "change": "+2.14%" }
}
layoutmust match the widget's size code (checkspec). Tens digit = columns, units digit = rows; canvas points =90×cols − 22×98×rows − 38.canvas.sourceis one of:- Scenario template
"tpl:<name>"(design and fields are fixed; you read the data and fill it in):creatorcreator daily ·mailinbox digest ·parcelparcels ·priceprice watch ·devon my plate ·briefdaily brief. This is data behind a login, or data that has to be read and summarised first — a widget cannot fetch it by itself, which is exactly why you read it on a schedule and push it.numable widget templates <name>prints the scenario's task (where to read, how often), what each field means and an example; only*fields are required — leave out what you cannot read and that area is simply not drawn. Never make numbers up: if the whole source is unreachable, do not push and tell the user why; never bypass a login or a captcha. - General layout
"tpl:<name>":text·big-number·change·list·status·progress·countdown(recomputed every day) ·agenda·compare·ranking·dual-metric·sparkline·checkin-grid(the same layout library as the official widgets). Put the values listed bytemplatesintodata(*= required). Every template has five layouts picked by size: 1×1, one row (2×1), narrow two rows or more (2×2), wide two rows (4×2), and wide three rows or more (4×4). Large sizes are not a scaled-up 2×2 — they add a layer of content, drawn only when you fill the optional fields:at(update time, top right) ·stats(stat tiles, up to 3) ·series(trend bars) ·items(status checks) ·next(upcoming events) ·note(footer). See each template's slots intemplates. - Your own drawing
{"cells": [RCN nodes]}— syntax innumable docs rcn.
- Scenario template
title/sub(optional): widget name and subtitle for lists.events/params/canvas.depends/canvas.refreshare rejected: a push widget never fetches on its own, and the user sets the refresh pace in the app.
Rules for your own drawing
Pushes are checked with the same rules as tools; a broken document is rejected as a whole and never reaches the user.
- Read values with
${data.xxx}; make the first node a full-size background layer. - Colors come in light|dark pairs such as
#0E1116|#F3F4F6(a single color gets a warning; it is unreadable in dark mode). With alpha, write eight digits#AARRGGBB(alpha first); fully transparent is#00000000. The web-style#RRGGBBAAreads as an opaque color (#FFFFFF00= solid yellow) and is rejected. - Chinese and English: pushed content has no translation table, and switching the app language only redraws without fetching again, so branch the wording inside the drawing:
$[if::(startsWith::(findNotEmpty::(${@app.language},zh),zh),主要污染物,Main pollutant)]. Leading and trailing spaces inside method arguments are trimmed — put spaces outside the method. Text indataworks the same way: one field per language, then branch. Chinese-only text gets a warning and shows in Chinese in an English app too. - Sizes carry units (
12pt); anchors are onlyparent.x/y/w/hand<id>.x/y/w/h/r/b. - Taps go on a node's
events.onClick,https://ornumable://only. Taps pass through nodes without a tap to the node below, so a tap on the background layer makes the whole widget tappable. With no tap at all, tapping opens the Push widget home. - Image
urlis anhttps://address or a smalldata:imageinline; no request headers. - No data flows, action flows or nested
include; at most 200 nodes.
When a push is rejected
You get 422 with one reason code per problem in issues:
| Code | Meaning |
|---|---|
| D1 | Unknown field or bad format |
| D2 | layout doesn't match the widget size |
| D3 | data isn't an object or is over 8KB |
| D4 | Bad canvas structure |
| D5 | Unknown template (the reply lists the valid ones) |
| D6 | Whole document over 64KB |
| D7 | Template data missing |
| G7c, G28–G33 | The drawing would fail to render (same codes as the tool checks, see numable docs lint-codes) |
| P1–P9 | Push-only: display only, tap targets, anchors, images, limits, single colors, reversed eight-digit colors (P8), Chinese-only text (P9, warning) |
Pushing too often returns 429 (about once every 5 seconds). 401 = wrong id or key, or the key was deleted; 423 = the widget is frozen.