Skip to Content
Hookboard

For agents

How a language model should read these docs and write cards that are accepted the first time.

This page is for language models that send cards, and for the people setting them up. Humans are welcome too. It's the same information as the rest of the docs, written as rules.

What to read

AddressWhat it isWhen to use it
https://hookboard.dev/llms.txtIndex of every page, with a one-line summary eachTo decide which pages to fetch
https://hookboard.dev/llms-full.txtEvery page in one Markdown fileTo load the whole docs into context at once
https://hookboard.dev/llms.mdx/docs/<page>.mdOne page as plain MarkdownTo fetch a single page; the path matches the page's address
https://app.hookboard.dev/api/v1/openapi.jsonOpenAPI 3.1 for every endpoint, with a JSON Schema for every component, action and effectTo validate a card before sending, or to generate a client
https://app.hookboard.dev/api/v1/catalogThe component catalog as JSON; no key neededTo list components and their properties in a program

Every page stands on its own. It defines the terms it uses and gives whole, valid examples, so you can fetch just the one you need.

Rules for writing a card

  1. Send JSON only. A card can't contain HTML, CSS, scripts, or Markdown outside a markdown element.
  2. Every element is an object with a type from the catalog. Don't invent types or properties. Unknown ones are rejected.
  3. Only container elements take children. The catalog table says which.
  4. Give every card an id you can repeat. Sending the same id updates the card; a new id creates another one.
  5. Put values that change in data and read them with {{data.name}}. Later, update them with PATCH /cards/{id}/data and leave the ui alone.
  6. Use "target": "feed" (the default) for something the person should see once and act on. Use "target": "board" for something they will look at repeatedly.
  7. Set "notify": true only when the person should be interrupted. It notifies everyone in the workspace who can see the feed.
  8. A card that names no feed or board goes to the workspace's first one, Main. To use another, send its short name as feed or board. Ask GET /feeds and GET /boards which ones exist. Don't guess a name.
  9. Enum properties such as variant, tone and size accept only the listed values.
  10. An icon must be one of the listed names.
  11. An input writes to local state through bind, which must start with state., for example "bind": "state.comment". Read it elsewhere with {{state.comment}}.

Choosing components

You want to showUse
A sentence or paragraphtext, or markdown for formatted text
One number with a labelstat
A share of a wholeprogress or meter
Labelled factskeyValue
Rows and columnstable
A short list of itemslist
A trendsparkline, lineChart, areaChart or barChart
Things side by sidestack with "direction": "row", or grid
A yes or no questiontwo button elements in a row
A free-text answerinput or textarea, plus a button that sends {{state.…}} in its payload
A choice from a few optionssegmented, radio or select

Asking a person a question and getting the answer

Send a card whose buttons carry a webhook action (if you can receive HTTP calls) or an event action (if you can't). Put whatever you need back in payload.

{
  "id": "deploy-4821",
  "title": "Deploy to production?",
  "notify": true,
  "data": { "commit": "a1b2c3d", "summary": "Fix checkout rounding" },
  "ui": {
    "type": "stack",
    "children": [
      { "type": "text", "value": "{{data.summary}}" },
      {
        "type": "textarea",
        "bind": "state.comment",
        "label": "Comment",
        "placeholder": "Optional"
      },
      {
        "type": "stack",
        "direction": "row",
        "justify": "end",
        "children": [
          {
            "type": "button",
            "label": "Reject",
            "variant": "outline",
            "onPress": {
              "type": "event",
              "name": "rejected",
              "payload": {
                "commit": "{{data.commit}}",
                "comment": "{{state.comment}}"
              },
              "onSuccess": "dismiss"
            }
          },
          {
            "type": "button",
            "label": "Approve",
            "variant": "primary",
            "onPress": {
              "type": "event",
              "name": "approved",
              "payload": {
                "commit": "{{data.commit}}",
                "comment": "{{state.comment}}"
              },
              "onSuccess": "dismiss"
            }
          }
        ]
      }
    ]
  }
}

Then wait for the answer by calling GET https://app.hookboard.dev/api/v1/events?cursor=0&wait=50 in a loop, passing the cursor from each reply into the next call. Each event has the name and payload of the button that was pressed. See Events.

When a card is rejected

A card that doesn't match the catalog gets a 422 and a details list. Each line names the place and the problem:

{
  "error": "The ui does not match the catalog",
  "details": [
    "ui.children[1].variant: must be one of primary, secondary, outline, ghost, danger",
    "ui.children[2]: unknown component type \"blink\""
  ]
}

Fix exactly the lines listed and send the card again. Nothing was stored. A 400 means the envelope is wrong (for example, target isn't feed or board), and a 401 means the key is missing or revoked. A 429 means you're sending too fast: wait the number of seconds in the Retry-After header before trying again, and don't retry in a tight loop. See Errors and limits.

What Hookboard doesn't do

Hookboard runs no model of its own and doesn't read or rewrite the cards you send. It checks them against the catalog, stores them, and shows them.

On this page