curl -X POST https://api.magpipe.ai/functions/v1/lookup-phone-number \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"phone_number": "+16045551234"}'
{ "phone_number": "+16045551234", "carrier": { "linetype": "wireless", "name": "Rogers Communications Canada Inc. (Wireless)" }, "valid": true, "location": "British Columbia" }
Look up carrier and line type information for a phone number
+16045551234
linetype
wireless
landline
voip
null
name
const lookup = await fetch('https://api.magpipe.ai/functions/v1/lookup-phone-number', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ phone_number: callerPhone }), }).then(r => r.json()); if (lookup.carrier?.linetype === 'wireless') { // Safe to send SMS await sendSms(callerPhone, message); }