Files
Send an image, video or audio file with a card and show it there.
A card can carry its own files. Send them in the same request as the card, and the card's ui refers to each one by name. A file lives exactly as long as its card holds on to it. Hookboard isn't a file host, so there's no way to keep a file without a card.
If the file is already on the web, skip all this and put its address straight into src.
Send a card with a file
Send the request as multipart/form-data instead of JSON. The card goes in a field named card, as JSON. Each file goes in a field of its own, and the field's name is how the ui reads it: a field named chart is {{files.chart}}.
curl https://app.hookboard.dev/api/v1/cards \
-H "Authorization: Bearer $HOOKBOARD_KEY" \
-F 'card={
"id": "daily-chart",
"title": "Today'"'"'s chart",
"ui": { "type": "image", "src": "{{files.chart}}", "alt": "Requests per hour" }
}' \
-F "[email protected]"A file's name starts with a letter and has only letters, digits and _, up to 40 characters. Without files, you send the card as plain JSON, same as everywhere else in these docs.
Change a card's files
Sending the card again, or changing it with PATCH /cards/{id}, keeps the files it has. In either request:
- A file sent under a name the card already has replaces it.
- A file under a new name is added.
"files": { "chart": null }in the card's JSON removes that file.
curl -X PATCH https://app.hookboard.dev/api/v1/cards/daily-chart \
-H "Authorization: Bearer $HOOKBOARD_KEY" \
-F 'card={}' \
-F "[email protected]"When the card goes, its files go with it, whether you removed it, someone dismissed it, it hit expiresAt, or the feed ran out of room.
Addresses
Reading a card back gives its files with addresses:
{
"id": "Vb2…",
"externalId": "daily-chart",
"files": {
"chart": {
"url": "https://app.hookboard.dev/files/Zr8…?expires=1795996800&signature=…",
"mime": "image/png",
"size": 48213
}
}
}The address is signed and works for about a day, then answers 410. Hookboard hands out a fresh one every time the card is shown, so a card on a board keeps working. Don't save the address. Read the card again when you need one. Once the file is replaced or its card removed, the address answers 404 right away.
Rules
| Rule | Value |
|---|---|
| Files sent in one request | 10 MB together |
| Files on one card | 10 |
| Total per workspace | 25 MB on Free, 10 GB on Pro, counting the files of every card. A request that would go over is refused with 403. |
| Shown inline | PNG, JPEG, GIF, WebP, AVIF; MP4 and WebM video; MP3, OGG, WAV, MP4 and WebM audio |
| Anything else | Kept, but served as a download and not shown inside a card |
| Storage | Encrypted before it's stored |