Skip to Content
Hookboard

Events

Collect button presses by polling, for code that can't receive HTTP calls.

An event action stores an event on Hookboard, and your code fetches it with GET https://app.hookboard.dev/api/v1/events. It's the way to go when the sender is a script on a laptop, a job behind a firewall, or an agent with no public address.

1. Put an event action on a card

{
  "id": "backup-control",
  "target": "board",
  "title": "Backups",
  "ui": {
    "type": "button",
    "label": "Run backup now",
    "onPress": {
      "type": "event",
      "name": "run-backup",
      "payload": { "target": "db" },
      "onSuccess": { "type": "toast", "message": "Queued" }
    }
  }
}

2. Poll for events

curl "https://app.hookboard.dev/api/v1/events?cursor=0&wait=25" \
  -H "Authorization: Bearer $HOOKBOARD_KEY"
ParameterTypeWhat it is
cursorinteger, default 0Return events with an id greater than this. Pass the cursor from your last reply.
waitnumber from 0 to 50, default 0Seconds to hold the request open when there's nothing new. The call returns as soon as an event arrives.

The reply:

{
  "events": [
    {
      "id": 17,
      "name": "run-backup",
      "payload": { "target": "db" },
      "card": {
        "id": "kq3Zc0mB1xY8aQ2d",
        "externalId": "backup-control"
      },
      "createdAt": "2026-11-28T09:12:00.000Z"
    }
  ],
  "cursor": 17
}

Events come oldest first, at most 100 per call. An app only sees events from its own cards.

3. Loop

Call again with the returned cursor. With wait, this becomes a long poll: one request stays open most of the time, and you hear about a press within moments.

let cursor = 0;
for (;;) {
  const res = await fetch(`https://app.hookboard.dev/api/v1/events?cursor=${cursor}&wait=50`, {
    headers: { Authorization: `Bearer ${process.env.HOOKBOARD_KEY}` },
  });
  const body = await res.json();
  for (const event of body.events) await handle(event);
  cursor = body.cursor;
}

Save the cursor somewhere that survives a restart, or you'll get old events again. Starting from 0 returns every event Hookboard still has.

Changing the card afterwards

A poll has no way to reply, so once you've acted, change the card with the normal API: for example, PATCH /cards/{id}/data to show a result, or DELETE /cards/{id} to remove it. For instant feedback, such as a toast or dismiss, use the action's onSuccess.

Events or webhooks

WebhookEvent
Your code needs a public addressYesNo
DelayNoneUntil your next poll; near zero with wait
Reply can change the cardYes, with effectsNo; use onSuccess and the API
SignedYesNot needed: you fetch with your key

On this page