Vapi Request error
# support
a
i want a add a apiRequest tool from to conect my server from validations customer things in the middle of the speech comparing the original vs the input on the code, in the functions tools is no allowing send a body in the request, and in ApiRequest is showing this error, i'm doing something wrong ? there is another way from validate customer data with presicion idof the tool fb959556-b6e5-4c28-b2e5-55b9fe933388 and expect body to send { "baseRUT": "string", "inputRUT": "string" } https://cdn.discordapp.com/attachments/1377408337515249684/1377408337666379977/image.png?ex=6838dafa&is=6837897a&hm=e50d8438bc1107ff21e03c51059505ff4a8174101e536976529ceca6cecfcc8f&
v
It looks like the error is due to the body not being recognized as a valid object. To fix this, make sure your tool's configuration uses the "function" type and defines the parameters as an object, like this:
Copy code
json
"function": {
  "name": "validate_customer",
  "parameters": {
    "type": "object",
    "properties": {
      "baseRUT": { "type": "string" },
      "inputRUT": { "type": "string" }
    }
  }
}
Ensure your request body is a proper JSON object, not a string. This should resolve the validation error and allow your server to receive the expected data structure. Source: - [Vapi Custom Tools Documentation](https://docs.vapi.ai/tools/custom-tools)
m
Facing the same issue. Also when saving a Tool with a request body properties, it is giving an error
c
looking into it.
The main issue is that you're using a GET request method but have configured a request body with properties. GET requests don't typically use request bodies, and the validation error suggests the body type configuration is incorrect for your intended use case. **Two possible fixes depending on your intent**: \### Option 1: If you need to send data (recommended) - Change HTTP Method from
GET
to
POST
- Keep your request body configuration as is - The body type should automatically resolve to "object" when you have properties defined \### Option 2: If this should be a GET request - Remove the entire Request Body section - Use URL parameters or headers instead for any data you need to send - GET requests should not have request bodies **Step-by-step implementation**: 1\. **For POST request (Option 1)**: - Change the HTTP Method dropdown from "GET" to "POST" - Add a
Content-Type: application/json
header if not already present - Your existing message property configuration should work correctly 2\. **For GET request (Option 2)**: - Keep GET method - Remove the "message" property from the Request Body section - If you need to send the message, add it as a URL parameter instead
6 Views