API Reference
Complete REST API for the ZPBX platform. All endpoints return JSON and require authentication via session cookie unless noted otherwise.
Base URL
https://api.zpbx.es/v1All paths below are relative to the base URL. Authentication uses Bearer API keys (Authorization: Bearer zpbx_...).
Voice & Calls
/calls/ingestIngest a CDR from FreeSWITCH (XML payload)
/callsList call detail records with filters and pagination
/calls?recordingOnly=trueList calls that have recordings
/recordings/:id/downloadDownload a call recording (WAV)
/live-callsList currently active calls (real-time)
Numbers (DIDs)
/numbersList all numbers with ownership and assignment info
/numbersAdd a new DID number
/numbers/:idUpdate a number (routing, whitelist, etc.)
/numbers/:idDelete a number and clean up child records
/numbers/:id/ratesGet the rate matching this number's prefix
/numbers/:id/assignAssign a number to a sub-reseller
Billing & Balance
/balancesGet current account balance (CGRateS)
/dashboardDashboard stats: calls, minutes, revenue, margin
/stats/overviewPlatform-wide stats overview
/stats/clientsStats per client/billing group
/stats/clients/detailedDetailed stats with date/reseller filters
Routing & Restrictions
/restrictionsList call restrictions (whitelist rules)
/restrictionsCreate a restriction with scope (trunk/reseller/bg)
/listsList ANI collections (caller number lists)
/listsCreate or update a caller number list
Authentication
/auth/loginAuthenticate with username + password → API key
/auth/meGet current session context (role, billing group)
/auth/keysCreate a new API key
/auth/keys/:idRevoke an API key