API GuidesSMS API
Content And Credits
Calculate SMS segments and prepare enough credits for each send.
Content Length
Every message must contain 1-918 characters.
The API counts JavaScript string characters and selects one of two segment calculations:
| Content detected by the service | One segment | Concatenated segment size |
|---|---|---|
| ASCII only | 160 characters | 153 characters |
| Contains any non-ASCII character | 70 characters | 67 characters |
Examples:
| Content | Length | Segments |
|---|---|---|
| ASCII message | 160 | 1 |
| ASCII message | 161 | 2 |
| Non-ASCII message | 70 | 1 |
| Non-ASCII message | 71 | 2 |
This is Notify Africa's current ASCII/non-ASCII calculation. It is not a complete GSM-7 extension-table calculation. Treat the debit returned by the API as authoritative.
Credit Debit
- Single send debits the message's calculated segment count.
- Batch send adds the segment count for every eligible recipient.
- Personalized bulk send calculates each recipient's content independently.
- Scheduled messages are debited when accepted for scheduling, not at dispatch time.
- Provider rejection does not change the debit reported by the send response.
For identical content:
credits required = recipients × segments per messageFor personalized content:
credits required = sum(each eligible recipient's message segments)Response Fields
Same-content batch returns:
messageCount: messages accepted by the operation.creditsDeducted: segments debited.remainingBalance: balance after debit.
Personalized bulk returns:
acceptedCountandrejectedCount.results[].estimatedSegments.results[].debitApplied.creditsDeductedandremainingBalance.
Single send does not expose the debit or remaining balance in its compatibility response.
Cost-Safe Integration
- Validate recipient lists before sending.
- Preview content length after personalization.
- Budget for concatenated and non-ASCII messages.
- Do not retry a send automatically unless duplicate delivery and duplicate debit are acceptable; the public SMS request DTO has no idempotency key.
- Use the Portal to inspect and fund the account before a large batch.
