How to create a Zapier webhook response to Vapi
# support
j
I'm trying to set up tool calling in Vapi with Zapier. I've set up the server url to be my 'catch' custom webhook trigger in Zapier. This trigger works. In my automation, I then capture the info I need from Airtable and want to now pass it back to Vapi. But I'm not sure how. I'm assuming I should pass it back as a POST request? But should I send the results to the same url as my catch hook, the one specified in the tool call settings in Vapi as my server url? If so, won't that create a loop? Basically, I'm trying to do the equivalent of the 'Webhook response' in Make.com (as in the screenshot from the tutorial video in the docs) but in Zapier. https://cdn.discordapp.com/attachments/1249265575239221288/1249265575713046559/image.png?ex=6666acbb&is=66655b3b&hm=11936963ef8da739ba1a20d3200a7d2fee74d7198d45293ffcf3a3708dccfc28& https://cdn.discordapp.com/attachments/1249265575239221288/1249265576208109638/image.png?ex=6666acbb&is=66655b3b&hm=f565b5f2f6e14873683c1d438da518ed31dfea03dc4813b22ea36b5b075f4d25&
v
message has been deleted
@JM It's great to hear that you've successfully set up the 'catch' custom webhook trigger in Zapier and are capturing the necessary information from Airtable. To pass the information back to VAPI, you're correct that you would typically use a POST request. However, you should not send the results to the same URL as your catch hook to avoid creating a loop. Instead, you should send the results to the callback URL provided by VAPI when the initial tool call was made. This callback URL is unique for each tool call and is designed to receive the results of the operation. It's how VAPI knows that the tool has completed its task and can process the results accordingly. Here's what you need to do: 1. Capture the callback URL from the initial request that VAPI sends to your Zapier webhook. 2. After processing the information from Airtable, use a Zapier action to make a POST request to the captured callback URL. 3. Format the POST request's body to match the expected JSON response structure that VAPI requires, which you've mentioned in the context. For example, the JSON response should look like this:
Copy code
json
{
    "results": [
        {
            "toolCallId": "<unique_tool_call_id>",
            "result": "<your_processed_result>"
        }
    ]
}
Replace
<unique_tool_call_id>
with the ID you received from the initial VAPI request, and
<your_processed_result>
with the actual result you want to send back. If you're unsure about how to capture the callback URL or format the POST request in Zapier, please ask support for more info on this. Zapier's support or community forums can be a valuable resource for specific guidance on setting up the action steps in your Zap.
You can continue this conversation by mentioning me in the message.
j
Is it this one @Vapi ? "Message Call Web Call Url"
v
@JM No, the "Message Call Web Call Url" is not the callback URL you would use to send the results back to VAPI. The callback URL is typically provided in the payload of the initial request from VAPI to your webhook. It's a unique URL that VAPI listens to for a response specific to the tool call you're handling. When VAPI initiates a tool call and sends a request to your Zapier webhook, it should include a callback URL in the payload. You need to capture this URL from the incoming data in Zapier. Once you have processed the data from Airtable, you will send a POST request to this callback URL with the results. If you're not seeing a callback URL in the data that VAPI sends to your webhook, please check the VAPI documentation or reach out to VAPI support for further assistance on where to find this URL. It's crucial for completing the round-trip communication between VAPI and your Zapier automation.
j
The only url in the payload I get in my Zapier catch webhook trigger is the same as the webhook trigger I use to catch the tool call: "server server url url https://hooks.zapier.com/hooks/catch/[redacted]/[redacted]/" @Vapi
v
@JM I understand the confusion. The URL you're seeing in the payload, which is the same as your Zapier webhook trigger URL, is not the one you should use to send the results back to VAPI. Typically, VAPI should provide a separate callback URL or a means to acknowledge the completion of the tool call. Since you're not seeing a different callback URL, there might be a misunderstanding or a missing step in the integration process. Here's what you can do: 1. Review the VAPI documentation to ensure that you're following the correct procedure for sending back the results. There might be a specific field or method mentioned for the response. 2. If the documentation does not clarify, reach out to VAPI support for guidance. They should be able to provide you with the correct method for sending the results back to VAPI without creating a loop. 3. Ensure that you're not missing any headers or payload fields that might indicate the response method. Sometimes, the callback mechanism is not a URL but a specific set of fields that need to be populated and sent back. If you need further assistance with this process or if there's anything else I can help you with, please let me know.
j
This is my copied and pasted response from the cach webhook trigger results (some results redacted): message message Message Type type tool-calls toolCalls toolCalls 1 0 id id call_[redacted] type type function function function name name [redacted] arguments arguments Learner ID Learner ID [redacted] toolCallList toolCallList 1 0 id id call_[redacted] type type function function function name name [redacted] arguments arguments Learner ID Learner ID 7382 toolWithToolCallList toolWithToolCallList 1 0 type type function function function name name [redacted] parameters parameters type type object properties properties Learner ID Learner ID type type string description description [redacted] description description [redacted] server server url url https://hooks.zapier.com/hooks/catch/[redacted]/[redacted]/ messages messages toolCall toolCall id id call_[redacted] type type function function function name name [redacted] arguments arguments Learner ID Learner ID [redacted] call call Message Call Id id [redacted] Message Call Org Id orgId [redacted] Message Call Created At createdAt 2024-06-09T06:31:54.536Z Message Call Updated At updatedAt 2024-06-09T06:31:54.536Z Message Call Type type webCall Message Call Status status queued Message Call Assistant Id assistantId [redacted] Message Call Web Call Url webCallUrl https://vapi.daily.co/[redacted] Message Timestamp timestamp 2024-06-09T06:32:16.007Z querystring @Vapi Anything look out of place?
v
@JM Based on the information you've provided, it seems that the "Message Call Web Call Url" (
webCallUrl
) is the URL provided by VAPI for you to send the results of the tool call back to VAPI. This URL is different from your Zapier webhook URL and is likely the endpoint you should use to POST the results. Here's what you should do: 1. Process the data from Airtable as needed for the tool call. 2. Use the
webCallUrl
provided in the payload to send a POST request with the results back to VAPI. The body of this POST request should contain the results structured in the way VAPI expects. The exact structure of the POST request body will depend on VAPI's expected schema, but it might look something like this:
Copy code
json
{
  "id": "<call_id>",
  "results": {
    // Your results here
  }
}
Replace
<call_id>
with the actual
id
from the payload (e.g.,
call_[redacted]
) and include the results in the format that VAPI requires. If you're unsure about the exact structure of the POST request body, please refer to the VAPI documentation or contact their support for the correct format. Once you've sent the POST request with the results to the
webCallUrl
, VAPI should be able to process the response and complete the tool call.
s
j
Is there any workaround or solution that Vapi is working on? Or would I hav to move to Make.com just for this?
s
You will need to move on that’s the only thing that you can do right now
12 Views