Call History & Recordings
List calls across every number and channel, and pull recordings
Call History & Recordings
There are two ways to read call history: a unified feed across everything, and a PSTN-only feed for a single number's voice line. Reach for the unified one first.
Which call surface do I use? There are three, split by job:
/v1/calls: the unified read surface. Lists, fetches, and pulls recordings for every call across both channels (PSTN + WhatsApp), user-scoped, with CRM enrichment (contactId/contactName). Use it for history and recordings./v1/voice/calls: the PSTN write surface (place, transfer, end, browser-dial, estimate), plus PSTN-scoped list/get/recording. Use it to act on standalone phone calls./v1/whatsapp/calls: the WhatsApp write surface (place a call, check permissions, estimate), plus account-scoped list/get/recording (requiresaccountId).
Rule of thumb: read from /v1/calls, write on the channel surface. The channel-specific reads still exist (they enforce account-scoped access control), but prefer /v1/calls for history unless you need that scoping.
Unified history (recommended)
listCalls (GET /v1/calls) returns every call across ALL of your numbers and both channels (standalone phone/PSTN and WhatsApp Calling), inbound and outbound, newest first. It needs no accountId and never requires fanning out one request per number. When the counterparty matches a CRM contact, contactId and contactName are set on the row.
const { data } = await zernio.calls.listCalls({ query: { limit: 50 } });
data.calls.forEach(c =>
console.log(c.channel, c.direction, c.status, c.durationSeconds, c.contactName)
);
// Cursor pagination: pass data.nextCursor as `before` for the next pageresponse = client.calls.list_calls(limit=50)
for c in response.calls:
print(c.channel, c.direction, c.status, c.duration_seconds, c.contact_name)
# Cursor pagination: pass response.next_cursor as `before` for the next pagecurl "https://zernio.com/api/v1/calls?limit=50" \
-H "Authorization: Bearer YOUR_API_KEY"Cursor pagination: pass the returned nextCursor as before to fetch the next page. nextCursor is null on the last page. Any row opens channel-agnostically via GET /v1/calls/{id} and GET /v1/calls/{id}/recording, with no branching on channel.
Fetch a call and its recording
# One call, any channel
curl "https://zernio.com/api/v1/calls/CALL_ID" \
-H "Authorization: Bearer YOUR_API_KEY"
# Its recording (if recording was enabled)
curl "https://zernio.com/api/v1/calls/CALL_ID/recording" \
-H "Authorization: Bearer YOUR_API_KEY"Recordings are only present when recording was enabled on the number at call time.
PSTN-only history
If you only want standalone phone calls for one number, listVoiceCalls (GET /v1/voice/calls) is the PSTN-scoped feed, with getVoiceCall (/{id}) and getVoiceCallRecording (/{id}/recording). Prefer the unified feed unless you specifically need to exclude WhatsApp calls.