İçeriğe geç

Blocks reference

Bu içerik henüz dilinizde mevcut değil.

Blocks are a JSON array that Ketvia renders natively as a card on web and mobile. A message posted with POST /messages, PATCH /messages/{id} or an incoming webhook can carry blocks next to its text.

text is always required. It is what notifications, search and clients that cannot render a block show, so write it as a complete sentence and do not repeat it in the blocks.

Weekly deploy report

12 deploys to production this week. Details on the status page.

12
Deploys
91.7%
Success rate
€184.50
CI cost
Team
Platform
Week
2026-W40
ServiceDeploys
api7
web5

Generated by Acme CI

This is a simplified static rendering; the Ketvia clients render the same JSON with the app’s own styles and format numbers in the viewer’s language. A live previewer comes in a later phase.

blocks.json
[
{
"type": "header",
"text": "Weekly deploy report"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*12 deploys* to production this week. Details on the [status page](https://status.acme.example)."
}
},
{
"type": "metrics",
"items": [
{
"key": "deploys",
"label": "Deploys",
"value": 12,
"format": "integer",
"primary": true
},
{
"key": "success",
"label": "Success rate",
"value": 0.917,
"format": "percent",
"primary": false
},
{
"key": "cost",
"label": "CI cost",
"value": 184.5,
"format": "currency",
"currency": "EUR",
"primary": false
}
]
},
{
"type": "fields",
"fields": [
{
"label": "Team",
"value": "Platform"
},
{
"label": "Week",
"value": "2026-W40"
}
]
},
{
"type": "table",
"columns": [
{
"key": "service",
"label": "Service",
"align": "left"
},
{
"key": "deploys",
"label": "Deploys",
"align": "right"
}
],
"rows": [
{
"service": "api",
"deploys": "7"
},
{
"service": "web",
"deploys": "5"
}
]
},
{
"type": "list",
"items": [
{
"title": "Rollback on Tuesday",
"subtitle": "api 2.14.1, 4 minutes",
"url": "https://ci.acme.example/runs/881"
}
]
},
{
"type": "divider"
},
{
"type": "context",
"elements": [
{
"type": "plain",
"text": "Generated by Acme CI"
}
]
}
]
Limit Value
Blocks per message 50
Serialized size 16 KB
Text per field 3000 characters
actions blocks 5
Interactive elements in total 25
blockId (optional, on every block) ^[A-Za-z0-9_.-]{1,64}$

Where a block takes a text object, it is { "type": "plain" | "mrkdwn", "text": "…" }. Other strings are plain text.

mrkdwn is a safe Markdown subset: bold, italic, code, links (https only), lists, and the mentions <@userId> and <#conversationId>, which each viewer’s client resolves under that viewer’s own access. Nothing else is interpreted.

Type Fields Notes
header text (plain, 1–150) A title line.
section text (text object), optional accessory The accessory can be an image; buttons and selects are interactive (see below).
fields fields: 1–10 of { label (1–60), value (1–200) } Label/value pairs, plain text.
metrics items: 1–4 of { key, label (1–60), value: number, format?, currency?, primary: boolean } The only block with typed numbers. format: integer, decimal, currency, percent. currency (ISO 4217, for example EUR) is required for currency. Clients format the value in the viewer’s language. key matches ^[A-Za-z][A-Za-z0-9_]{0,39}$.
table columns: 1–6 of { key, label (1–60), align: left | center | right }; rows: ≤ 20 objects of strings (≤ 200) Read-only; every row key must be a declared column key.
list items: 1–20 of { title (1–150), subtitle? (1–300), url? (https) }
context elements: 1–10 text objects Small secondary text, such as a source line.
divider none A horizontal rule.
image fileId (uuid), alt (1–200, required) A Ketvia file only; remote image URLs are not allowed.
actions elements: 1–5 buttons, selects or overflow menus Interactive (see below).

An image block or image accessory references a Ketvia file by fileId, and in messages the file must be visible in the same conversation. Upload it first with POST /files (a user token in v1). Remote image URLs are not allowed, so a message can never load content from another server.

Blocks define interactive elements: button (actionId, text, value, style: default, primary or danger, optional url and confirm; a danger button requires confirm), static_select (up to 100 options) and overflow (up to 5 options). Messages posted through the Web API or an incoming webhook keep these elements only when the manifest declares interactivity; otherwise Ketvia removes actions blocks and button or select accessories. A button in a result card can also be a Ketvia action.

A result card is the card Ketvia shows for one of your tools. A card your tool renders (_meta.ketvia.card, see Tools and approvals) may contain a third kind of button next to Kit buttons and link buttons: a Ketvia action. It starts one of Ketvia’s own dialogs, filled in from the card, and nothing reaches your Kit.

{
"type": "button",
"actionId": "follow-up",
"text": "Set a follow-up",
"ketviaAction": "followup.create",
"prefill": {
"subject": "Ayşe Yılmaz",
"text": "Ask about the open balance",
"date": "2026-10-20",
"amount": 1250.5,
"currency": "TRY",
"record": { "type": "customer", "id": "4812", "label": "Ayşe Yılmaz" }
}
}

ketviaAction is one of note.create, followup.create and reminder.create. A Ketvia action button has no url, value or confirm, and prefill is only valid with it. Only a button can be a Ketvia action (not an overflow option or select). The dialog opens for the person who asked the assistant; they can change every field, and nothing is saved until they press Save.

ketviaAction Opens prefill fields used
note.create The note dialog subject (default: the label of record), text, record.
followup.create The promise dialog subject, text, amount (major units, for example 1250.50), currency (ISO 4217), date (YYYY-MM-DD) and record. A promise needs an amount and a date before it can be saved; it reminds on that day.
reminder.create The reminder dialog text (default: subject) and date. A reminder is for the person only and is never linked to a record: a record on it is invalid.

prefill limits: subject 1 to 120 characters, text up to 500, amount greater than 0, currency three capital letters. record is { type, id, label } with a type your manifest declares under records; saving the note stores a link from the note to that record, and the person sees it as a note about that record. A private card (an answer only its requester sees) always saves a private note.

Where Ketvia actions are allowed:

  • Only in assistant result cards. A message, an ephemeral message, a Web API post, an incoming webhook or an interaction response that contains one is rejected (the Web API answers 400 validation_error).
  • Link buttons in a card (url, https) must point at a host that is, or is a subdomain of, a domain in the manifest’s linkDomains. A card with any other link, with a record of an undeclared type, or with a Kit action while the manifest has no interactivity URL is invalid as a whole and Ketvia shows the template card from your manifest instead.
  • A card is limited like any Blocks document (50 blocks, 16 KB, 25 interactive elements), and the card as a whole to 64 KB.

The Web API and incoming webhooks validate Blocks and answer 400 validation_error with the path of the first problem. The schema is part of the OpenAPI document (BlockInput).