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
| Address | What it is | When to use it |
|---|---|---|
https://hookboard.dev/llms.txt | Index of every page, with a one-line summary each | To decide which pages to fetch |
https://hookboard.dev/llms-full.txt | Every page in one Markdown file | To load the whole docs into context at once |
https://hookboard.dev/llms.mdx/docs/<page>.md | One page as plain Markdown | To fetch a single page; the path matches the page's address |
https://app.hookboard.dev/api/v1/openapi.json | OpenAPI 3.1 for every endpoint, with a JSON Schema for every component, action and effect | To validate a card before sending, or to generate a client |
https://app.hookboard.dev/api/v1/catalog | The component catalog as JSON; no key needed | To 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
- Send JSON only. A card can't contain HTML, CSS, scripts, or Markdown outside a
markdownelement. - Every element is an object with a
typefrom the catalog. Don't invent types or properties. Unknown ones are rejected. - Only container elements take
children. The catalog table says which. - Give every card an
idyou can repeat. Sending the sameidupdates the card; a newidcreates another one. - Put values that change in
dataand read them with{{data.name}}. Later, update them withPATCH /cards/{id}/dataand leave theuialone. - 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. - Set
"notify": trueonly when the person should be interrupted. It notifies everyone in the workspace who can see the feed. - A card that names no
feedorboardgoes to the workspace's first one, Main. To use another, send its short name asfeedorboard. AskGET /feedsandGET /boardswhich ones exist. Don't guess a name. - Enum properties such as
variant,toneandsizeaccept only the listed values. - An icon must be one of the listed names.
- An input writes to local state through
bind, which must start withstate., for example"bind": "state.comment". Read it elsewhere with{{state.comment}}.
Choosing components
| You want to show | Use |
|---|---|
| A sentence or paragraph | text, or markdown for formatted text |
| One number with a label | stat |
| A share of a whole | progress or meter |
| Labelled facts | keyValue |
| Rows and columns | table |
| A short list of items | list |
| A trend | sparkline, lineChart, areaChart or barChart |
| Things side by side | stack with "direction": "row", or grid |
| A yes or no question | two button elements in a row |
| A free-text answer | input or textarea, plus a button that sends {{state.…}} in its payload |
| A choice from a few options | segmented, 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.