Hi,I am trying to make outbound call for vapi assi...
# support
p
Hi, I am trying to make outbound call for vapi assistant, in which vapi will make an outbound call and talk with the person and send the conversation detail back to webhook. For this I am using n8n to make a http request and make a call. But I am having an issue related to it as shown in screenshot below. I have tried with both public and private key. https://cdn.discordapp.com/attachments/1346652414865969285/1346652415100719135/Screenshot_2025-03-05_at_12.06.14_PM.png?ex=67c8f74b&is=67c7a5cb&hm=76a76f7454a31a541a23d7c0365f26caec84da6b7da019380fba8fef34e789e0&
v
It looks like you're encountering a 403 Forbidden error when trying to make an outbound call using the Vapi API. This error typically indicates an issue with your API key or credentials. Here are some steps to troubleshoot the problem: 1. **Check the API Key**: Ensure that you are using the correct type of API key. The error message suggests that you might be using the private key instead of the public key, or vice versa. For making outbound calls, you should use the private API key. 2. **Authorization Header Format**: Make sure your Authorization header is formatted correctly. It should look like this:
Copy code
Authorization: Bearer YOUR_PRIVATE_API_KEY
In your case, it seems you have "Barrier" instead of "Bearer," which is likely a typo. 3. **Verify Key Status**: Check if your API key is active and has not expired or been revoked. You can manage this from your API dashboard. 4. **Environment Check**: Ensure that you are using the correct environment (development, staging, or production) that corresponds to your API key. 5. **Review Request Details**: Double-check the request body and ensure that all required fields are correctly filled out. The "To" and "From" numbers should be valid and properly formatted. 6. **Consult Logs**: If the issue persists, review any API request logs for additional error messages or warnings that might provide more context. If you've gone through these steps and are still facing issues, please let me know, and we can dig deeper! 😊 Sources: - [Troubleshooting "403 Forbidden" Error in Vapi API for Outbound Calls](https://discord.com/channels/1211482211119796234/1211483291191083018/1336432457943351358) - [Detailed Report on Public Key vs Private Key Authentication in VAPI](https://discord.com/channels/1211482211119796234/1211483291191083018/1328923059905630238)
p
HI, i did all this steps but still facing the same issue. Its showing same error, Is that the correct method to make a outbound call, or i need to configure anything in vapi for it.
s
API URL should be https://api.vapi.ai/call
s
is this in n8n?
dont uses the JSON way thats why its 403ing
p
I tried the way you told, I tried with both public and private api, still same 403 error
also I am calling to vapi assistant by using the phone number imported from twillio. and when i request to make a call it is sending theresponse to webhook in n8n, and in n8n i am using http method to make a call, after the call is made then again it will send the call description to another webhook
Is this the correct way i am doing
s
do you have Postman? I just want to sanity check we are not dealing with a bug in n8n
p
yes i have postman
s
try it there and see what you get postman suports Vapi out of the box as that what im using the test
p
can u help me a bit, like how i can try in postman
s
yeah one sec
s
yeah that wont work
p
so, any thing i can do to make it work
s
Ill right you up a test json paylod
Copy code
{
  "name": "your name here",
  "customer": {
    "number": "add target number"
  },
  "assistant": {
    "firstMessage": "",
    "model": {
      "provider": "anyscale",
      "model": "gpt-3.5-turbo",
      "messages": [
        {
          "role": "system",
          "content": ""
        }
      ]
    }
  },
  "assistantId": "add your id",
  "phoneNumberId": "add your id"
}
just add your stuff like name and IDs but that a basic template
p
for assistantID i am using the id of the vapi agent,a nd for phonenumber id, i am using the id shown on VAPI > PHONE NUMBERS> and the id of the number i am using,
{ "message": "Couldn't Find Credential for Model Provider
anyscale
.", "error": "Bad Request", "statusCode": 400 }>>> i got this error
s
change the Provider to openai
p
i cahnged
how can i execute it in n8n. should i use the same body in n8n aswell
s
I would since its known good then we just need to figure out the Auth error
p
i tried the same body in n8n and it is showing same error, and the problem is that there is no any information related to this in youtube or google. Its hard to work on this things
s
is it the 403 error correct?
p
yeah, same 403 error
s
let me try it on my end really quikc one sec
ok so for the adding the auth your can import a curl command so this it the curl command u need to import
curl -X POST https://api.vapi.ai/call \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \
p
I am getting this error for the below body format, if i use the json paylod u provided above its working, but in n8n i want to pass some dynamic value and then it shows these erroe. the body json is: { "name": "Vapi Outbound Call Request", "customer": { "number": "{{ $json.doctor_phone }}" }, "assistant": { "firstMessage": "Hello Dr. {{ $json.doctors }}, I am calling on behalf of {{ $json.patient_name }} to schedule an appointment. Are you available for any earliest available date?", "model": { "provider": "openai", "model": "gpt-3.5-turbo", "messages": [ { "role": "system", "content": "This is a voice call to schedule an appointment with the doctor." } ] } }, "assistantId": "37e5ae7f-bde4-478f-ae48-933760dbae93", "phoneNumberId": "238c01e4-7f60-4274-aec7-109cc04672b1", } https://cdn.discordapp.com/attachments/1346652414865969285/1346681286550360095/Screenshot_2025-03-05_at_2.08.35_PM.png?ex=67c9122e&is=67c7c0ae&hm=df767b3f62c8386a06a254b77d4293ec7695f587ee615a96315c2b6a6fdb766d&
Also, when vapi makes an outbound call , how can i send the details of that conversation to n8n through another webhook?
s
in the Respons it give you a call id you can grab it using the Api call https://api.vapi.ai/call/:id
p
its working thank u for your help.
now, how can i send the details of that conversation to n8n through another webhook?
s
in the Respons it give you a call id you can grab it using the Api call https://api.vapi.ai/call/:id
p
can u explain a bit how i can use call id in n8n
s
show me the output of your HTTP request in n8n
p
[ { "id": "44264473-353a-44d9-8bfb-c780b151e19f", "assistantId": "37e5ae7f-bde4-478f-ae48-933760dbae93", "phoneNumberId": "238c01e4-7f60-4274-aec7-109cc04672b1", "type": "outboundPhoneCall", "createdAt": "2025-03-05T03:17:52.579Z", "updatedAt": "2025-03-05T03:17:52.579Z", "orgId": "c794b4bf-d9f1-4184-a7ea-5aac027e4334", "cost": 0, "assistant": { "model": { "model": "gpt-3.5-turbo", "messages": [ { "role": "system", "content": "This is a voice call to schedule an appointment with the doctor." } ], "provider": "openai" }, "firstMessage": "Hello Dr.sarad poudel , I am calling on behalf of John Doe to schedule an appointment. Are you available for any earliest available date?" }, "customer": { "number": "+61452203478" }, "status": "queued", "phoneCallProvider": "twilio", "phoneCallProviderId": "CA51e66d0f5af5ff0bd93974aed78ac19a", "phoneCallTransport": "pstn", "name": "your name here", "monitor": { "listenUrl": "wss://phone-call-websocket.aws-us-west-2-backend-production1.vapi.ai/44264473-353a-44d9-8bfb-c780b151e19f/listen", "controlUrl": "https://phone-call-websocket.aws-us-west-2-backend-production1.vapi.ai/44264473-353a-44d9-8bfb-c780b151e19f/control" }, "transport": { } } ]
this is the output, i have call id at top, so i am confgused on how to use to to get the conersation
s
so in the seconed HTTP request inside the URL append the ID to the end so it will look like this
youll need to add your auth as well so i would just duplicate the last request and modify it
p
and for body json should i use the same
s
no its GET request the body should be blank
s
Hey @PUNK checking if this is resolved for you?
13 Views