An SMS activation API lets your code do what you'd otherwise do in a dashboard: request a phone number for a specific platform, wait for the verification SMS, and read the code. It suits developers, QA teams and resellers who handle verification at volume.
SMS activation API vs. SMS sending API
The two are often confused:
- SMS activation API: receives a code that another platform sends. You get a number and the incoming SMS. Typical users are developers testing sign-up flows and resellers.
- SMS sending API: sends codes to your own users. You get delivery of outgoing messages. Typical users are apps verifying their own customers.
BloomSMS provides an activation API: you receive codes, you don't send them.
How the activation flow works
- Request a number for a target service and country.
- Receive the number and an activation ID in the response.
- Submit the number on the target platform.
- Get the SMS by polling the API or through a webhook.
- Finish or cancel the activation, so a number that never received a code isn't charged.
The activation lifecycle
Every activation moves through a small set of states. Your code should handle each one:
- Waiting: the number is reserved and no SMS has arrived yet.
- Received: an SMS arrived, and the code is available.
- Completed: you confirmed the code worked, and the activation closes.
- Cancelled: you released the number before a code arrived, so it isn't charged.
- Expired: the time window ran out with no code.
Getting started
- Create a BloomSMS account.
- Copy your API key from the dashboard.
- Keep the key server-side and out of front-end code or mobile apps, following the OWASP Secrets Management Cheat Sheet.
Before requesting numbers, most integrations also call the account and catalog endpoints:
- Balance: check funds before a batch so requests don't fail mid-run.
- Services and countries: load the current list instead of hard-coding IDs.
- Prices: read live prices, since they vary by service and country.
Example: request a number
In JavaScript, this request uses the standard Fetch API:
const response = await fetch('https://api.bloomsms.com/v2/number', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
body: JSON.stringify({ service: 'whatsapp', country: 'US' })
});The same request in Python:
import requests
response = requests.post(
"https://api.bloomsms.com/v2/number",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"service": "whatsapp", "country": "US"},
)
activation = response.json()Store the activation ID from the response, because every later call refers to it. The BloomSMS API documentation lists every endpoint and parameter.
Polling vs. webhooks
- Polling: your app asks for the SMS on an interval. It needs no setup beyond the API key and suits prototypes and low volume.
- Webhooks: BloomSMS posts the SMS to your URL when it arrives. It needs a public HTTPS endpoint and suits production and high volume.
API v2 added webhook support for incoming SMS. When you poll, use an interval of a few seconds with a hard timeout rather than a tight loop.
One-time activations vs. rentals
A one-time activation covers a single code. When your app needs the same number for repeat codes, such as re-logins or periodic checks, a long-term number rental keeps that number assigned to you.
Handling failures
Failed codes are normal at any volume: in a Ponemon Institute survey of more than 1,800 IT practitioners, the most-cited range was 11–20% of one-time passwords never arriving.
- No SMS before timeout: cancel the activation and request a new number. Cancelled activations without a code fall under the refund policy.
- Platform rejects the number: the code is never sent, so retrying the same number won't help.
- Rate limits: back off and retry later, for both BloomSMS and the target platform.
- Out of stock: fall back to another country, or retry later.
These are the same failures people hit manually with a temporary phone number, and the fixes are the same.
Migrating from another activation API
If your integration was built for a provider that shut down, the logic usually carries over:
- Map the old service and country codes to the new provider's catalog.
- Replace the request, status and cancel calls with their new equivalents.
- Translate the old status values into the lifecycle states above.
- Run a small batch and compare success rates before switching all traffic.
Our review of the best SMS verification sites covers which providers closed and where their users moved.
Best practices
- Log every activation ID with its status and timestamps.
- Set a timeout per activation and cancel unused numbers promptly.
- Read prices from the API instead of hard-coding them.
- Use test or low-risk accounts while you build.
- Follow each platform's terms. The API doesn't override a platform's rules.
Frequently asked questions
Do I pay if no SMS arrives?
No. Cancelled activations that receive no code aren't charged.
Can I choose the country?
Yes. Pass the country with the service when you request a number. Availability varies.
Is there a rate limit?
Yes. Check the API documentation for current limits.
Which languages can I use?
Any language that can make HTTPS requests. The examples above use JavaScript and Python.