API Reference
Tickets API
Overview numbers and CSV export for tickets.
Tickets are conversations created through a form, email or the API, so they share the conversation model. These endpoints use your API key.
import { KerAbieClient } from '@kerabie/sdk';
const kerabie = new KerAbieClient({ apiKey: process.env.KERABIE_API_KEY });Overview numbers
GET /v1/tickets/statsconst stats = await kerabie.tickets.getStats();{
"open": 4,
"unassigned": 2,
"breachingSla": 1,
"avgResolutionMinutes": 192,
"resolutionDeltaPct": -18
}| Field | Meaning |
|---|---|
open | Tickets that are new or active. |
unassigned | Open tickets nobody owns. |
breachingSla | Open tickets past their SLA due time. |
avgResolutionMinutes | Average time from creation to resolution for tickets resolved or closed in the last 7 days. null when none were. |
resolutionDeltaPct | % change versus the 7 days before. Negative is faster. null when there is nothing to compare against. |
Results are cached for up to a minute and refresh immediately when a ticket's status, priority or assignee changes.
Export to CSV
GET /v1/tickets/exportconst { filename, csv, count, truncated } = await kerabie.tickets.export({ status: 'ACTIVE' });| Query param | Description |
|---|---|
status | WAITING, ACTIVE, RESOLVED or CLOSED. |
priority | LOW, NORMAL, HIGH or URGENT. |
search | Case-insensitive match on requester name or email, or subject. A ticket reference such as KB-2041 (or just 2041) matches by id. |
assignedTo | User id of the assigned agent. |
{
"filename": "tickets-2026-10-05.csv",
"csv": "Ticket,Subject,Status,Priority,Channel,Requester,Requester email,Assignee,Created,Last activity,SLA due,SLA breached
KB-2041,Refund not received,ACTIVE,URGENT,WHATSAPP,Chidi Okafor,chidi@palmex.com,Amara Osei,2026-10-05T09:10:00.000Z,2026-10-05T10:52:00.000Z,2026-10-05T11:00:00.000Z,yes
",
"count": 1,
"truncated": false
}- At most 5,000 tickets are returned. If more matched,
truncatedistrue; narrow the filters and export again. SLA breachedisyesornofor open tickets with an SLA, and empty otherwise.- Plan requirement: exporting needs a plan with data exports (Pro and above). Other plans receive
403 Forbidden. - Cells beginning with
=,+,-or@are prefixed with a single quote so spreadsheet apps show them as text rather than evaluating them as formulas.