Skip to content

Interactivity

Messages a Kit bot posts (Web API with a bot token, incoming webhooks, interaction and command responses) can contain interactive Blocks: buttons, static selects, overflow menus and section accessories. Declare where clicks go:

"interactivity": { "url": "https://kit.acme.example/ketvia/interactivity" }

Without an interactivity URL, interactive elements are removed from the messages you post (there is nobody to send a click to). Assistant result cards may carry Kit buttons, Ketvia actions and link buttons; approval buttons are Ketvia’s own and never Kit interactions.

  1. A member clicks. The client sends only which element (messageId, blockId, actionId, and for selects the chosen option). Values come from the stored Blocks, never from the client: a button’s value is read from the message, a select’s choice must be one of its stored options. Anything else is a 404.
  2. Ketvia checks that the member can see the message, then sends a signed block_action to your URL:
{
"type": "block_action",
"installationId": "0b4f…",
"workspaceId": "7c1e…",
"actionId": "approve",
"blockId": "act",
"value": "deploy-1234",
"user": { "id": "a7f0…", "locale": "en" },
"container": {
"kind": "message",
"conversationId": "d3a9…",
"messageId": "e1c2…",
"ephemeralId": null
},
"responseUrl": "https://api.ketvia.com/api/v1/responses/kres_…",
"triggerId": "trg_…",
"toolAccess": { "ticket_count": "channel", "ticket_search": "private" }
}

triggerId is reserved for modals (not available yet). The request is signed like events.

toolAccess (present when the Kit declares tools) says which of the Kit’s read tools the clicking member may use in this conversation, "channel" or "private", under the assistant’s tool-grant rule. Apply it before answering with data from a tool: see Tool access.

  1. You have 3 seconds to answer 2xx. If you do not, the member sees “ didn’t respond”. The body may be empty or a response:
{
"replaceOriginal": true,
"text": "Approved",
"blocks": [{ "type": "header", "text": "Approved" }]
}
Field Meaning
responseType ephemeral (default, only the clicking member sees it) or inChannel (a Kit bot message; needs messages:write).
text, blocks The message. text is required with blocks.
replaceOriginal Edit the message the Kit bot authored (or the ephemeral message that was clicked). Needs messages:write for messages.
deleteOriginal Delete it.

Asking for more than the Kit may do (a missing scope, a bot that was removed from the channel) is ignored in the immediate answer and refused with 403 on the responseUrl.

Answer later with POST https://api.ketvia.com/api/v1/responses/{token} and the same JSON. The token is the credential (no Authorization header): it is valid for 30 minutes and 5 uses, bound to one member and one conversation, stored only as a hash and redacted from logs. Unknown, malformed, expired and exhausted tokens all answer 404. A member who left the conversation can no longer receive answers.

import { respond } from '@ketvia/kit';
await respond(action.responseUrl, { text: 'Deploy finished', responseType: 'inChannel' });

POST /api/v1/messages/ephemeral (bot token, scope messages:write.ephemeral) sends a message that exactly one member of a channel the Kit bot was added to can see:

{ "conversationId": "d3a9…", "userId": "a7f0…", "text": "Only you can see this", "blocks": [] }

It is never stored as a normal message: other members, history, search, exports and events never include it. It is delivered to the recipient by a realtime hint plus a fetch, expires after 24 hours and can be dismissed. A recipient who is not a member of the conversation, or a channel the bot is not in, is a 404. Ephemeral messages may carry interactive Blocks; a click on one reaches your URL with container.kind: "ephemeral".

The card Ketvia shows for one of your tools is an interaction container too. Its body can carry three kinds of buttons:

Button What a click does Reaches your Kit
Kit action A signed block_action, as above (also select and overflow elements). Needs an interactivity URL in the manifest. Yes
Ketvia action Opens Ketvia’s own note, follow-up or reminder dialog filled from the card’s prefill. Nothing is saved until the person presses Save. No
Link (url) Opens the page after Ketvia’s “Leaving Ketvia” confirmation. The host must be in the manifest’s linkDomains. No

Controls are live only for the member who asked the assistant. Everybody else who can see the card (a channel answer) sees the same buttons disabled, with the reason in words. A revoked card, and one that shows an error or no data, is not live for anyone.

A Kit action click arrives as a block_action with container.kind: "card":

"container": {
"kind": "card",
"conversationId": "d3a9…",
"messageId": null,
"ephemeralId": null,
"cardId": "5c7b…",
"runId": "91ad…"
}

The client names only the card, block and action (and the chosen option of a select), so, as everywhere, the value is read from the stored card, never from the client; an element that is not in the stored card is a 404. The payload also carries toolAccess, so you can see which of your tools this member may use here before you answer with data. There is no original message to replace: answer with an ephemeral (the default, only the member sees it) or an inChannel response, immediately or through the responseUrl. A Ketvia action or a link never produces a block_action.

30 interactions per minute per member and Kit. Link buttons (url) never reach the Kit: they open after Ketvia’s “Leaving Ketvia” confirmation.