Snapi SMS docs: API key balance

Check your API key's credit balance.

GET Checking API key credit balance

The endpint accepts a GET request where :apiKey is the API key that you'd like to check with the following request parameters:


You can authenticate in one of two ways.


Parameter Value Description Required?
disable_cache Boolean value, e.g: 1 or 0 By default, balances implement a 5 minute cache. This is to improve performance. If you'd like to fetch the latest balance, apply this parameter to the request and set it to 1. No


Here's a quick example of how to get the status of your API key's balance, you'd replace :messageId with your message ID, for example:

curl -X "GET" "|FGsT3x8EHxLKO3jmDxxjEDGV8Opy8UmQKaaIQxwr" \
              --header 'Authorization: Bearer 1|FGsT3x8EHxLKO3jmDxxjEDGV8Opy8UmQKaaIQxwr'
Check API key credit balance with Snapi SMS API example

Request response

The /api/v1/balance/:apiKey endpoint will respond with the following JSON data:

Key Value Description Always present?
success true/false Whether the balance was retrieved successfully. You should check the existence and value of this key in your application. No
message Your message status The message key will provide more details about the status of the request. Yes
credits_remaining 10 The number of credits remaining in your account. No
is_cached true/fakse If you're viewing a cached version of the balance this will be marked as true. If you opted to disable the cache, this will be marked as false. No