How to Automate Bulk One‑Time Phone Numbers Using Zapier
By the CheapNumbers.shop editorial teamGuides
This guide walks you through connecting CheapNumbers' API to Zapier, letting you automatically buy and apply bulk one‑time phone numbers for any SMS verification need.
How verification processes are evolving, businesses and developers are constantly looking for ways to confirm user identities without slowing down the onboarding flow. One‑time phone numbers have become a popular solution for SMS verification, especially when you need a disposable line that expires after a single use. However, manually ordering each number quickly becomes a bottleneck: you have to log into a provider, select a country, specify quantity, copy the numbers into your system, and then track expiration. The overhead multiplies when you’re handling dozens or hundreds of sign‑ups per day.
Zapier’s automation platform can eliminate that friction. By linking CheapNumbers.shop’s virtual phone number API with Zapier’s webhook actions, you can generate bulk one‑time phone numbers on demand, feed them directly into your verification workflow, and keep everything logged in a spreadsheet or database. The result is a seamless, repeatable process that respects both the provider’s terms of service and the legal requirements around telecom usage. In the sections below we’ll walk through everything you need—from the basic prerequisites to the exact steps for building a “bulk one‑time phone numbers zapier” workflow that scales with your product.
Why Automate Bulk One‑Time Numbers?
Speed up large‑scale verification
- Instant provisioning – A single Zap can request dozens of numbers in a fraction of a second, cutting the time from minutes to milliseconds.
- Parallel processing – Zapier can trigger multiple purchases simultaneously, allowing you to handle spikes in traffic without queuing.
- Immediate hand‑off – The purchased numbers are returned as JSON, which can be parsed and inserted into your CRM, authentication service, or testing suite without manual copy‑pasting.
Reduce manual errors
- Consistent formatting – The API always returns numbers in E.164 format, removing the risk of missing plus signs or spaces.
- Automated logging – Each Zap run can append the request and response to a Google Sheet or Airtable, giving you a reliable audit trail.
- Error handling – Zapier’s built‑in “Filter” and “Path” steps let you react to failed purchases (e.g., insufficient credit) and retry automatically.
Scale across multiple services
- Multi‑country support – By passing a country code as a variable, the same Zap can purchase numbers from the US, UK, India, or any other supported region.
- Service‑agnostic – Whether you’re feeding numbers to a custom OTP generator, a third‑party authentication SDK, or a testing framework, the data arrives in a universal JSON payload.
- Compliance checkpoints – You can insert a step that checks the number against a blacklist or validates that the request complies with the provider’s usage policy before proceeding.
Prerequisites
Zapier account (free or paid)
- Sign up at zapier.com if you haven’t already. A free plan allows up to 100 tasks per month, which is sufficient for testing. For production workloads, a paid plan removes task limits and grants access to advanced features like “Code by Zapier” and higher‑frequency polling.
CheapNumbers API key
- You’ll need an active account on CheapNumbers.shop. Once logged in, navigate to API → Tokens and generate a new token. Keep this token secret; treat it like a password because it grants purchase rights.
Basic understanding of webhooks
- Zapier’s “Webhooks by Zapier” app is the bridge to any external HTTP endpoint. Familiarity with HTTP verbs (GET, POST), headers, and JSON payloads will make the setup smoother, but the guide includes concrete examples you can copy‑paste.
Need a virtual number for SMS verification? Check available numbers at CheapNumbers.shop.
Setting Up CheapNumbers API Access
Generate an API token
- Log in to your CheapNumbers dashboard.
- Click API in the left navigation menu.
- Press Create New Token.
- Give the token a descriptive name, e.g., “Zapier Bulk Purchases”.
- Set the token scope to Purchase Numbers (the default includes read‑only and purchase permissions).
- Click Save and copy the token value—Zapier will need it in the Authorization header.
Configure IP whitelisting
CheapNumbers allows you to restrict API access to known IP addresses, which is a best practice for security.
- In the dashboard, go to Security → IP Whitelist.
- Add the Zapier outbound IP ranges (available in Zapier’s help center under “Zapier IP addresses”).
- Save the list. If you skip this step, the API will still work, but you lose an extra layer of protection against unauthorized usage.
Test the endpoint with curl
Before wiring Zapier, confirm that your token works.
curl -X POST "https://api.cheapnumbers.shop/v1/bulk-purchase" \\
-H "Authorization: Bearer YOUR_API_TOKEN" \\
-H "Content-Type: application/json" \\
-d '{
"country_code": "US",
"quantity": 5,
"type": "one_time"
}'
You should receive a JSON response similar to:
{
"status": "success",
"order_id": "ord_12345",
"numbers": [
"+12025550101",
"+12025550102",
"+12025550103",
"+12025550104",
"+12025550105"
],
"expires_in_seconds": 300
}
If you see an error, double‑check the token, IP whitelist, and that the request body follows the API schema. Once the curl test succeeds, you’re ready to move to Zapier.
Creating Your First Zap
Choose a trigger (e.g., Google Sheet row, webhook)
A Zap always starts with a trigger that tells Zapier when to run.
| Trigger option | When it fires | Typical use case |
|---|---|---|
| Google Sheets – New Row | When a row is added to a sheet | Your marketing team adds a list of users to verify |
| Webhooks by Zapier – Catch Hook | When an external system POSTs data to a unique URL | Your app sends a JSON payload with country_code and quantity |
| Schedule – Every X Minutes | At regular intervals | Periodically pull a batch of numbers for a testing environment |
Select the trigger that matches your workflow and connect the required account (Google, webhook, etc.). For illustration, we’ll use Google Sheets – New Row.
- Create a sheet with columns:
UserID,CountryCode,Qty. - In Zapier, choose Google Sheets → New Spreadsheet Row and point to the sheet.
- Test the trigger by adding a sample row; Zapier should capture the values.
Map input fields for country code and quantity
After the trigger, add a Formatter step (optional) to clean the data:
- Use Numbers → Perform Math Operation if you need to enforce a minimum quantity (e.g.,
max(1, Qty)). - Use Text → Uppercase to ensure the country code is always capitalized.
Then, in the upcoming Webhooks action, you’ll reference these fields as {{CountryCode}} and {{Qty}}. Zapier automatically inserts them when you click the field placeholder.
Zapier Action: Purchase Bulk Numbers via API
Add a Webhooks by Zapier action
- Click + Add Action and search for Webhooks by Zapier.
- Choose Custom Request (this gives full control over method, headers, and body).
POST request to /bulk-purchase endpoint
Configure the request as follows:
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://api.cheapnumbers.shop/v1/bulk-purchase |
| Headers | Authorization: Bearer YOUR_API_TOKEN<br>Content-Type: application/json |
| Data (raw JSON) | json { "country_code": "{{CountryCode}}", "quantity": {{Qty}}, "type": "one_time" } |
| Unflatten | Yes (keeps the JSON structure intact) |
| Timeout | 30 seconds (default is fine) |
Replace YOUR_API_TOKEN with the token you generated earlier. Zapier will mask the token in logs for security.
Parse the JSON response for purchased numbers
After the Webhooks step, add a Code by Zapier step (JavaScript) to extract the numbers and add useful metadata.
const response = JSON.parse(inputData.body);
if (response.status !== "success") {
throw new Error("Purchase failed: " + response.message);
}
return {
order_id: response.order_id,
numbers: response.numbers.join(", "),
expires: response.expires_in_seconds
};
- Input Data: map
bodyto the Raw Response from the previous Webhooks step. - Output:
order_id,numbers,expires.
You can now use these outputs in downstream actions—e.g., write them back to the same Google Sheet, send an email to the ops team, or push them into your authentication service via another webhook.
Putting It All Together: A Sample End‑to‑End Flow
- User signs up → your front‑end posts
{ userId, country }to a Zapier Catch Hook URL. - Zap triggers → the Catch Hook step extracts
countryand setsquantity = 1. - Formatter (optional) ensures the country code is uppercase.
- Webhooks action sends a POST to CheapNumbers
/bulk-purchasewith the primary keyword bulk one time phone numbers zapier baked into the request body. - Code step parses the response, isolates the newly provisioned number, and adds a timestamp.
- Action – write the number and order ID to a database, then pass the number to your OTP service for immediate SMS delivery.
- Cleanup – after the OTP is validated, a second Zap can call the
/release-numberendpoint (if you need to free the number early) or simply let the built‑in expiration handle it.
Best Practices & Legal Considerations
- Compliance – Only use disposable numbers for legitimate verification or testing. Avoid sending marketing messages, unsolicited bulk SMS, or anything that violates local telecom regulations.
- Rate limits – CheapNumbers imposes a maximum of 100 numbers per request and a per‑minute request cap. If you need more, stagger the calls or request a higher quota from support.
- Data retention – Store purchased numbers only as long as necessary for verification. Delete them after they expire to stay aligned with privacy best practices.
- Terms of service – Both Zapier and CheapNumbers require that you do not use the API for illegal activities. Review the “Acceptable Use” sections of each platform before scaling.
- Monitoring – Set up a Zapier “Error Handling” path that alerts you via Slack or email whenever a purchase fails. This helps you react quickly to credit issues or API outages.
Extending the Workflow
Bulk OTP numbers workflow for testing environments
If you run automated UI tests that need a fresh phone number for each run, duplicate the Zap and change the trigger to a Schedule (e.g., every 5 minutes). The resulting numbers can be stored in a dedicated “Test Numbers” sheet, ready for your test suite to consume.
Virtual phone number API integration with other platforms
Zapier’s Webhooks can also call your own backend after the numbers are purchased. For example, you might forward the list to a Node.js service that registers the numbers with Twilio’s Messaging Service, creating a hybrid verification flow that leverages both CheapNumbers’ low cost and Twilio’s global delivery reliability.
Using “Zapier virtual number” for inbound routing
While CheapNumbers primarily provides outbound disposable numbers, you can combine the bulk purchase Zap with a Twilio Inbound Zap that forwards any incoming verification code back to your app. This creates a full round‑trip verification loop without manual handling.
Troubleshooting Common Issues
| Symptom | Likely Cause | Fix |
|---|---|---|
| 401 Unauthorized | Wrong or missing API token | Re‑generate the token, ensure it’s placed in the Authorization header exactly as Bearer <token> |
| 429 Too Many Requests | Exceeding CheapNumbers rate limit | Add a Delay step of 10–20 seconds between purchases, or batch requests into smaller quantities |
Empty numbers array | Quantity set to 0 or unsupported country code | Verify that {{Qty}} is a positive integer and that {{CountryCode}} matches the provider’s ISO list |
| Zap fails on Code step | Unexpected JSON structure | Use the “Raw Response” preview in Zapier to confirm field names; adjust the parsing script accordingly |
Final Thoughts
Automating the acquisition of bulk one‑time phone numbers with Zapier turns a repetitive, error‑prone task into a reliable, auditable process. By leveraging CheapNumbers’ straightforward API, a few Zapier steps, and some basic JSON handling, you can build a scalable verification pipeline that works across continents and services. Remember to stay within legal boundaries, respect the provider’s usage limits, and keep your tokens secure. With the workflow in place, you’ll free up developer time, improve user experience, and maintain a clean audit trail—exactly the kind of efficiency that modern SaaS products need. Happy automating!
Zapier Action: Retrieve OTP and Forward
Set up a polling webhook to check SMS inbox
- Create a new Zap and choose Webhooks by Zapier as the trigger.
- Select Custom Request and configure the request to hit your virtual‑number API’s “get‑messages” endpoint.
- Use the API key you saved in a secure environment variable.
- Schedule the trigger to run every 30 seconds. This interval balances speed and API call limits.
Extract the verification code
- Add a Code by Zapier step using JavaScript or Python.
- Pass the JSON payload from the webhook into the code step.
- Use a regular expression such as
/(\\d{4,6})/to capture the 4‑ to 6‑digit OTP. - Store the extracted code in a Zapier variable for later use.
Send the code to your target app (e.g., Slack, email)
- Add the app you want to forward the OTP to (Slack, Gmail, Teams, etc.).
- Map the OTP variable to the message body.
- Include context like the phone number, timestamp, and any user‑specific data.
- Test the action to ensure the message appears correctly.
By chaining these steps, you can automatically retrieve an OTP from a bulk one time phone number and push it to any downstream system with no manual intervention.
Error Handling & Rate Limits
Detect failed purchases
- Check the HTTP status code returned by the virtual‑number API.
- If the status is 4xx or 5xx, log the error in a dedicated Zapier task.
- Use a Filter step to stop the Zap if the purchase failed, preventing downstream steps from running on incomplete data.
Implement retries with exponential backoff
- Add a Delay step after the failed purchase detection.
- Configure the delay to increase exponentially (e.g., 10 s, 20 s, 40 s).
- After the final retry, send an alert to your ops channel.
- This pattern prevents flooding the API and respects rate‑limit windows.
Monitor API usage limits
- Most virtual‑number providers expose a rate‑limit header (e.g.,
X-RateLimit-Remaining). - Use a Code step to parse this header and store the remaining calls in a Google Sheet or Airtable.
- Create a Zap that triggers when the remaining calls fall below a threshold (e.g., 10).
- Send a notification or pause the Zap to avoid hitting the hard limit.
Looking for a specific app? See browse numbers by country.
Best Practices for Security & Compliance
Store API keys securely
- In Zapier, place your keys in Environment Variables or the Zapier Secrets Manager.
- Never hard‑code keys in the Zap’s code steps.
- Rotate keys every 90 days or after any suspected breach.
Rotate numbers regularly
- Use the provider’s number‑rotation API to swap out virtual numbers after each transaction.
- This reduces the risk of number reuse and improves privacy.
- Automate rotation by adding a “Rotate Number” action after the OTP is forwarded.
Respect regional data‑retention laws
- Identify the country where the virtual number is registered.
- Review local regulations (GDPR, CCPA, etc.) regarding SMS data retention.
- Configure your workflow to delete message logs after the OTP is consumed.
- Store logs only in compliant regions or use encrypted storage.
Testing Your Zap and Going Live
Run a sandbox purchase
- Most providers offer a test mode that simulates number allocation and SMS delivery.
- Use this mode to create a sample purchase and verify that the webhook receives the message.
- Confirm that the OTP extraction logic works with the test payload.
Validate OTP flow end‑to‑end
- Trigger the Zap manually with a sandbox number.
- Watch the message appear in your target app (Slack, email, etc.).
- Verify that the code matches the one displayed in the provider’s dashboard.
- Log each step to a Google Sheet to ensure no data loss.
Activate the Zap for production
- Switch the provider’s API endpoint from sandbox to production.
- Enable the Zap’s Turn On toggle.
- Monitor the first 50 runs closely for any anomalies.
- Once confidence is established, schedule the Zap to run at your desired interval (e.g., every 30 seconds).
By following these steps, you’ll have a robust, secure, and compliant workflow that automates bulk one time phone numbers zapier, streamlines SMS verification, and keeps your system resilient to errors and rate limits.
Related reading
Frequently asked questions
Yes. Include a country‑code field in the trigger data and map it to the API request. The CheapNumbers API supports mixed‑country bulk orders, allowing you to diversify delivery success rates.
