unwilling-turquoise
unwilling-turquoise3h ago

Not able to set tool to async

curl -Method Post "https://api.vapi.ai/tool" -Headers @{ "Content-Type" = "application/json" "Authorization" = "my-auth-id" } -Body '{ "tools": [ { "toolId": "your-tool-id-1", "async": true } ] }' But it is returning following error curl : {"message":["property tools should not exist","type must be one of the following values: dtmf, endCall, transferCall, transferCancel, transferSuccessful, handoff, output, voicemail, query, sms, function, mcp, apiRequest, code, bash, computer, textEditor, google.calendar.event.create, google.calendar.availability.check, google.sheets.row.append, slack.message.send, gohighlevel.calendar.event.create, gohighlevel.calendar.availability.check, gohighlevel.contact.create, gohighlevel.contact.get, make, ghl","type must be a string"],"error":"Bad Request","statusCode":400} At line:1 char:1 + curl -Method Post "https://api.vapi.ai/tool" ` + ~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
2 Replies
Vapi Support Bot
Your request is failing because the API expects a single tool object, not a "tools" array. Here’s the correct format to create a custom async tool:
curl -Method Post "https://api.vapi.ai/tool" `
-Headers @{
"Content-Type" = "application/json"
"Authorization" = "Bearer 06788ce6"
} `
-Body '{
"type": "function",
"function": {
"name": "your_tool_name",
"description": "Describe your tool",
"parameters": {
"type": "object",
"properties": {
"param1": {
"type": "string",
"description": "Parameter description"
}
},
"required": ["param1"]
}
},
"server": {
"url": "https://your-server-endpoint.com/webhook"
},
"async": true
}'
curl -Method Post "https://api.vapi.ai/tool" `
-Headers @{
"Content-Type" = "application/json"
"Authorization" = "Bearer 06788ce6"
} `
-Body '{
"type": "function",
"function": {
"name": "your_tool_name",
"description": "Describe your tool",
"parameters": {
"type": "object",
"properties": {
"param1": {
"type": "string",
"description": "Parameter description"
}
},
"required": ["param1"]
}
},
"server": {
"url": "https://your-server-endpoint.com/webhook"
},
"async": true
}'
Replace the placeholders with your actual tool details. This should resolve the error and enable async mode as needed. Sources: - Custom tools troubleshooting - Tools calling
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
unwilling-turquoise
unwilling-turquoiseOP3h ago
but my took already exists, so i dont want to create it again instead only want to change a property

Did you find this page helpful?