Skip to content

Records and notes

A record is something in your product that people talk about in Ketvia, for example a customer or a ticket. The manifest declares the record types; a note a member saves from one of your result cards is linked to the record, and so is a note your Kit adds through the API. Members see both beside each other, your Kit’s notes marked as written by the Kit.

"bot": { "scopes": ["assistant-records:read", "assistant-records:write"] },
"records": [
{ "type": "ticket", "label": { "en": "Ticket", "tr": "Kayıt" } }
]
  • type: lowercase letters, digits and _, starting with a letter, up to 32 characters (no :); it becomes part of the link kit:<slug>:<type>.
  • label (up to 60 characters): the name of the type, used as the default subject of a note.

POST /installation/records/{type}/{id}/notes with a bot token holding assistant-records:write:

{
"conversationId": "5f0c…",
"text": "Customer asked for a call back on Monday.",
"subject": "Ticket 4812"
}
  • conversationId must be a channel your Kit bot was added to (404 otherwise). The note is shared with that channel and with nobody else.
  • {type} must be declared in the manifest version the workspace runs (404 otherwise); {id} is your own record id (at most 120 characters, no control characters).
  • text is 1 to 2000 characters and not blank (400). subject (up to 120 characters) is what the note is filed under; the default is the type’s label and the record id.
  • A Kit’s note is always a plain note: never private, never a charge, a payment or a promise. A member can see it only if they can see the channel; a Kit’s note can not be edited by anyone once added, and only workspace admins can delete it. Its text is never given to the assistant’s model.
  • Send an Idempotency-Key header to make retries safe: the first call answers 201, a repeat with the same key and the same content answers 200 with the same note, the same key with other content answers 409 idempotency_conflict. Without the header every call adds a note.
  • Ketvia records kit.record_note.created in the audit log (ids only, never the text).

GET /installation/records/{type}/{id}/notes with assistant-records:read returns the notes linked to that record, newest first, with the usual cursor and limit paging:

{
"notes": [
{ "id": "…", "conversationId": "…", "subject": "Ticket 4812", "text": "…", "createdAt": "…" }
],
"nextCursor": null
}

Only notes shared with channels your Kit bot was added to are returned, whoever wrote them (your Kit or a member). Private notes, notes of other channels and notes linked by another Kit do not exist for your Kit.

const { notes, nextCursor } = await client.records.notes.list('ticket', '4812');
const { note } = await client.records.notes.post(
'ticket',
'4812',
{ conversationId, text: 'Customer asked for a call back on Monday.' },
{ idempotencyKey: `callback-${eventId}` },
);

list retries like any read; post is retried only when you pass an idempotencyKey.