Event feeds
A feed is a stream of events your Kit can publish, for example “payment received”. The Kit declares its feeds in the manifest; the people of a workspace connect a feed to the rooms they want it in (one feed can go to several rooms, one room can have several feeds). The Kit publishes each event once; Ketvia posts the Kit bot’s message into every connected room. The Kit never learns which rooms exist.
Declaring feeds
Section titled “Declaring feeds”"bot": { "scopes": ["feeds:publish"] },"feeds": [ { "type": "payment.received", "title": { "en": "Payment received", "tr": "Ödeme alındı" }, "description": { "en": "A payment was recorded.", "tr": "Bir ödeme kaydedildi." }, "dataClasses": ["standard"] }]type: lowercase letters, digits,_and., starting with a letter, up to 40 characters; unique in the manifest.title(up to 60 characters) anddescription(up to 200) are what people see next to the toggle.dataClasses: what the feed’s messages may contain (aggregate,standard,personal,sensitive), shown next to the toggle. A publication may not claim more.- At most 20 feeds. A manifest with
feedsneeds thefeeds:publishbot scope, and the scope needs at least one feed.
Adding, removing or changing a feed is a new manifest version of the Kit: the workspace sees it when it moves to that version. No Ketvia change is ever needed for a new feed.
Publishing
Section titled “Publishing”POST /feeds/{type}/events with a bot token holding feeds:publish:
{ "text": "Payment received: 1,250.00 TRY by card", "idempotencyKey": "payment-8812", "dataClasses": ["standard"]}- One publication per event. Ketvia fans it out to the connected rooms, at most once per event and room.
textis required (it is the notification and search text);blocksare optional.idempotencyKeyis required: one event, one key (1 to 200 printable ASCII characters). Sending the same key with the same content again is a replay and posts nothing twice; the same key with different content answers409 idempotency_conflict. Because of the key, a publication is safe to retry after a network error or a5xx.dataClassessays what this event actually contains; each entry must be among the feed’s declared classes (400otherwise).
The answer is 202 with counts:
{ "accepted": true, "subscriptions": 2, "delivered": 2, "replayed": 0, "skipped": 0 }subscriptions: 0 means nobody connected the feed: it is not an error, nothing was posted. skipped counts rooms that
could not take the message (archived, Kit removed). An undeclared type answers 404. Publications are limited to 120
per minute per installation.
GET /feeds lists every declared type with its number of connected rooms (never the rooms), so a Kit can skip work
for feeds nobody connected.
With the SDK:
const { feeds } = await client.feeds.list();const result = await client.feeds.publish('payment.received', { text: 'Payment received', idempotencyKey: `payment-${payment.id}`, dataClasses: ['standard'],});feeds.publish is retried with the SDK’s backoff after network errors and 5xx, and after 429 it waits for
Retry-After; a 4xx is never retried.
What people see
Section titled “What people see”The messages are ordinary messages of the Kit bot in each room: they follow the room’s unread counts, retention and
purge. Every member of the room who has not muted it (or set it to no notifications) also gets an entry in their inbox and,
under their own notification settings (quiet hours, and the room’s “mentions only” policy blocks the push), a push
notification titled with the Kit and the room. The push shows your event’s text by default; it is the fixed “New event” when the member turned message
previews off or the workspace does not allow them, and Ketvia never puts your event text in a push otherwise. People with the kits.feeds_manage permission, or moderators of a channel, connect and
disconnect feeds from the room’s Events panel; connecting a feed adds the Kit bot to the room. A feed connection
follows workspace purge.