Architecture overview
A robust fraud prevention system layers multiple defenses:Server-side rate limiting with Redis
Production rate limiting requires a distributed store. These examples use Redis for shared state across multiple application instances.Sliding window rate limiter
Geo-fencing
Restrict verifications to countries where your service operates. This is the single most effective defense against SMS pumping.Configure on Verify profile
Application-level geo-validation
Add server-side validation before calling the API as a defense-in-depth measure:High-risk country codes
These country codes are frequently targeted for SMS pumping and toll fraud. Block or add extra scrutiny:High-risk country codes
High-risk country codes
| Code | Country | Risk |
|---|---|---|
| +232 | Sierra Leone | SMS pumping |
| +225 | Côte d’Ivoire | SMS pumping |
| +233 | Ghana | SMS pumping |
| +234 | Nigeria | Mixed (legitimate + fraud) |
| +260 | Zambia | SMS pumping |
| +256 | Uganda | SMS pumping |
| +880 | Bangladesh | Toll fraud |
| +855 | Cambodia | Toll fraud |
| +856 | Laos | Toll fraud |
| +960 | Maldives | Toll fraud |
| +592 | Guyana | Toll fraud |
Anomaly detection
Build automated detection for suspicious patterns beyond simple rate limits.Conversion rate monitoring
A healthy verification flow has a 60-80% conversion rate (codes sent vs. codes verified). A rate below 20% may indicate an attack.Sequential number detection
SMS pumping often uses sequential phone numbers. Detect and block this pattern:Cost controls
Set spend alerts
Monitor your Telnyx account spending and set alerts at the account level through the Telnyx Portal billing settings.Implement circuit breakers
Automatically disable verifications when anomalies are detected:Incident response
When you detect a fraud attack in progress:Investigate: Check patterns
Look at the destination countries, IP addresses, and phone number patterns in your logs.
Block: Update allowlists
Remove affected countries from your Verify profile’s
whitelisted_destinations.Recover: Tighten limits
Reduce rate limits, add CAPTCHA if not present, and re-enable verifications gradually.
Contact Telnyx Support
Report the incident to Telnyx Support for investigation and potential charge reversal.
Configuration reference
Summary of all Verify profile settings relevant to fraud prevention:| Setting | Endpoint | Purpose |
|---|---|---|
whitelisted_destinations | PATCH /v2/verify_profiles/{id} | Restrict SMS to specific countries |
code_length | PATCH /v2/verify_profiles/{id} | Set verification code length (4-10) |
default_timeout_secs | PATCH /v2/verify_profiles/{id} | Expiration time for codes |