Bridge API DocsBridge API Docs
Bridge API Docs
Api reference

Check SMS Balance

Retrieve your SMS page-credit balance for a service

Check SMS Balance

Returns SMS balance in page-credit units (integer) for the specified service.

Endpoint

POST https://api.bridgeagw.com/sms/balance

Request Headers

Authorization: Basic <base64_encoded_credentials>
Content-Type: application/json

Request Body

{
  "service_id": 1
}

Parameters

ParameterTypeRequiredDescription
service_idintegerYesYour TheBridge service identifier

Response

Success (response_code: 388)

{
  "response_code": "388",
  "response_message": "SMS balance retrieved successfully",
  "response_data": {
    "entity_service_id": 1,
    "sms_balance": 5000,
    "last_updated": "2026-05-30T17:15:30Z"
  }
}
FieldDescription
entity_service_idService identifier queried
sms_balanceCurrent SMS page-credit balance
last_updatedUTC timestamp of the last balance update

Error response

{
  "response_code": "<ERROR_CODE>",
  "response_message": "<ERROR_MESSAGE>"
}

Example Usage

curl -X POST "https://api.bridgeagw.com/sms/balance" \
  -H "Authorization: Basic <your_credentials>" \
  -H "Content-Type: application/json" \
  -d '{
    "service_id": 1
  }'
const response = await fetch('https://api.bridgeagw.com/sms/balance', {
  method: 'POST',
  headers: {
    'Authorization': 'Basic <your_credentials>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    service_id: 1
  })
});

const result = await response.json();
console.log(result);
import requests

url = "https://api.bridgeagw.com/sms/balance"
headers = {
    "Authorization": "Basic <your_credentials>",
    "Content-Type": "application/json"
}
data = {
    "service_id": 1
}

response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)

Sandbox testing

In sandbox mode, the SMS balance is mocked. A freshly initialised sandbox service returns a balance of 500 units. Sending SMS messages against the sandbox deducts from this in-memory balance — it does not reset between sessions. Check this endpoint before SMS testing to confirm you have sufficient units.

Notes