Mon-Fri 10am - 6pm
Balance Check
Base URL for your account: https://cpaas.studio/api/v1
GET
POST
/api/v1/balance
Your current credit/plan balance. Unlike every other endpoint in this API, this one is not restricted to a specific module — it's available to any key, and shows exactly the scope(s) that key's own module covers.
Available to a key scoped to any module, not only Voice Broadcast.
No parameters.
Request example
curl "https://cpaas.studio/api/v1/balance" \
-H "X-API-KEY: cpk_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
<?php
$ch = curl_init('https://cpaas.studio/api/v1/balance');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-KEY: cpk_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Success response (data)
{
"balances": [
{
"scope": "voice.obd",
"label": "Outbound Dialer",
"type": "wallet",
"balance": 1234
}
]
}
Notes
- You only ever see balances for your key's own module. A key scoped to "all" sees every scope your account currently holds a balance or an active plan for.
- A wallet scope reports {scope, label, type: "wallet", balance}. A plan scope reports {scope, label, type: "plan", active, plan_name, plan_type, remaining, total, expires_at} — remaining/total are null for a validity plan.
- No parameters, and no errors specific to this endpoint beyond the standard auth-layer codes.
Need more context? See Getting started for authentication, the response envelope, and the full error-code reference.