Cards
Every field of a card, how ids and updates work, and the difference between the feed and the board.
A card is the JSON body you send to POST https://app.hookboard.dev/api/v1/cards. Here's one that reports on a nightly backup:
{
"id": "backup-nightly",
"target": "feed",
"title": "Nightly backup",
"data": { "size": "4.2 GB", "took": 312 },
"ui": {
"type": "keyValue",
"items": [
{ "label": "Size", "value": "{{data.size}}" },
{ "label": "Took", "value": "{{round(data.took / 60)}} min" }
]
},
"notify": true,
"expiresAt": 86400
}Fields
| Field | Type | Required | What it is |
|---|---|---|---|
ui | element | yes | The tree of elements to draw. See Components. |
id | string, 1 to 200 characters | no | A stable id you choose. Sending it again updates the card in place. |
target | "feed" or "board" | no | Where the card goes. Default "feed". |
feed | string | no | Feed cards only: the short name of the feed to put it in. Left out, the card goes in the workspace's first feed, Main; when updating a card, it stays in the feed it's already in. |
board | string | no | Board cards only: the short name of the board to put it on. Left out, the card goes on the workspace's first board, Main; when updating a card, it stays on the board it's already on. |
title | string, up to 200 characters | no | Shown at the top of the card, next to your app's name and icon. |
data | object | no | Values the ui reads with {{data.…}}. See Data, state and bindings. |
state | object | no | Starting values for the card's local state. |
size | { "w": 1–12, "h": 0–12 } | no | Board cards only: starting size, w in columns of the board's 12-column grid and h in 96px rows. Leave h out, or send 0, to fit the content. |
notify | true, or { "title": "…", "body": "…" } | no | Sends a push notification. An object sets its text; otherwise the card's title and a summary of its text are used. |
expiresAt | ISO date string, or a number of seconds from now | no | The card removes itself at this time. |
files | object | no | { "name": null } removes a file from the card. Files are added by sending the card as multipart/form-data; see Files. |
Ids and updates
Every card gets an id from Hookboard, returned as id. If you also send your own id, it comes back as externalId, and you can use either one in paths such as /cards/{id}.
Your id only needs to be unique among the cards of one app (one API key).
Workspaces and boards
An API key belongs to one workspace. The people in that workspace see everything the key sends.
A workspace has one or more feeds and one or more boards. Each has a short name, such as main, alerts or ops. To send a card to a particular one, name it:
{
"id": "disk-full",
"feed": "alerts",
"title": "Disk almost full",
"notify": true,
"ui": { "type": "text", "value": "db-1 is at 94%." }
}{
"id": "queue-depth",
"target": "board",
"board": "ops",
"title": "Queue",
"data": { "depth": 12 },
"ui": {
"type": "stat",
"label": "Jobs waiting",
"value": "{{data.depth}}"
}
}GET https://app.hookboard.dev/api/v1/feeds and GET https://app.hookboard.dev/api/v1/boards list the feeds and boards your key can use. Name one that doesn't exist and you get a 404. Hookboard won't create it for you.
Everyone who can see a feed shares it. Each person has their own unread state, but dismissing a card removes it for everyone. A card's status in the API stays unread until someone reads it.
A feed is either open to everyone in the workspace or limited to chosen people (owners and admins always see it). GET /feeds reports which one as access. On a limited feed, cards and their notifications reach only the chosen people. Anyone can also mute a feed's notifications for themselves, so treat notify as a request that may be turned down.
| You want to | Do this |
|---|---|
| Create a card, or replace it if it exists | POST /cards with the same id |
| Change only some fields | PATCH /cards/{id} with those fields |
Change only values in data | PATCH /cards/{id}/data with an object to merge; null removes a key |
| Remove a card | DELETE /cards/{id} |
Posting a feed card again with the same id marks it unread and bumps it to the top. Posting a board card again only refreshes it. It stays wherever people put it.
Feed and board
| Feed | Board | |
|---|---|---|
target | "feed" (default) | "board" |
| Use it for | Things to see once and act on: alerts, approvals, results | Things to look at repeatedly: status, numbers, controls |
| People can | Read it, dismiss it | Move it, resize it, remove it |
| Kept for | Until dismissed; dismissed cards are deleted after 30 days. Only the newest are kept: 100 per feed on Free, 10,000 on Pro. | Until removed |
| Which one | A workspace can have several feeds; feed picks one | A workspace can have several boards; board picks one |
size | Ignored | Starting size. Once someone resizes it, their size wins. |
Notifications
"notify": true sends a push notification to every device where notifications are switched on. Nothing is sent if your app's notifications are turned off in Settings, and anyone who muted the feed doesn't get one either. Notifications go out when the card is posted, not when you patch its data.
Limits
| Limit | Value |
|---|---|
Size of ui as JSON | 256 KB |
Elements in one ui | 1500 |
| Nesting depth | 24 levels |
title | 200 characters |
A card over any of these is rejected. See Errors and limits.