Using virtual numbers to test SMS flows
Quick answer
Most SMS providers offer test credentials or magic numbers for unit tests, but they don't prove real delivery. For end-to-end checks of your own app's OTP flow, a real temporary number shows whether codes actually arrive, how fast, and how the message looks. Noir SMS numbers can be bought and read through the REST API, so a test can buy a number, trigger your app's SMS and read the code automatically. Use them only for apps you own or are authorized to test.
SMS bugs tend to show up in production: wrong sender ID, codes cut off, slow delivery in one country. A small set of real-number tests catches them earlier.
Test numbers vs real numbers
| Provider test numbers | Real temporary numbers | |
|---|---|---|
| Proves real delivery | No | Yes |
| Cost | Free | Per number, refunded if no SMS |
| Speed | Instant | Seconds, like real users |
| Good for | Unit and CI tests | Pre-release and smoke tests |
What to check
- The code arrives in each target country.
- Message text, sender and length look right.
- Your resend and expiry logic works.
Automating
Use the Noir SMS API: POST /api/v1/numbers to buy, then poll GET /api/v1/numbers/{id} or receive the sms.received webhook. In your app, choose the "Any other" service when testing your own product.
Frequently asked questions
Is there a sandbox?
No separate sandbox. GET endpoints are free to call, and numbers without an SMS are refunded.
What's the rate limit?
120 requests per minute per API key.
Services in this guide
Keep reading
Testing OTP and SMS sign-up flows in staging
Run end-to-end tests of your app's SMS sign-up in staging with real temporary numbers: Playwright example, what to check and how to keep costs low.
Read the guide →DevelopersReceive SMS verification codes with Python
Buy a temporary number and read the SMS verification code from Python with the Noir SMS REST API. Full example with requests, polling and errors.
Read the guide →DevelopersAutomate receiving SMS codes: polling or webhooks
Two ways to receive SMS verification codes automatically with the Noir SMS API: polling GET /numbers/{id} or a signed sms.received webhook. Code included.
Read the guide →DevelopersReceive SMS verification codes with Node.js
Buy a temporary number and read SMS verification codes from Node.js with fetch and the Noir SMS REST API. Complete example with error handling.
Read the guide →DevelopersReceive SMS verification codes with PHP
Use PHP and cURL to buy a temporary number and read the SMS verification code with the Noir SMS API. Copy-paste example for panels and scripts.
Read the guide →DevelopersCommon Noir SMS API errors and how to handle them
Every Noir SMS API error code explained: invalid_api_key, insufficient_balance, no_numbers, too_early, rate_limited and more, with a retry pattern.
Read the guide →