https://retellai.com/?utm_source=discord&utm_medium=seo logo
How do I trigger a web call using rest endpoint
# ❓・ai-evy-support
a
@AI Evy How do I trigger a web call using rest endpoint
a
Thanks for tagging me @arun_13517. I'll look through relevant sources and get back to you shortly.
### Answer To trigger a web call using a REST endpoint, you need to call the
create-web-call
endpoint from your server [(1) ]() . The endpoint requires using your Retell API Key, which is why you need to call it from the server instead of the client to protect the key from being exposed . The access token obtained from this endpoint will be used in your frontend client code to start the call . Note that if you do not start the call within 30 seconds of obtaining the access token, Retell will invalidate it and the call will be marked with an error . Here's the basic flow: 1. Your client code calls your server endpoint 2. Your server internally calls the create web call API to get the access token 3. Use the access token in your frontend to start the call with the Web SDK Once you have the access token, you can start the call using:
Copy code
javascript
await retellWebClient.startCall({
 accessToken: createCallResponse.access_token,
}) ;
​ To learn more, see the sources I considered: [[1] Connect to web call](https://docs.retellai.com/deploy/web-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
@User How do I get my access token