Skip to main content

Credit Check

Overview

Monitor your SMS account balance in real-time. Query the Credit Check API to retrieve your remaining account credit in euros before sending messages or bulk campaigns. This is essential for preventing failed shipments due to insufficient funds.

Use cases:

  • Check balance before initiating SMS campaigns
  • Implement automatic notifications when credit falls below a threshold
  • Validate account status in application dashboards
  • Prevent failed batch submissions due to low credit

Making a Request

Endpoint

GET https://secure.agiletelecom.com/services/sms/credit

Authentication

Choose one of three supported methods:

  • Basic Auth: Provide your username and password encoded in the Authorization header
  • API Key: Include your API key in the X-Api-Key header
  • OAuth 1.1: Use OAuth 1.1 authentication in the Authorization header

Code Examples

# Using API Key authentication
curl -X GET "https://secure.agiletelecom.com/services/sms/credit" \
-H "X-Api-Key: YOUR_API_KEY"

# Using Basic Auth authentication
curl -X GET "https://secure.agiletelecom.com/services/sms/credit" \
-H "Authorization: Basic $(echo -n 'username:password' | base64)"

Success Response (2XX)

When the request succeeds, the API returns your account balance in euros:

{
"credit": 10.324
}
FieldTypeDescription
creditdoubleAccount credit remaining (in euros)

Error Response (5XX)

When a server-side error occurs:

{
"status": "error",
"message": "Number check service unavailable",
"code": 9
}
FieldTypeDescription
statusstringAlways "error" for 5XX responses
messagestringHuman-readable description of the server-side error
codeintegerCustom error code indicating the type of problem

Error Codes

CodeDescription
1Wrong credentials
2Insufficient credit
8Server error
9Timeout
100Source IP is not allowed
Pro Tip

Implement credit monitoring in your application to automatically alert users when balance drops below a configurable threshold. This prevents unexpected service interruptions for high-volume SMS sending.

What's next?

  • SMPP Protocol – Persistent connection protocol for high-volume messaging
  • Inbound SMS – Receive SMS on your dedicated number
  • MNP Lookup – Query mobile network information