Quickstart
This guide walks you through authenticating and making your first API request to ZPBX.
Prerequisites
- A ZPBX account with API access
- Your API key (created from the ZPBX console)
curlor any HTTP client
1. Get your API key
Log in to the ZPBX console and navigate to Management → API v1 Keys. Create a new key and copy the value — it starts with zpbx_.
Keep your API key secret. It is shown only once at creation and stored hashed — it cannot be recovered. Never expose it in client-side code or public repositories.
2. Make your first request
Check which accounts your key can access:
curl https://api.zpbx.es/v1/accounts \
-H "Authorization: Bearer zpbx_your_api_key_here"
Response:
{
"accounts": [
{
"id": "cmq...",
"name": "Premium Customer",
"type": "CLIENT",
"status": "ACTIVE",
"currency": "USD"
}
]
}
3. List recent calls (CDRs)
Retrieve the last 10 call detail records:
curl "https://api.zpbx.es/v1/calls?pageSize=10" \
-H "Authorization: Bearer zpbx_your_api_key_here"
4. Filter by date range
Find calls from a specific period:
curl "https://api.zpbx.es/v1/calls?startTime[gte]=2026-06-01T00:00:00Z&pageSize=20" \
-H "Authorization: Bearer zpbx_your_api_key_here"
5. Check your balance
curl https://api.zpbx.es/v1/balances \
-H "Authorization: Bearer zpbx_your_api_key_here"
Response:
{
"billingGroupId": "cmq...",
"balance": 150.75,
"currency": "USD",
"disabled": false
}
Next steps
- API Reference — full REST API overview (endpoints, scopes, pagination, errors)
- Authentication — understand API keys and scopes
- Webhooks — receive real-time event notifications
- CDR API — call detail record reference