Overview
The SIM Swap service provides endpoints for checking if a phone number has recently undergone a SIM swap and receiving status callbacks through Africa’s Talking SIM Swap API.GET /sim-swap/
Check SIM Swap service status.Response
Service name (“sim-swap”)
Service status (“ready”)
Example Request
Example Response
GET /sim-swap/invoke-check-simswap
Check if a phone number has recently undergone a SIM swap.Query Parameters
Phone number to check for SIM swap (without the + prefix, e.g., 254711XXXYYY)
Response
Success message indicating SIM swap check was initiated
Response object from Africa’s Talking API
Example Request
Example Response
Error Codes
- 400 - Missing ‘phone’ query parameter
- 500 - Internal server error or Africa’s Talking API error
POST /sim-swap/status
Webhook callback for SIM swap status updates from Africa’s Talking.Request Body (JSON)
SIM swap status: “Swapped” or “NotSwapped”
Date of last SIM swap in DD-MM-YYYY format (“01-01-1900” if never swapped)
Provider reference ID
Request ID from the original SIM swap check request
Unique transaction ID
Response
Returns “OK” with status 200.Example Request (Swapped)
Example Request (Not Swapped)
Example Response
Status Values
- Swapped - SIM card has been swapped recently (within the detection window)
- NotSwapped - No recent SIM swap detected
- Failed - Check failed (may include error details)
- Pending - Check is still in progress
Use Cases
SIM swap detection is commonly used for:- Fraud Prevention - Detect potential account takeover attempts
- Additional Authentication - Require extra verification if SIM was recently swapped
- Transaction Security - Block high-value transactions after recent SIM swaps
- Account Recovery - Verify legitimate SIM swaps during account recovery
Best Practices
- Set appropriate timeframes - Define what “recent” means for your use case (e.g., 24 hours, 7 days)
- Combine with other signals - Use SIM swap data alongside other fraud detection methods
- Handle edge cases - Account for users who legitimately changed their SIM card
- Store webhook data - Log all status callbacks for audit and analysis
- Implement retry logic - Handle network failures gracefully
