Zayan @ UNITZERO
12/17/2025, 9:18 PMVapi Support Bot
12/17/2025, 9:20 PMjs
import express from "express";
const app = express();
app.use(express.json());
const spamNumbers = new Set(["+11234567890", "+15558675309"]); // Add your spam numbers here
app.post("/webhooks/vapi", (req, res) => {
const incomingNumber = req.body?.call?.from?.phoneNumber;
if (incomingNumber && spamNumbers.has(incomingNumber)) {
return res.json({ error: "Sorry, your number is blocked due to spam reports." });
}
// Allow legitimate calls to proceed
res.json({ assistant: { firstMessage: "Hi there! How can I help you today?" } });
});
app.listen(3000, () => console.log("Server listening on port 3000"));
Replace the numbers in spamNumbers with your own list. This will block known spam calls before they reach your assistant.
For more details, see the [Vapi spam call rejection guide](https://docs.vapi.ai/server-url/spam-call-rejection).
Source:
- [Spam call rejection – Vapi Documentation](https://docs.vapi.ai/server-url/spam-call-rejection)Chiranjeet Mishra
12/19/2025, 8:01 PMStirVerstat)
- Reject spam calls with <Response><Reject/></Response>
- Forward legitimate calls to Vapi’s webhook:
https://api.vapi.ai/twilio/inbound_call
4. Update your Twilio number’s webhook URL and test with known spam/legit calls.
At the moment, Vapi does not have built-in inbound spam filtering, so filtering must happen at the Twilio level or via custom middleware.
Let us know if you want help validating your setup or testing the flow.
Best,
Kyle
Vapi SupportZayan @ UNITZERO
12/20/2025, 3:44 AM