When your application needs to process tens of thousands of phone numbers, synchronous REST calls can quickly become a bottleneck. For large-scale enrichment—such as processing a list of 50,000 numbers—the carrier_batch service provides an asynchronous bulk workflow designed to handle high-volume data without blocking your main application threads.
Understanding the Bulk Lifecycle
Unlike realtime single-number lookups, bulk tasks operate on a submit-poll-retrieve model. This lifecycle ensures that your system remains responsive while the backend processes your file.
1. Multipart Submission
To initiate a task, you must submit your data via POST /api/v1/bulk-tasks. It is critical to follow the documented multipart order: the country code must be provided before the file.
- Input: A one-column TXT or CSV file containing prepared, valid numbers.
- Constraint: Ensure your file size remains within the documented default limit of 20 MB, or any server-returned limit that takes precedence.
- Pre-processing: The system automatically excludes invalid rows, duplicates, and numbers missing a country code. You are only charged for numbers that return results.
2. Monitoring Progress
Once the task is submitted, you will receive an identifier. Use GET /api/v1/bulk-tasks/{id} to check the status of your job.
Operational Note: To maintain system stability, poll the status endpoint no more often than once every 30 seconds.
State transitions include processing, success, and failed. Avoid aggressive polling intervals, as the 30-second cadence is sufficient for tracking task completion.
3. Retrieving Results
When the task reaches the success state, the endpoint provides a downloadable CSV file. This file contains the original carrier, underlying carrier, line type, and allocation geography for each processed number.
Testing and Sandboxing Your Integration
Before pushing to production, verify your integration logic using a local validation layer. Since bulk tasks are asynchronous, your test suite should simulate the polling loop rather than expecting an immediate response.
Integration Checklist
- Validation: Ensure your input file contains only valid E.164-formatted numbers (country code + subscriber number, no spaces/separators).
- Error Handling: Implement logic to handle cases where a task fails during preparation (e.g., if too few valid mobile numbers are identified).
-
Resource Management: Remember that bulk tasks and realtime lookups share the same USD balance. Monitor your balance via
GET /api/v1/balanceto ensure sufficient funds before triggering large batches.
Conclusion
By moving from synchronous POST /api/v1/check calls to the carrier_batch bulk workflow, you can efficiently enrich large datasets while maintaining a clean, non-blocking architecture. Always prioritize the 30-second polling interval and ensure your multipart submission order is correct to avoid unnecessary task failures. For further details on integration boundaries and API specifications, refer to the official documentation.
This article was drafted with AI assistance and reviewed before publishing.













