Can't alter the transferCall function using PATCH ...
# support
a
Hi, i'm following the documentation to customise the transfer call function to add multiple destinations and also warm transfer message. Can't seem to make the patch request. Am I doing something wrong? Attached my postman request https://cdn.discordapp.com/attachments/1332356464798601449/1332356465540988948/Screenshot_2025-01-24_at_13.59.50.png?ex=6794f527&is=6793a3a7&hm=2781ed81203cbc22ddc07df881a2895dba77832b0cba16161b52c254156f93bc&
v
@Alex Hello! I'm here to help you with the transfer call customization. To assist you better, could you please provide me with the details of the patch request you're trying to make, including the endpoint you're targeting and the body of your request? This will help me understand where the issue might be and guide you accordingly.
You can continue this conversation by mentioning me in the message.
a
I'm trying to update the transferCall function following the documentation to allow for warm transfer. My patch request is to: https://api.vapi.ai/assistant/9c90eaa8-0972-4333-b632-69b3d47189dd Headers bearer Application/JSON Body (RAW) { "tools": [ { "type": "transferCall", "destinations": [ { "type": "number", "number": "+441924601865", "transferPlan": { "mode": "warm-transfer-with-message", "message": "Hey, it's Charlie the AI assistant. I have {{full_name}} on the phone from {{post_code}} looking for a gas boiler quote." } } ], "function": { "name": "transferCall", "description": "Use this function to transfer the call. Only use it when following instructions that explicitly ask you to use the transferCall function. DO NOT call this function unless you are instructed to do so.", "parameters": { "type": "object", "properties": { "destination": { "type": "string", "enum": [ "+441924601865" ], "description": "The destination to transfer the call to." } }, "required": [ "destination" ] } }, "messages": [ { "type": "request-start", "content": "Thanks for confirming, i'm going to transfer your call to sales to give you a quote. Please hold for a second.", "conditions": [ { "param": "destination", "operator": "eq", "value": "+441924601865" } ] } ] } ] }
Reponse message: { "message": [ "property tools should not exist" ], "error": "Bad Request", "statusCode": 400 }
@Vapi
v
@Alex It looks like there might be an issue with the structure of your PATCH request. The error message indicates that the
tools
property should not exist in the body of your request. This suggests that the API is not expecting a
tools
array. Typically, a PATCH request is used to update specific fields of a resource, and the body of the request should contain only the fields that you want to update, formatted according to the API's expected schema. Based on the information you've provided, it seems you are trying to update a function related to call transfer. However, without the exact API documentation, it's difficult to provide the correct structure for your request. Here's a general approach you can take to troubleshoot this issue: 1. Review the API documentation for the
transferCall
function to understand the expected request format for updating the function. 2. Ensure that the body of your PATCH request only contains the fields that are allowed and expected by the API. 3. Double-check that you are using the correct endpoint for updating the
transferCall
function. 4. Verify that your bearer token is valid and has the necessary permissions to make the update. If you can provide the specific section of the documentation that describes how to update the
transferCall
function, I can give you more targeted advice. Otherwise, please refer to the documentation for the correct request format or reach out to support for more detailed assistance.
v
@Alex It seems there might be a misunderstanding or a missing piece of information regarding the documentation you're following. To provide you with accurate guidance, I would need to see the specific section of the documentation that outlines how to update the
transferCall
function. However, based on the error message you received, it's clear that the API endpoint you're trying to PATCH does not accept a
tools
property in the request body. Here are a few steps you can take to resolve this: 1. **Review the Documentation**: Go back to the documentation and look for the section that explains how to update the
transferCall
function. Pay close attention to the structure of the request body and the properties that are expected. 2. **Correct Request Format**: Make sure your PATCH request follows the correct format as per the documentation. This typically involves including only the properties that need to be updated and ensuring they are in the correct hierarchy. 3. **API Endpoint**: Confirm that you are using the correct API endpoint for updating the
transferCall
function. The endpoint in your request should match the one provided in the documentation for this specific operation. 4. **Authentication**: Verify that your bearer token is correct and has the necessary permissions to perform the PATCH operation. 5. **Contact Support**: If you've double-checked the documentation and your request still isn't working, it might be best to contact the API support team for further assistance. They can provide you with specific guidance based on the latest API updates and changes. If you can share the exact documentation or the relevant excerpt, I would be more than happy to help you interpret it and construct the correct PATCH request. Otherwise, please refer to the steps above to troubleshoot the issue.
s
@Alex property tools is part of property model you cannot just use it outside at first level of properties instead it has be nested inside mode property like this:-
Copy code
curl -X PATCH https://api.vapi.ai/assistant/assistant-id \
     -H "Authorization: Bearer token-here" \
     -H "Content-Type: application/json" \
     -d '{
  "model": {
    "provider": "openai",
    "tools": []
  }
}'
Do let me know how it goes for you.
@Alex Because of no response closing this ticket.