Credits and contacts
Read the balance
Section titled “Read the balance”The balance.read permission authorizes GET /api/sms/v2/balance/.
curl 'https://api.befiana.cloud/api/sms/v2/balance/' \ --header "Authorization: Bearer $BEFIANA_SMS_API_KEY"Scroll horizontally if needed. Keyboard: Tab, then the left and right arrow keys.
| Field | Purpose |
|---|---|
total | Total balance reported by the service. |
available | Credits available for new submissions. |
reserved | Credits already reserved. |
valid_until | Returned validity date, when present. |
Credit usage depends on segments, not only the number of recipients.
Scheduled messages and batches can reserve credits before processing. Do not add available and reserved to a locally stored business total to reconstruct the balance: retrieve it from the service.
Expect concurrent activity
Section titled “Expect concurrent activity”Reading the balance does not reserve credits. Other submissions can consume credits between your check and your request. Your integration must handle an insufficient-credit rejection even after a favorable balance check.
Purchases and credit management remain in BEFIANA Cloud. This public API does not advertise a purchase operation.
Create or update a contact
Section titled “Create or update a contact”The contacts.manage permission authorizes POST /api/sms/v2/contacts/.
The phone_number field identifies the contact within the organization. The operation returns 201 when creating a contact and 200 when updating an existing one.
curl --request POST 'https://api.befiana.cloud/api/sms/v2/contacts/' \ --header "Authorization: Bearer $BEFIANA_SMS_API_KEY" \ --header 'Content-Type: application/json' \ --data '{"phone_number":"+261340000000"}'See the accepted descriptive fields in the reference. Saving a contact does not send an SMS and is not evidence of consent to receive your communications.