A successful SMS API integration comes down to testing the parts that break in production: authentication, number formatting, sender IDs, encoding, delivery-report webhooks, retries, rate limits and opt-outs. Work through the 15 checks below before go-live and you will catch the problems that usually surface only after customers start complaining that their codes never arrived.
The checklist is written for teams integrating the SMS.to SMS API, but most checks apply to any provider. Each one says what to test and what “done” looks like, grouped into security, numbers and content, delivery and resilience, and go-live readiness.
Security and access
1. Keep API keys server-side, scoped and rotatable
The key goes in a secret manager or environment variable on your server, never in mobile apps, browser code or a repository. Test that the application reads it at start-up and fails loudly if it is missing. Where your network allows, add the servers’ IP addresses to the key’s allowlist: requests from other addresses then fail with HTTP 412. Make sure you can rotate the key without a deploy. If you prefer short-lived credentials, the API can issue access tokens from your client ID and secret that expire after 1 to 120 minutes.
2. Lock down your webhook endpoints
Your delivery-report and inbound URLs are public, so anyone can post to them. Serve them over HTTPS only, include a long random token in the path and reject requests without it, and validate that each payload has the fields you expect before acting on it. Test by posting a forged report with a wrong token and confirming it is rejected and logged, not processed.
3. Log events without storing personal data
Phone numbers are personal data, and passcode text is a credential. Log the message_id, status, error code, part count and cost, and mask numbers to the last few digits. Never log OTP message bodies. Check that request and response logging in your HTTP client or API gateway does not capture full payloads by default. Keep what you do store under your normal retention rules; SMS.to can provide a data processing agreement on request.
Numbers, sender IDs and content
4. Normalise every number to E.164
Store and send numbers as a plus sign, the country code and the national number without its leading zero, up to 15 digits in total, as defined in ITU-T E.164. Convert at the point of capture with a libphonenumber-based library, and reject what it cannot parse. Test national formats, numbers with spaces and brackets, a leading 00, and numbers from every country you serve. If some legacy data lacks a country code, decide explicitly whether the account’s Default Prefix should apply.
5. Confirm sender ID rules for every destination
Sender ID rules are national and they change. Some countries need alphanumeric IDs registered in advance, some allow only numeric senders, and some overwrite unregistered names. In the United States, A2P traffic from local numbers needs 10DLC brand and campaign registration through The Campaign Registry. In India, headers and message templates must be registered on DLT before sending, as TRAI’s advice to senders explains. List every destination, the sender type you will use there and its registration status. Our guide to SMS sender ID rules by country covers the main markets.
6. Check encoding and segment count for every template
A message in the GSM-7 alphabet holds 160 characters; one character outside it, such as an emoji or a curly apostrophe, switches the whole message to UCS-2 and a 70-character limit (3GPP TS 23.038). Long messages split into parts of 153 or 67 characters (3GPP TS 23.040), each billed separately. Paste every template, with realistic variable values, into the Unicode SMS checker, or call the estimate endpoint, which returns sms_count and estimated_cost without sending:
curl -X POST https://api.sms.to/sms/estimate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message": "Your code is 482913. It expires in 5 minutes.", "to": "+447700900123", "sender_id": "SMSto"}'
Watch for names and addresses in other scripts: a template that fits one part in one language may take three in another.
7. Honour opt-outs on every send
Check opt-outs before every send, including API sends triggered by events, not just campaigns. In SMS.to, adding STOPSMS {optout} to a message inserts an unsubscribe link, opted-out recipients are skipped with status UNSUBSCRIBED and not charged, and you can opt contacts out or in through the API. Opt-outs can take up to 24 hours to take effect, per SMS.to’s opt-out guide, so sync your own suppression list too. Only set bypass_optout for strictly transactional messages such as passcodes, and test that a promotional send to an opted-out number is blocked.
Delivery and resilience
8. Handle delivery-report webhooks correctly
Delivery reports tell you what happened after the API accepted a message. Your endpoint must accept form-encoded posts (or JSON if the callback URL ends in #json) and return HTTP 200 within 3 seconds; otherwise, per the callback documentation, SMS.to retries after 1, 2, 4 and 24 hours and then gives up. Test all of it: a slow handler, a 500 from your side, a duplicate report, and a SENT arriving after DELIVERED, which must not overwrite the final status. Remember that on some networks SENT is the last status you will ever get.
9. Make retries safe
Retry only what is safe to retry: HTTP 429 and gateway errors (502, 503, 504), with exponential backoff and a small attempt limit. Never retry 400, 401 or 422, which will fail again. A 500 or a network timeout is ambiguous, because the message may already be queued. The send endpoint has no documented idempotency key, so give each send your own reference, and before resending check GET https://api.sms.to/v2/messages filtered by to and created_at_from. Test by killing the network mid-request and confirming no duplicate reaches the handset.
10. Respect rate limits and plan throughput
Every provider limits requests per second, and a burst returns HTTP 429. Measure your peak: a flash sale, a password-reset wave, a nightly reminder batch. Put sends behind a queue with a controlled worker rate rather than firing them straight from web requests, and keep passcodes in a separate, higher-priority queue so a campaign never delays a login. Send to up to 2,000 numbers per request instead of looping one by one. If you plan a load test, ask SMS.to for higher limits first so you measure your system, not the default throughput cap.
11. Plan a fallback for slow or failed delivery
Decide what happens when a message does not arrive. For passcodes, offer a resend after a sensible delay and consider a second channel; the Verify API can fall back automatically from WhatsApp, Viber or Telegram to SMS or the reverse. For alerts that matter, use one later retry on absent-subscriber errors and none on unknown numbers. If callbacks stop arriving, poll GET https://api.sms.to/message/ with the message ID for the few messages that matter most.
Go-live readiness
12. Test on real handsets and networks
Simulators do not show what customers see. Use real phones on the main networks in each launch country, ideally owned by your team, and check the sender name, special characters, long-message reassembly, links, the opt-out flow, and the time from request to handset. Include a ported number and a phone left switched off for an hour, so you see absent-subscriber handling end to end. Record the results; they become your baseline for support tickets later.
13. Add fraud controls to OTP and sign-up flows
Any public form that triggers an SMS is a target for SMS pumping, where bots generate traffic to numbers that earn the fraudster revenue. Before go-live, add rate limits per phone number, IP address and device, block destinations you do not serve, add a CAPTCHA on repeated requests, and alert on falling verification conversion by country. Our guide to spotting and stopping SMS pumping explains the patterns to watch.
14. Monitor delivery, latency and balance
Build a dashboard before launch, not after the first incident. Track delivered, failed and expired rates by country and network, time from request to DLR, error codes, and spend. Alert on sudden drops, because they often mean a sender ID problem or a routing change. Watch your balance with GET https://auth.sms.to/api/balance: messages sent without funds fail with status NO_FUNDS, as SMS.to’s status guide lists. Subscribe your on-call team to the provider’s status page.
15. Respect time zones and quiet hours
A reminder that lands at 3 a.m. generates opt-outs and complaints. Store each recipient’s time zone, keep marketing and non-urgent messages inside local daytime windows, and let passcodes and security alerts through at any hour. The API accepts scheduled_for and timezone fields for scheduled sends, so test a scheduled message across a daylight-saving change before you rely on it.
How SMS.to helps you pass the checklist
SMS.to is operated by Intergo Telecom, a licensed telecom and CPaaS operator building messaging infrastructure since 2014. Several checks are handled on the platform side: the SMS API queues and retries transient issues, supports per-key IP allowlisting, posts delivery reports and replies to your webhooks, and applies opt-outs automatically. For sender IDs, the team will advise on the right setup and registration for each market before you launch. Full request and response details for every endpoint mentioned here are in the SMS.to API documentation, and if you are still writing the integration itself, our Node.js, Python and PHP code examples already follow checks 4, 8 and 9.
FAQs
How long does an SMS API integration take?
A first message can go out within minutes of getting a key. A production-ready integration with webhooks, retries, opt-outs and monitoring usually takes longer, mostly for testing and sender ID registration.
What is the most common SMS API go-live problem?
Sender ID rules. An unregistered or unsupported sender ID in one country can block or delay every message there, even when the code is correct.
Do I need a separate test environment?
Test with real handsets and small volumes on your live account, and use the estimate endpoint to check cost and part counts without sending.
How do I know my webhook is working?
Send a message to your own phone and confirm a delivery report reaches your endpoint, returns 200 within 3 seconds, and updates the stored status once.
Ready to run through the list? Create a free account, no credit card needed, and test each check against your own number before your customers do.