Cdr
Fetch past calls — read-only. The SDK does not cache or persist results itself; call it again whenever you need fresh data.
const cdr = await kasookoo.getCdr({
search: "Jane", // optional — free-text search
callerId: "user_123", // optional — restrict to calls placed BY this user
calleeId: "user_456", // optional — restrict to calls placed TO this user
skip: 0, // optional — pagination offset, defaults to 0
limit: 20, // optional — page size, a default applies if omitted; capped at 100 (larger values are clamped)
dateField: "created_at", // optional — which timestamp field results are filtered/sorted by
})
cdr.pagination.total // total matching records (across all pages)
cdr.items // this page's entries — see CdrEntry belowAll filters are optional — call getCdr() with no arguments for the first page of everything.
CdrEntry
CdrEntry| Field | Description |
|---|---|
id / call_id / room_name | Identifiers for the call |
direction | e.g. "outbound" / "inbound" |
status | e.g. "ended", "waiting" |
kind | Call type, e.g. "pstn". A separate value space from Call.kind ("webrtc" | "sip") on the Calls page — this is the backend's own CDR vocabulary, not the client-side Call object's. |
caller | { id, identity, name, email, phone_number, role, kind } — the side that placed the call. email, phone_number, role and kind may be null. |
callee | Same shape as caller, or null while the call has no answering side yet (e.g. still "waiting"). |
participants | Identities of everyone who joined the call |
created_at | ISO 8601 timestamp |
started_at | ISO 8601 timestamp, or null if the call hasn't started |
ended_at | ISO 8601 timestamp, or null if the call hasn't ended |
duration_seconds | Talk time, or null if the call hasn't ended |
end_reason | Present when the call ended abnormally (e.g. an orphaned session auto-cleaned up) |
recording_download_url | Present only when the call was recorded |
Downloading the full export
downloadCdr() fetches the export file (authenticated) and triggers a normal browser file save — nothing is returned to your code:
await kasookoo.downloadCdr({ maxRows: 1000 }) // maxRows is optionalThe filename is taken from the server's response when it provides one, otherwise cdr-export.csv is used. Call it directly from a click handler (browsers are more permissive about file saves triggered by a user gesture).
Updated 15 days ago
Did this page help you?
