Block callers
# support
n
I need help, I keep getting spam callers and robot callers eating up my vapi credits. I need a reliable fix to block those numbers that are spamming my vapi number.
v
To block spam callers and protect your Vapi credits, set up a Server URL that screens inbound calls and rejects numbers on your spam list. Here’s a Node.js/Express example:
Copy code
js
const spamNumbers = new Set(["+11234567890", "+15558675309"]);
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 call: return assistant config here
});
This will automatically reject calls from listed numbers before they reach your assistant, saving your credits. For more details, see the documentation I have found. Source: - [Spam call rejection](https://docs.vapi.ai/server-url/spam-call-rejection)
n
I dont know how to set up a server url please explain
That also make the asistant answer call and uses credits .
3 Views