Network Error on API Request Tool
# support
s
Network error: Unable to connect to the server. This could be due to CORS restrictions, the server being down, or network connectivity issues. Request Details: Method: GET URL: Nextjs App deployed on vercel Header: Using Deployment protection bypass secret But on executing the same request on postman, responds successfully. https://cdn.discordapp.com/attachments/1413223874719514655/1413223875222835260/Screenshot_2025-09-04_at_11.36.59_PM.png?ex=68bb26cc&is=68b9d54c&hm=488edb6ec028390ce9a6476283272d75d489afdf65d477cb476d4eb28f07df1a&
v
Try adding CORS headers to your Next.js API route to resolve the network error. For example, in your API handler, add:
Copy code
js
export default function handler(req, res) {
  res.setHeader('Access-Control-Allow-Origin', '*');
  // ...your existing logic
  res.status(200).json({ message: 'Thank You' });
}
This allows cross-origin requests and should fix CORS-related network errors when called from the API Request Tool. Source: - [Server URLs Vapi Documentation](https://docs.vapi.ai/server-url)
c
Hello, If you need further assistance can you try to debug connectivity issues with Vapi's services, you can use the webhook testing tools:
Copy code
# Test your endpoint directly
vapi listen --forward-to your-endpoint
For your specific CORS issue with a Next.js app on Vercel, you would need to consult Next.js and Vercel documentation as this appears to be a general web infrastructure issue rather than a Vapi-specific problem.
3 Views