curl --request POST \
--url https://avraapi.com/api/v1/sms/balance \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SECRET: <api-key>' \
--data '{}'const options = {
method: 'POST',
headers: {
'X-API-KEY': '<api-key>',
'X-API-SECRET': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://avraapi.com/api/v1/sms/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://avraapi.com/api/v1/sms/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>",
"X-API-SECRET: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"request_id": "7a5b17fa-0716-45e1-b109-378322b8769f",
"data": {
"source": "quicksend_direct",
"balance_formatted": "473.52",
"provider_response": {
"balance": "473.52"
}
}
}Check SMS balance
Read the balance associated with the configured QuickSend SMS integration.
curl --request POST \
--url https://avraapi.com/api/v1/sms/balance \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-API-SECRET: <api-key>' \
--data '{}'const options = {
method: 'POST',
headers: {
'X-API-KEY': '<api-key>',
'X-API-SECRET': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({})
};
fetch('https://avraapi.com/api/v1/sms/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://avraapi.com/api/v1/sms/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>",
"X-API-SECRET: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"request_id": "7a5b17fa-0716-45e1-b109-378322b8769f",
"data": {
"source": "quicksend_direct",
"balance_formatted": "473.52",
"provider_response": {
"balance": "473.52"
}
}
}API endpoint
https://avraapi.com/api/v1/sms/balance
Request fields
This endpoint accepts an empty JSON object. AvraAPI resolves the configured SMS integration from your Project Client ID andX-ENV.
| Field | Required | Rules |
|---|---|---|
| None | No | Send {} when your HTTP client requires a JSON body. |
Result fields
| Field | Type | Notes |
|---|---|---|
source | string | apix_wallet for a Managed integration, or quicksend_direct for a Manual (BYOK) integration. |
balance_formatted | string | A human-readable balance value for the reported source. |
provider_response | object | Present only for Manual (BYOK) integrations. It contains the provider’s balance response. |
balance_formatted is the AvraAPI wallet balance in API credits. 1 USD equals 1,000,000 API credits. For a Manual (BYOK) integration, the balance is read from the connected QuickSend account and remains provider-formatted.
Request example
curl --request POST "https://avraapi.com/api/v1/sms/balance" \
--header "X-API-KEY: YOUR_PROJECT_CLIENT_ID" \
--header "X-API-SECRET: YOUR_PROJECT_CLIENT_SECRET" \
--header "X-ENV: development" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{}'
Response example — Manual (BYOK)
{
"success": true,
"request_id": "7a5b17fa-0716-45e1-b109-378322b8769f",
"data": {
"source": "quicksend_direct",
"balance_formatted": "473.52",
"provider_response": {
"balance": "473.52"
}
}
}
Response example — Managed
{
"success": true,
"request_id": "3251caf2-3d8a-4232-a1fb-b4cfc4846888",
"data": {
"source": "apix_wallet",
"balance_formatted": "285,417,005 credits"
}
}
Error codes
| HTTP | error.code | When it happens | What to do |
|---|---|---|---|
401 | unauthorized | Credentials are missing, invalid, inactive, or do not match the selected environment. | Check your backend secret configuration and X-ENV. |
422 | provider_selection_failed | No active QuickSend SMS integration can be selected for the project environment. | Configure or enable the QuickSend integration for the selected environment. |
422 | http_error | The active SMS integration is incomplete or its Manual (BYOK) credentials cannot be used. | Recheck the integration setup and credentials before retrying. |
429 | rate_limit_exceeded | The configured request limit was reached. | Respect Retry-After when present; do not retry in a tight loop. |
500 | internal_error | The balance check could not complete unexpectedly. | Retry only if your workflow permits it, retaining the request ID. |
503 | http_error | QuickSend could not be reached for a Manual (BYOK) balance check. | Retry later; a Managed balance does not call QuickSend. |
503 | project_paused | The project is paused. | Reactivate the project before retrying. |
request_id or X-APIX-Request-ID response header with your support record. It is the safest way for AvraAPI support to trace a request.Playground resources
The generated reference below lists this endpoint’s API standard details: request fields, authorizations, and response schema. The complete integration guide, request and response examples, and endpoint-specific error handling are above.Authorizations
Your Development project's Client ID. Enter your own value in the Documentation Playground.
Your Development project's Client Secret. Mintlify does not proxy these requests; the browser sends them directly to AvraAPI. Never enter a Production secret in the Documentation Playground.
Headers
Selects the Development credential environment. The Documentation Playground exposes Development values only; normal backend integrations may use their documented Production credentials outside this tool.
dev, development Requests a JSON response where the selected operation supports JSON.
"application/json"
Optional privacy override. Turn this on to request that AvraAPI suppress request-payload storage in observability logs for this request.
true
Body
The body is of type object.
Was this page helpful?
